From eea42dd56d419b4b2f5dc5e9ee01e4932677419c Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 20 Jun 2024 16:51:53 -0700 Subject: [PATCH] sunstepper rebase --- .clang-format | 2 +- .git-blame-ignore-revs | 2 - .github/ISSUE_TEMPLATE/bug.md | 40 - .github/ISSUE_TEMPLATE/general.md | 8 - .github/PULL_REQUEST_TEMPLATE.md | 10 - .../pull_request_template.md | 0 .github/dependabot.yml | 8 - .github/workflows/build-ci-containers-e4s.yml | 16 +- .../workflows/build-ci-containers-nightly.yml | 8 +- .github/workflows/check-clang-format.yml | 14 +- .github/workflows/check-swig.yml | 49 - ...ubuntu-latest.yml => double-precision.yml} | 24 +- .github/workflows/extended-precision.yml | 48 + .github/workflows/macos-latest.yml | 12 +- .github/workflows/single-precision.yml | 48 + .github/workflows/spack-develop.yml | 2 +- .github/workflows/ubuntu-clang-latest.yml | 39 +- .github/workflows/windows-latest-intel.yml | 50 - .github/workflows/windows-latest-mingw.yml | 97 +- .github/workflows/windows-latest.yml | 14 +- .gitlab-ci.yml | 2 - .readthedocs.yaml | 1 - CHANGELOG.md | 127 +- CITATIONS.md | 12 +- CMakeLists.txt | 24 +- README.md | 2 +- benchmarks/CMakeLists.txt | 6 - .../kokkos/ParallelGrid.hpp | 36 +- .../kokkos/advection_reaction_3D.cpp | 25 +- .../kokkos/advection_reaction_3D.hpp | 16 +- .../kokkos/arkode_driver.cpp | 231 +- .../kokkos/ida_driver.cpp | 2 +- .../raja/arkode_driver.cpp | 200 +- benchmarks/diffusion_2D/diffusion_2D.cpp | 8 +- benchmarks/diffusion_2D/diffusion_2D.hpp | 4 +- benchmarks/diffusion_2D/main_arkode.cpp | 58 +- .../diffusion_2D/mpi_serial/buffers.cpp | 2 +- .../diffusion_2D/mpi_serial/diffusion.cpp | 15 +- benchmarks/nvector/test_nvector_performance.c | 12 +- cmake/SundialsBuildOptionsPre.cmake | 7 +- cmake/SundialsExampleOptions.cmake | 11 +- cmake/SundialsSetupCompilers.cmake | 45 +- cmake/SundialsSetupFortran.cmake | 19 + cmake/SundialsTPLOptions.cmake | 2 +- cmake/macros/SundialsAddExamplesGinkgo.cmake | 2 +- cmake/macros/SundialsAddLibrary.cmake | 70 +- cmake/tpl/FindKLU.cmake | 4 +- cmake/tpl/SundialsGinkgo.cmake | 4 +- cmake/tpl/SundialsKLU.cmake | 16 - doc/arkode/examples/source/conf.py | 4 +- .../guide/source/ARKodeButcherTable.rst | 114 +- doc/arkode/guide/source/Butcher.rst | 209 +- doc/arkode/guide/source/Constants.rst | 78 - doc/arkode/guide/source/Introduction.rst | 14 +- doc/arkode/guide/source/Mathematics.rst | 46 +- doc/arkode/guide/source/Organization.rst | 34 +- .../guide/source/Usage/ARKStep/index.rst | 32 - .../Preconditioners.rst | 420 +- .../Relaxation.rst | 92 +- .../{ => ARKStep_c_interface}/Skeleton.rst | 92 +- .../User_callable.rst | 1593 ++-- .../XBraid.rst | 599 +- .../Usage/ARKStep_c_interface/index.rst | 64 + .../guide/source/Usage/ERKStep/index.rst | 31 - .../Relaxation.rst | 89 +- .../Usage/ERKStep_c_interface/Skeleton.rst | 146 + .../User_callable.rst | 811 +- .../Usage/ERKStep_c_interface/index.rst | 45 + .../guide/source/Usage/MRIStep/Skeleton.rst | 146 - .../guide/source/Usage/MRIStep/index.rst | 34 - .../Custom_Inner_Stepper/Description.rst | 17 +- .../Custom_Inner_Stepper/Implementing.rst | 0 .../Custom_Inner_Stepper/index.rst | 0 .../MRIStepCoupling.rst | 136 +- .../Usage/MRIStep_c_interface/Skeleton.rst | 322 + .../User_callable.rst | 1469 +++- .../Usage/MRIStep_c_interface/index.rst | 46 + doc/arkode/guide/source/Usage/Relaxation.rst | 359 - .../guide/source/Usage/SPRKStep/index.rst | 35 - .../Usage/SPRKStep_c_interface/Skeleton.rst | 143 + .../User_callable.rst | 397 +- .../Usage/SPRKStep_c_interface/index.rst | 45 + .../guide/source/Usage/User_callable.rst | 4687 ----------- .../guide/source/Usage/User_supplied.rst | 932 +-- doc/arkode/guide/source/Usage/index.rst | 73 +- doc/arkode/guide/source/conf.py | 4 +- doc/arkode/guide/source/index.rst | 2 +- .../source/sunnonlinsol/ARKODE_interface.rst | 147 +- doc/cvode/guide/source/Introduction.rst | 2 +- doc/cvode/guide/source/Usage/index.rst | 98 +- doc/cvode/guide/source/conf.py | 4 +- doc/cvodes/guide/source/Introduction.rst | 2 +- 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/developers | 1 - doc/ida/guide/source/Introduction.rst | 2 +- doc/ida/guide/source/Usage/index.rst | 151 +- doc/ida/guide/source/conf.py | 4 +- doc/idas/guide/source/Introduction.rst | 2 +- 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/Introduction.rst | 2 +- doc/kinsol/guide/source/Usage/index.rst | 101 +- doc/kinsol/guide/source/conf.py | 9 +- doc/shared/Changelog.rst | 2 +- doc/shared/History.rst | 2 - doc/shared/RecentChanges.rst | 126 +- .../backward_euler_dirk_stab_region.png | Bin 22474 -> 0 bytes ...xplicit_midpoint_euler_erk_stab_region.png | Bin 26029 -> 0 bytes .../arkode/forward_euler_erk_stab_region.png | Bin 21530 -> 0 bytes .../implicit_midpoint_dirk_stab_region.png | Bin 17997 -> 0 bytes .../implicit_trapezoidal_dirk_stab_region.png | Bin 18255 -> 0 bytes .../arkode/ralston_euler_erk_stab_region.png | Bin 25417 -> 0 bytes doc/shared/nvectors/NVector_CUDA.rst | 39 +- doc/shared/nvectors/NVector_Description.rst | 351 +- 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 | 99 +- doc/shared/sundials.bib | 69 +- doc/shared/sundials/Fortran.rst | 41 +- doc/shared/sundials/GPU.rst | 28 +- doc/shared/sundials/Install.rst | 39 +- 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 | 210 +- 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 | 97 +- .../sunmatrix/SUNMatrix_KokkosDense.rst | 18 +- doc/shared/sunmatrix/SUNMatrix_Sparse.rst | 2 +- .../sunmemory/SUNMemory_Description.rst | 123 +- doc/shared/sunnonlinsol/SUNNonlinSol_API.rst | 131 +- .../CMakeLists.txt => doc/shared/versions.py | 27 +- doc/sundials/biblio.bib | 24 +- doc/sundials/ug.tex | 14 +- doc/superbuild/source/conf.py | 4 +- .../developers/getting_started/Checklist.rst | 28 +- doc/superbuild/source/developers/index.rst | 1 - .../source/developers/releases/Checklist.rst | 1 - .../developers/style_guide/SourceCode.rst | 56 +- .../source/developers/sundialsdev/index.rst | 23 - doc/superbuild/source/index.rst | 4 +- examples/CMakeLists.txt | 20 +- .../ark_brusselator1D_task_local_nls.cpp | 112 +- .../CXX_parallel/ark_diffusion_reaction_p.cpp | 313 +- examples/arkode/CXX_parallel/ark_heat2D_p.cpp | 116 +- .../arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp | 130 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg.cpp | 120 +- .../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 | 141 +- .../arkode/CXX_serial/ark_analytic_sys.cpp | 76 +- .../arkode/CXX_serial/ark_analytic_sys.out | 2 +- examples/arkode/CXX_serial/ark_heat2D.cpp | 112 +- examples/arkode/CXX_serial/ark_kpr_Mt.cpp | 150 +- examples/arkode/CXX_serial/ark_pendulum.cpp | 95 +- examples/arkode/CXX_serial/ark_pendulum.out | 2 +- .../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 | 74 +- .../arkode/C_openmp/ark_brusselator1D_omp.out | 2 +- 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 | 115 +- .../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 | 96 +- examples/arkode/C_serial/ark_brusselator.out | 32 +- examples/arkode/C_serial/ark_brusselator1D.c | 73 +- .../arkode/C_serial/ark_brusselator1D.out | 2 +- .../C_serial/ark_brusselator1D_FEM_slu.c | 89 +- .../C_serial/ark_brusselator1D_FEM_slu.out | 2 +- .../C_serial/ark_brusselator1D_imexmri.c | 138 +- .../arkode/C_serial/ark_brusselator1D_klu.c | 65 +- .../arkode/C_serial/ark_brusselator1D_klu.out | 2 +- .../arkode/C_serial/ark_brusselator_1D_mri.c | 70 +- examples/arkode/C_serial/ark_brusselator_fp.c | 55 +- .../arkode/C_serial/ark_brusselator_fp.out | 2 +- .../arkode/C_serial/ark_brusselator_fp_1.out | 2 +- .../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 | 24 +- .../C_serial/ark_dissipated_exp_entropy.c | 92 +- .../arkode/C_serial/ark_harmonic_symplectic.c | 24 +- .../arkode/C_serial/ark_harmonic_symplectic.h | 6 +- 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_kepler.h | 11 +- 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 +- examples/arkode/F2003_custom/CMakeLists.txt | 28 +- .../ark_analytic_complex_f2003.f90 | 81 +- .../F2003_custom/ark_brusselator1D_f2003.f90 | 223 +- .../F2003_custom/fnvector_complex_mod.f90 | 210 +- .../F2003_custom/fnvector_fortran_mod.f90 | 350 +- .../F2003_custom/fsunlinsol_fortran_mod.f90 | 204 +- .../F2003_custom/fsunmatrix_fortran_mod.f90 | 92 +- .../test_fnvector_complex_mod.f90 | 347 +- .../test_fnvector_fortran_mod.f90 | 544 +- .../test_fsunlinsol_fortran_mod.f90 | 132 +- .../test_fsunmatrix_fortran_mod.f90 | 214 +- examples/arkode/F2003_parallel/CMakeLists.txt | 17 +- ...ark_brusselator1D_task_local_nls_f2003.f90 | 1633 ++-- .../F2003_parallel/ark_diag_kry_bbd_f2003.f90 | 469 +- .../F2003_parallel/ark_diag_kry_bbd_f2003.out | 21 +- .../F2003_parallel/ark_diag_non_f2003.f90 | 190 +- .../F2003_parallel/ark_heat2D_f2003.f90 | 864 +- examples/arkode/F2003_serial/CMakeLists.txt | 73 +- .../F2003_serial/ark_analytic_f2003.f90 | 197 +- .../ark_bruss1D_FEM_klu_f2003.f90 | 1700 ++-- .../arkode/F2003_serial/ark_bruss_f2003.f90 | 227 +- .../F2003_serial/ark_diurnal_kry_bp_f2003.f90 | 371 +- .../F2003_serial/ark_diurnal_kry_bp_f2003.out | 9 +- .../arkode/F2003_serial/ark_kpr_mri_f2003.f90 | 422 +- .../F2003_serial/ark_roberts_dnsL_f2003.f90 | 327 +- .../F2003_serial/ark_roberts_dns_f2003.f90 | 328 +- .../F2003_serial/test_ark_butcher_f2003.f90 | 23 +- examples/cvode/CMakeLists.txt | 4 +- 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/F2003_parallel/CMakeLists.txt | 2 +- .../F2003_parallel/cv_diag_kry_bbd_f2003.f90 | 828 +- .../F2003_parallel/cv_diag_kry_f2003.f90 | 428 +- .../F2003_parallel/cv_diag_kry_f2003.out | 56 +- .../F2003_parallel/cv_diag_non_p_f2003.f90 | 186 +- .../F2003_parallel/cv_diag_non_p_f2003.out | 2 +- examples/cvode/F2003_serial/CMakeLists.txt | 28 +- .../F2003_serial/cv_advdiff_bnd_f2003.f90 | 251 +- .../F2003_serial/cv_analytic_fp_f2003.f90 | 95 +- .../cv_analytic_sys_dns_f2003.f90 | 126 +- .../cv_analytic_sys_dns_jac_f2003.f90 | 145 +- .../cv_analytic_sys_klu_f2003.f90 | 153 +- .../F2003_serial/cv_brusselator_dns_f2003.f90 | 142 +- .../F2003_serial/cv_diurnal_kry_bp_f2003.f90 | 321 +- .../F2003_serial/cv_diurnal_kry_f2003.f90 | 432 +- .../F2003_serial/cv_roberts_dnsL_f2003.f90 | 199 +- .../cv_roberts_dns_constraints_f2003.f90 | 201 +- .../F2003_serial/cv_roberts_dns_f2003.f90 | 193 +- .../F2003_serial/cv_roberts_klu_f2003.f90 | 198 +- examples/cvode/ginkgo/CMakeLists.txt | 4 +- ...go.SYCL.out => cv_heat2D_ginkgo.DPCPP.out} | 0 examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp | 10 +- examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp | 22 +- examples/cvode/ginkgo/cv_kpr_ginkgo.hpp | 4 +- examples/cvode/petsc/cv_petsc_ex7.c | 2 +- examples/cvodes/F2003_serial/CMakeLists.txt | 8 +- .../F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 | 216 +- .../F2003_serial/cvs_analytic_fp_f2003.f90 | 104 +- examples/ida/F2003_openmp/CMakeLists.txt | 12 +- .../F2003_openmp/idaHeat2D_kry_omp_f2003.f90 | 273 +- examples/ida/F2003_parallel/CMakeLists.txt | 3 +- .../ida_heat2D_kry_bbd_f2003.f90 | 951 +-- .../ida_heat2D_kry_bbd_f2003.out | 68 - examples/ida/F2003_serial/CMakeLists.txt | 8 +- .../ida/F2003_serial/idaHeat2D_kry_f2003.f90 | 266 +- .../ida/F2003_serial/idaRoberts_dns_f2003.f90 | 233 +- .../ida/trilinos/idaHeat2D_kry_tpetra.cpp | 6 +- examples/idas/F2003_serial/CMakeLists.txt | 10 +- .../idasAkzoNob_ASAi_dns_f2003.f90 | 197 +- .../F2003_serial/idasHeat2D_kry_f2003.f90 | 264 +- examples/kinsol/CMakeLists.txt | 4 +- .../CXX_parallel/kin_heat2D_nonlin_p.hpp | 40 +- .../kin_heat2D_nonlin_hypre_pfmg.hpp | 40 +- examples/kinsol/F2003_parallel/CMakeLists.txt | 2 +- .../F2003_parallel/kin_diagon_kry_f2003.f90 | 227 +- .../F2003_parallel/kin_diagon_kry_f2003.out | 48 - examples/kinsol/F2003_serial/CMakeLists.txt | 16 +- .../F2003_serial/kinDiagon_kry_f2003.f90 | 152 +- .../F2003_serial/kinLaplace_bnd_f2003.f90 | 201 +- .../kinLaplace_picard_kry_f2003.f90 | 270 +- .../F2003_serial/kinRoboKin_dns_f2003.f90 | 180 +- examples/nvector/C_openmp/CMakeLists.txt | 4 +- .../C_openmp/test_fnvector_openmp_mod.f90 | 39 +- examples/nvector/manyvector/CMakeLists.txt | 4 +- .../test_fnvector_manyvector_mod.f90 | 56 +- examples/nvector/mpimanyvector/CMakeLists.txt | 4 +- .../test_fnvector_mpimanyvector_mod.f90 | 105 +- examples/nvector/mpiplusx/CMakeLists.txt | 4 +- .../mpiplusx/test_fnvector_mpiplusx_mod.f90 | 43 +- examples/nvector/parallel/CMakeLists.txt | 4 +- .../parallel/test_fnvector_parallel_mod.f90 | 73 +- examples/nvector/pthreads/CMakeLists.txt | 4 +- .../pthreads/test_fnvector_pthreads_mod.f90 | 40 +- examples/nvector/serial/CMakeLists.txt | 6 +- .../serial/test_fnvector_serial_mod.f90 | 38 +- examples/nvector/test_nvector.f90 | 268 +- examples/sunlinsol/band/CMakeLists.txt | 6 +- .../band/test_fsunlinsol_band_mod.f90 | 60 +- examples/sunlinsol/dense/CMakeLists.txt | 6 +- .../dense/test_fsunlinsol_dense_mod.f90 | 66 +- examples/sunlinsol/ginkgo/CMakeLists.txt | 4 +- .../ginkgo/test_sunlinsol_ginkgo.cpp | 48 +- examples/sunlinsol/klu/CMakeLists.txt | 6 +- .../sunlinsol/klu/test_fsunlinsol_klu_mod.f90 | 48 +- .../kokkos/test_sunlinsol_kokkosdense.cpp | 2 +- examples/sunlinsol/lapackdense/CMakeLists.txt | 6 +- .../test_fsunlinsol_lapackdense_mod.f90 | 60 +- examples/sunlinsol/pcg/serial/CMakeLists.txt | 6 +- .../serial/test_fsunlinsol_pcg_mod_serial.f90 | 153 +- .../sunlinsol/spbcgs/serial/CMakeLists.txt | 6 +- .../test_fsunlinsol_spbcgs_mod_serial.f90 | 157 +- .../sunlinsol/spfgmr/serial/CMakeLists.txt | 6 +- .../test_fsunlinsol_spfgmr_mod_serial.f90 | 163 +- .../sunlinsol/spgmr/serial/CMakeLists.txt | 6 +- .../test_fsunlinsol_spgmr_mod_serial.f90 | 169 +- .../sunlinsol/sptfqmr/serial/CMakeLists.txt | 6 +- .../test_fsunlinsol_sptfqmr_mod_serial.f90 | 159 +- examples/sunlinsol/test_sunlinsol.f90 | 135 +- examples/sunmatrix/band/CMakeLists.txt | 6 +- .../band/test_fsunmatrix_band_mod.f90 | 112 +- examples/sunmatrix/dense/CMakeLists.txt | 4 +- .../dense/test_fsunmatrix_dense_mod.f90 | 78 +- examples/sunmatrix/dreadrb.c | 2 - examples/sunmatrix/ginkgo/CMakeLists.txt | 4 +- .../ginkgo/test_sunmatrix_ginkgo.cpp | 35 +- .../kokkos/test_sunmatrix_kokkosdense.cpp | 2 +- examples/sunmatrix/sparse/CMakeLists.txt | 4 +- .../sparse/test_fsunmatrix_sparse_mod.f90 | 94 +- examples/sunmatrix/test_sunmatrix.f90 | 107 +- .../sunnonlinsol/fixedpoint/CMakeLists.txt | 3 - .../test_fsunnonlinsol_fixedpoint_mod.f90 | 192 +- .../fixedpoint/test_sunnonlinsol_fixedpoint.c | 4 +- examples/sunnonlinsol/newton/CMakeLists.txt | 3 - .../newton/test_fsunnonlinsol_newton_mod.f90 | 135 +- .../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/example_utilities.hpp | 4 +- examples/utilities/test_utilities.f90 | 66 +- include/arkode/arkode.h | 243 +- include/arkode/arkode_arkstep.h | 609 +- include/arkode/arkode_butcher_dirk.h | 8 +- include/arkode/arkode_butcher_erk.h | 7 +- include/arkode/arkode_erkstep.h | 323 +- include/arkode/arkode_ls.h | 36 - include/arkode/arkode_mristep.h | 373 +- include/arkode/arkode_sprkstep.h | 119 +- include/arkode/arkode_xbraid.h | 10 +- include/cvodes/cvodes.h | 3 +- include/nvector/nvector_parallel.h | 6 +- include/nvector/nvector_parhyp.h | 8 +- include/nvector/nvector_petsc.h | 9 +- include/nvector/nvector_serial.h | 6 +- .../trilinos/SundialsTpetraVectorKernels.hpp | 8 +- include/sundials/sundials_adaptcontroller.h | 4 - include/sundials/sundials_config.in | 3 +- include/sundials/sundials_stepper.h | 104 + include/sunlinsol/sunlinsol_ginkgo.hpp | 8 - include/sunlinsol/sunlinsol_kokkosdense.hpp | 4 +- include/sunmatrix/sunmatrix_kokkosdense.hpp | 2 +- scripts/format.sh | 5 +- scripts/startReleaseCycle.sh | 12 +- scripts/sundialsdev/__init__.py | 8 - scripts/sundialsdev/logs.py | 120 - scripts/tarscript | 14 +- scripts/updateVersion.sh | 4 +- src/arkode/CMakeLists.txt | 2 +- src/arkode/README.md | 10 +- src/arkode/arkode.c | 2427 +++--- src/arkode/arkode_adapt.c | 14 +- src/arkode/arkode_adapt_impl.h | 44 +- src/arkode/arkode_arkstep.c | 1139 ++- src/arkode/arkode_arkstep_impl.h | 122 +- src/arkode/arkode_arkstep_io.c | 3662 ++++----- src/arkode/arkode_arkstep_nls.c | 462 +- src/arkode/arkode_bandpre.c | 24 +- src/arkode/arkode_bbdpre.c | 30 +- src/arkode/arkode_butcher.c | 1161 ++- src/arkode/arkode_butcher_dirk.c | 22 - src/arkode/arkode_butcher_dirk.def | 46 +- src/arkode/arkode_butcher_erk.c | 24 +- src/arkode/arkode_butcher_erk.def | 95 +- src/arkode/arkode_erkstep.c | 362 +- src/arkode/arkode_erkstep_impl.h | 24 +- src/arkode/arkode_erkstep_io.c | 1136 ++- src/arkode/arkode_impl.h | 1556 ++-- src/arkode/arkode_interp.c | 219 +- src/arkode/arkode_interp_impl.h | 31 +- src/arkode/arkode_io.c | 3422 +++----- src/arkode/arkode_ls.c | 1303 +-- src/arkode/arkode_ls_impl.h | 98 +- src/arkode/arkode_mri_tables.def | 178 +- src/arkode/arkode_mristep.c | 868 +- src/arkode/arkode_mristep_impl.h | 82 +- src/arkode/arkode_mristep_io.c | 1212 ++- src/arkode/arkode_mristep_nls.c | 64 +- src/arkode/arkode_relaxation.c | 269 +- src/arkode/arkode_relaxation_impl.h | 21 +- src/arkode/arkode_root.c | 38 +- src/arkode/arkode_root_impl.h | 4 +- src/arkode/arkode_sprk.c | 92 +- src/arkode/arkode_sprkstep.c | 271 +- src/arkode/arkode_sprkstep_impl.h | 27 +- src/arkode/arkode_sprkstep_io.c | 456 +- src/arkode/arkode_user_controller.c | 16 +- .../{fmod_int32 => fmod}/CMakeLists.txt | 0 .../farkode_arkstep_mod.c | 356 +- .../farkode_arkstep_mod.f90 | 760 +- .../farkode_erkstep_mod.c | 216 +- .../farkode_erkstep_mod.f90 | 457 +- src/arkode/fmod/farkode_mod.c | 1058 +++ src/arkode/fmod/farkode_mod.f90 | 1665 ++++ .../farkode_mristep_mod.c | 492 +- .../farkode_mristep_mod.f90 | 947 ++- .../farkode_sprkstep_mod.c | 134 +- .../farkode_sprkstep_mod.f90 | 296 +- src/arkode/fmod_int32/farkode_arkstep_mod.c | 2660 ------ src/arkode/fmod_int32/farkode_arkstep_mod.f90 | 4625 ----------- src/arkode/fmod_int32/farkode_erkstep_mod.f90 | 2566 ------ 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 -------- src/arkode/fmod_int64/CMakeLists.txt | 59 - src/arkode/fmod_int64/farkode_erkstep_mod.c | 1563 ---- src/arkode/fmod_int64/farkode_mod.c | 3246 -------- src/arkode/fmod_int64/farkode_mod.f90 | 5769 ------------- src/arkode/fmod_int64/farkode_sprkstep_mod.c | 767 -- .../fmod_int64/farkode_sprkstep_mod.f90 | 1081 --- src/arkode/xbraid/arkode_xbraid.c | 70 +- src/arkode/xbraid/arkode_xbraid_impl.h | 9 - src/cvode/CMakeLists.txt | 4 +- src/cvode/README.md | 10 +- src/cvode/cvode.c | 17 +- src/cvode/cvode_bandpre.c | 9 +- src/cvode/cvode_bbdpre.c | 16 +- src/cvode/cvode_diag.c | 27 +- src/cvode/cvode_fused_stubs.c | 10 +- src/cvode/cvode_impl.h | 31 +- src/cvode/cvode_io.c | 4 - src/cvode/cvode_ls.c | 5 +- src/cvode/cvode_nls.c | 6 + src/cvode/{fmod_int32 => fmod}/CMakeLists.txt | 0 src/cvode/{fmod_int64 => fmod}/fcvode_mod.c | 0 src/cvode/{fmod_int64 => fmod}/fcvode_mod.f90 | 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/cvodes/CMakeLists.txt | 2 +- src/cvodes/README.md | 10 +- src/cvodes/cvodea.c | 2 +- src/cvodes/cvodes.c | 18 +- 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 +- .../{fmod_int32 => fmod}/CMakeLists.txt | 0 src/cvodes/{fmod_int64 => fmod}/fcvodes_mod.c | 0 .../{fmod_int64 => fmod}/fcvodes_mod.f90 | 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/ida/CMakeLists.txt | 2 +- src/ida/README.md | 10 +- src/ida/{fmod_int32 => fmod}/CMakeLists.txt | 0 src/ida/{fmod_int64 => fmod}/fida_mod.c | 0 src/ida/{fmod_int64 => fmod}/fida_mod.f90 | 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/ida_bbdpre.c | 13 +- src/ida/ida_ic.c | 2 + src/ida/ida_impl.h | 4 +- src/ida/ida_ls.c | 5 +- src/ida/ida_nls.c | 6 +- src/idas/CMakeLists.txt | 2 +- src/idas/README.md | 10 +- src/idas/{fmod_int32 => fmod}/CMakeLists.txt | 0 src/idas/{fmod_int64 => fmod}/fidas_mod.c | 0 src/idas/{fmod_int64 => fmod}/fidas_mod.f90 | 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/idas.c | 13 +- src/idas/idas_bbdpre.c | 13 +- src/idas/idas_ic.c | 7 + 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/CMakeLists.txt | 2 +- src/kinsol/README.md | 10 +- .../{fmod_int32 => fmod}/CMakeLists.txt | 0 src/kinsol/{fmod_int64 => fmod}/fkinsol_mod.c | 0 .../{fmod_int64 => fmod}/fkinsol_mod.f90 | 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/kinsol.c | 16 +- src/kinsol/kinsol_bbdpre.c | 12 +- src/kinsol/kinsol_impl.h | 4 +- src/kinsol/kinsol_ls.c | 8 +- src/nvector/manyvector/CMakeLists.txt | 2 +- .../{fmod_int32 => fmod}/CMakeLists.txt | 0 .../fnvector_manyvector_mod.c | 0 .../fnvector_manyvector_mod.f90 | 12 - .../fnvector_mpimanyvector_mod.c | 0 .../fnvector_mpimanyvector_mod.f90 | 12 - .../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 - src/nvector/manyvector/nvector_manyvector.c | 13 +- src/nvector/mpiplusx/CMakeLists.txt | 2 +- .../{fmod_int32 => fmod}/CMakeLists.txt | 0 .../fnvector_mpiplusx_mod.c | 0 .../fnvector_mpiplusx_mod.f90 | 0 .../fmod_int32/fnvector_mpiplusx_mod.c | 327 - .../fmod_int32/fnvector_mpiplusx_mod.f90 | 241 - .../mpiplusx/fmod_int64/CMakeLists.txt | 43 - src/nvector/mpiplusx/nvector_mpiplusx.c | 6 +- src/nvector/openmp/CMakeLists.txt | 2 +- .../{fmod_int32 => fmod}/CMakeLists.txt | 0 .../fnvector_openmp_mod.c | 0 .../fnvector_openmp_mod.f90 | 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 - src/nvector/openmp/nvector_openmp.c | 13 +- src/nvector/parallel/CMakeLists.txt | 2 +- .../{fmod_int32 => fmod}/CMakeLists.txt | 0 .../fnvector_parallel_mod.c | 0 .../fnvector_parallel_mod.f90 | 0 .../fmod_int32/fnvector_parallel_mod.c | 1173 --- .../fmod_int32/fnvector_parallel_mod.f90 | 1781 ---- .../parallel/fmod_int64/CMakeLists.txt | 49 - src/nvector/parallel/nvector_parallel.c | 17 +- src/nvector/parhyp/nvector_parhyp.c | 20 +- src/nvector/petsc/nvector_petsc.c | 24 +- src/nvector/pthreads/CMakeLists.txt | 2 +- .../{fmod_int32 => fmod}/CMakeLists.txt | 0 .../fnvector_pthreads_mod.c | 0 .../fnvector_pthreads_mod.f90 | 0 .../fmod_int32/fnvector_pthreads_mod.c | 961 --- .../fmod_int32/fnvector_pthreads_mod.f90 | 1461 ---- .../pthreads/fmod_int64/CMakeLists.txt | 33 - src/nvector/pthreads/nvector_pthreads.c | 11 +- src/nvector/serial/CMakeLists.txt | 2 +- .../{fmod_int64 => fmod}/CMakeLists.txt | 0 .../fnvector_serial_mod.c | 0 .../fnvector_serial_mod.f90 | 0 src/nvector/serial/fmod_int32/CMakeLists.txt | 30 - .../serial/fmod_int32/fnvector_serial_mod.c | 955 --- .../serial/fmod_int32/fnvector_serial_mod.f90 | 1449 ---- src/nvector/serial/nvector_serial.c | 15 +- src/nvector/sycl/nvector_sycl.cpp | 2 +- src/nvector/trilinos/nvector_trilinos.cpp | 9 +- src/sunadaptcontroller/imexgus/CMakeLists.txt | 2 +- .../{fmod_int32 => fmod}/CMakeLists.txt | 1 + .../fsunadaptcontroller_imexgus_mod.c | 0 .../fsunadaptcontroller_imexgus_mod.f90 | 0 .../imexgus/fmod_int64/CMakeLists.txt | 25 - .../fsunadaptcontroller_imexgus_mod.c | 359 - .../fsunadaptcontroller_imexgus_mod.f90 | 313 - .../imexgus/sunadaptcontroller_imexgus.c | 9 +- .../soderlind/CMakeLists.txt | 2 +- .../{fmod_int64 => fmod}/CMakeLists.txt | 1 + .../fsunadaptcontroller_soderlind_mod.c | 0 .../fsunadaptcontroller_soderlind_mod.f90 | 0 .../soderlind/fmod_int32/CMakeLists.txt | 25 - .../fsunadaptcontroller_soderlind_mod.c | 501 -- .../fsunadaptcontroller_soderlind_mod.f90 | 577 -- .../soderlind/sunadaptcontroller_soderlind.c | 9 +- src/sundials/CMakeLists.txt | 19 +- .../{fmod_int32 => fmod}/CMakeLists.txt | 2 + .../{fmod_int64 => fmod}/fsundials_core_mod.c | 19 +- .../fsundials_core_mod.f90 | 25 +- src/sundials/fmod_int32/fsundials_core_mod.c | 2644 ------ .../fmod_int32/fsundials_core_mod.f90 | 4786 ----------- src/sundials/sundials_band.c | 63 +- src/sundials/sundials_context.c | 9 +- src/sundials/sundials_dense.c | 102 +- src/sundials/sundials_direct.c | 59 + src/sundials/sundials_errors.c | 18 +- src/sundials/sundials_futils.c | 1 - src/sundials/sundials_hashmap.c | 20 +- src/sundials/sundials_hashmap_impl.h | 3 +- src/sundials/sundials_logger.c | 22 +- src/sundials/sundials_macros.h | 39 - src/sundials/sundials_mpi_errors.c | 10 +- src/sundials/sundials_nvector.c | 16 +- src/sundials/sundials_profiler.c | 29 +- src/sundials/sundials_stepper.c | 232 + src/sundials/sundials_stepper_impl.h | 60 + src/sundials/sundials_utils.h | 2 +- src/sundials/sundials_xbraid.c | 26 +- src/sunlinsol/band/CMakeLists.txt | 2 +- .../band/{fmod_int64 => fmod}/CMakeLists.txt | 0 .../fsunlinsol_band_mod.c | 0 .../fsunlinsol_band_mod.f90 | 0 src/sunlinsol/band/fmod_int32/CMakeLists.txt | 30 - .../band/fmod_int32/fsunlinsol_band_mod.c | 337 - .../band/fmod_int32/fsunlinsol_band_mod.f90 | 271 - src/sunlinsol/band/sunlinsol_band.c | 12 +- src/sunlinsol/dense/CMakeLists.txt | 2 +- .../dense/{fmod_int64 => fmod}/CMakeLists.txt | 0 .../fsunlinsol_dense_mod.c | 0 .../fsunlinsol_dense_mod.f90 | 0 src/sunlinsol/dense/fmod_int32/CMakeLists.txt | 29 - .../dense/fmod_int32/fsunlinsol_dense_mod.c | 337 - .../dense/fmod_int32/fsunlinsol_dense_mod.f90 | 271 - src/sunlinsol/dense/sunlinsol_dense.c | 13 +- src/sunlinsol/klu/CMakeLists.txt | 2 +- .../klu/{fmod_int32 => fmod}/CMakeLists.txt | 0 .../{fmod_int64 => fmod}/fsunlinsol_klu_mod.c | 0 .../fsunlinsol_klu_mod.f90 | 0 .../klu/fmod_int32/fsunlinsol_klu_mod.c | 429 - .../klu/fmod_int32/fsunlinsol_klu_mod.f90 | 420 - src/sunlinsol/klu/fmod_int64/CMakeLists.txt | 30 - src/sunlinsol/klu/sunlinsol_klu.c | 54 +- .../lapackband/sunlinsol_lapackband.c | 9 +- src/sunlinsol/lapackdense/CMakeLists.txt | 2 +- .../{fmod_int64 => fmod}/CMakeLists.txt | 0 .../fsunlinsol_lapackdense_mod.c | 0 .../fsunlinsol_lapackdense_mod.f90 | 0 .../lapackdense/fmod_int32/CMakeLists.txt | 30 - .../fmod_int32/fsunlinsol_lapackdense_mod.c | 337 - .../fmod_int32/fsunlinsol_lapackdense_mod.f90 | 271 - .../lapackdense/sunlinsol_lapackdense.c | 9 +- src/sunlinsol/pcg/CMakeLists.txt | 2 +- .../pcg/{fmod_int64 => fmod}/CMakeLists.txt | 0 .../{fmod_int64 => fmod}/fsunlinsol_pcg_mod.c | 0 .../fsunlinsol_pcg_mod.f90 | 0 src/sunlinsol/pcg/fmod_int32/CMakeLists.txt | 30 - .../pcg/fmod_int32/fsunlinsol_pcg_mod.c | 467 -- .../pcg/fmod_int32/fsunlinsol_pcg_mod.f90 | 514 -- src/sunlinsol/pcg/sunlinsol_pcg.c | 14 +- src/sunlinsol/spbcgs/CMakeLists.txt | 2 +- .../{fmod_int64 => fmod}/CMakeLists.txt | 0 .../fsunlinsol_spbcgs_mod.c | 0 .../fsunlinsol_spbcgs_mod.f90 | 0 .../spbcgs/fmod_int32/CMakeLists.txt | 30 - .../spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.c | 467 -- .../fmod_int32/fsunlinsol_spbcgs_mod.f90 | 514 -- src/sunlinsol/spbcgs/sunlinsol_spbcgs.c | 12 +- src/sunlinsol/spfgmr/CMakeLists.txt | 2 +- .../{fmod_int32 => fmod}/CMakeLists.txt | 0 .../fsunlinsol_spfgmr_mod.c | 0 .../fsunlinsol_spfgmr_mod.f90 | 0 .../spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.c | 481 -- .../fmod_int32/fsunlinsol_spfgmr_mod.f90 | 541 -- .../spfgmr/fmod_int64/CMakeLists.txt | 30 - src/sunlinsol/spfgmr/sunlinsol_spfgmr.c | 12 +- src/sunlinsol/spgmr/CMakeLists.txt | 2 +- .../spgmr/{fmod_int32 => fmod}/CMakeLists.txt | 0 .../fsunlinsol_spgmr_mod.c | 0 .../fsunlinsol_spgmr_mod.f90 | 0 .../spgmr/fmod_int32/fsunlinsol_spgmr_mod.c | 481 -- .../spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 | 541 -- src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt | 30 - src/sunlinsol/spgmr/sunlinsol_spgmr.c | 12 +- src/sunlinsol/sptfqmr/CMakeLists.txt | 2 +- .../{fmod_int32 => fmod}/CMakeLists.txt | 0 .../fsunlinsol_sptfqmr_mod.c | 0 .../fsunlinsol_sptfqmr_mod.f90 | 0 .../fmod_int32/fsunlinsol_sptfqmr_mod.c | 467 -- .../fmod_int32/fsunlinsol_sptfqmr_mod.f90 | 514 -- .../sptfqmr/fmod_int64/CMakeLists.txt | 30 - src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c | 12 +- .../superludist/sunlinsol_superludist.c | 20 +- src/sunlinsol/superlumt/sunlinsol_superlumt.c | 11 +- src/sunmatrix/band/CMakeLists.txt | 2 +- .../band/{fmod_int64 => fmod}/CMakeLists.txt | 0 .../fsunmatrix_band_mod.c | 4 +- .../fsunmatrix_band_mod.f90 | 24 +- src/sunmatrix/band/fmod_int32/CMakeLists.txt | 30 - .../band/fmod_int32/fsunmatrix_band_mod.c | 500 -- .../band/fmod_int32/fsunmatrix_band_mod.f90 | 595 -- src/sunmatrix/band/sunmatrix_band.c | 11 +- src/sunmatrix/dense/CMakeLists.txt | 2 +- .../dense/{fmod_int32 => fmod}/CMakeLists.txt | 0 .../fsunmatrix_dense_mod.c | 4 +- .../fsunmatrix_dense_mod.f90 | 22 +- .../dense/fmod_int32/fsunmatrix_dense_mod.c | 430 - .../dense/fmod_int32/fsunmatrix_dense_mod.f90 | 463 -- src/sunmatrix/dense/fmod_int64/CMakeLists.txt | 30 - src/sunmatrix/dense/sunmatrix_dense.c | 11 +- src/sunmatrix/slunrloc/sunmatrix_slunrloc.c | 11 +- src/sunmatrix/sparse/CMakeLists.txt | 2 +- .../{fmod_int64 => fmod}/CMakeLists.txt | 0 .../fsunmatrix_sparse_mod.c | 30 +- .../fsunmatrix_sparse_mod.f90 | 22 +- .../sparse/fmod_int32/CMakeLists.txt | 30 - .../sparse/fmod_int32/fsunmatrix_sparse_mod.c | 565 -- .../fmod_int32/fsunmatrix_sparse_mod.f90 | 670 -- src/sunmatrix/sparse/sunmatrix_sparse.c | 17 +- src/sunmemory/system/sundials_system_memory.c | 24 +- src/sunnonlinsol/fixedpoint/CMakeLists.txt | 2 +- .../{fmod_int32 => fmod}/CMakeLists.txt | 0 .../fsunnonlinsol_fixedpoint_mod.c | 0 .../fsunnonlinsol_fixedpoint_mod.f90 | 0 .../fixedpoint/fmod_int64/CMakeLists.txt | 31 - .../fmod_int64/fsunnonlinsol_fixedpoint_mod.c | 419 - .../fsunnonlinsol_fixedpoint_mod.f90 | 425 - .../fixedpoint/sunnonlinsol_fixedpoint.c | 11 +- src/sunnonlinsol/newton/CMakeLists.txt | 2 +- .../{fmod_int64 => fmod}/CMakeLists.txt | 0 .../fsunnonlinsol_newton_mod.c | 0 .../fsunnonlinsol_newton_mod.f90 | 0 .../newton/fmod_int32/CMakeLists.txt | 31 - .../fmod_int64/fsunnonlinsol_newton_mod.c | 429 - .../fmod_int64/fsunnonlinsol_newton_mod.f90 | 443 - src/sunnonlinsol/newton/sunnonlinsol_newton.c | 65 +- .../petscsnes/sunnonlinsol_petscsnes.c | 20 +- swig/Makefile | 87 +- 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 | 20 +- 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 | 11 +- test/env/docker.sh | 13 +- test/env/lassen.sh | 2 +- test/env/quartz.sh | 2 +- test/env/summit.sh | 139 + test/unit_tests/CMakeLists.txt | 6 - .../CXX_parallel/ark_test_heat2D_mri.cpp | 176 +- .../arkode/CXX_serial/CMakeLists.txt | 26 +- .../CXX_serial/ark_test_analytic_sys_mri.cpp | 150 +- .../arkode/CXX_serial/ark_test_butcher.cpp | 101 +- .../arkode/CXX_serial/ark_test_butcher.out | 11 +- .../CXX_serial/ark_test_dahlquist_ark.cpp | 215 +- ...k_2_0_1.out => ark_test_dahlquist_ark.out} | 1159 +-- .../ark_test_dahlquist_ark_0_-1_0.out | 2337 ------ ...0_1.out => ark_test_dahlquist_ark_0_0.out} | 514 +- .../ark_test_dahlquist_ark_0_0_0.out | 2337 ------ ...1_1.out => ark_test_dahlquist_ark_0_1.out} | 360 +- .../ark_test_dahlquist_ark_0_1_0.out | 2337 ------ .../ark_test_dahlquist_ark_1_-1_0.out | 2337 ------ ...0_1.out => ark_test_dahlquist_ark_1_0.out} | 514 +- .../ark_test_dahlquist_ark_1_0_0.out | 2337 ------ ...1_1.out => ark_test_dahlquist_ark_1_1.out} | 360 +- .../ark_test_dahlquist_ark_1_1_0.out | 2337 ------ .../ark_test_dahlquist_ark_2_-1_0.out | 2337 ------ ...0_0.out => ark_test_dahlquist_ark_2_0.out} | 368 +- ...1_0.out => ark_test_dahlquist_ark_2_1.out} | 358 +- .../ark_test_dahlquist_ark_2_1_1.out | 2337 ------ .../CXX_serial/ark_test_dahlquist_erk.cpp | 105 +- ..._erk_-1.out => ark_test_dahlquist_erk.out} | 472 +- .../CXX_serial/ark_test_dahlquist_erk_0.out | 184 +- .../CXX_serial/ark_test_dahlquist_erk_1.out | 184 +- .../CXX_serial/ark_test_dahlquist_mri.cpp | 439 +- ..._mri_-1.out => ark_test_dahlquist_mri.out} | 328 +- .../CXX_serial/ark_test_dahlquist_mri_0.out | 706 -- .../CXX_serial/ark_test_dahlquist_mri_1.out | 706 -- .../arkode/CXX_serial/ark_test_getjac.cpp | 40 +- .../arkode/CXX_serial/ark_test_getjac_mri.cpp | 48 +- .../C_serial/ark_test_arkstepsetforcing.c | 102 +- .../arkode/C_serial/ark_test_getuserdata.c | 34 +- .../arkode/C_serial/ark_test_innerstepper.c | 22 +- .../arkode/C_serial/ark_test_interp.c | 136 +- .../arkode/C_serial/ark_test_mass.c | 47 +- .../arkode/C_serial/ark_test_reset.c | 218 +- .../arkode/C_serial/ark_test_tstop.c | 27 +- .../F2003_serial/ark_test_table_f2003.f90 | 18 +- .../gtest/test_arkode_error_handling.cpp | 4 +- .../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 +- 839 files changed, 37535 insertions(+), 175562 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug.md delete mode 100644 .github/ISSUE_TEMPLATE/general.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template.md delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/check-swig.yml rename .github/workflows/{ubuntu-latest.yml => double-precision.yml} (67%) create mode 100644 .github/workflows/extended-precision.yml create mode 100644 .github/workflows/single-precision.yml delete mode 100644 .github/workflows/windows-latest-intel.yml delete mode 100644 doc/arkode/guide/source/Usage/ARKStep/index.rst rename doc/arkode/guide/source/Usage/{ => ARKStep_c_interface}/Preconditioners.rst (61%) rename doc/arkode/guide/source/Usage/{ARKStep => ARKStep_c_interface}/Relaxation.rst (88%) rename doc/arkode/guide/source/Usage/{ => ARKStep_c_interface}/Skeleton.rst (73%) rename doc/arkode/guide/source/Usage/{ARKStep => ARKStep_c_interface}/User_callable.rst (71%) rename doc/arkode/guide/source/Usage/{ARKStep => ARKStep_c_interface}/XBraid.rst (60%) create mode 100644 doc/arkode/guide/source/Usage/ARKStep_c_interface/index.rst delete mode 100644 doc/arkode/guide/source/Usage/ERKStep/index.rst rename doc/arkode/guide/source/Usage/{ERKStep => ERKStep_c_interface}/Relaxation.rst (88%) create mode 100644 doc/arkode/guide/source/Usage/ERKStep_c_interface/Skeleton.rst rename doc/arkode/guide/source/Usage/{ERKStep => ERKStep_c_interface}/User_callable.rst (66%) create mode 100644 doc/arkode/guide/source/Usage/ERKStep_c_interface/index.rst delete mode 100644 doc/arkode/guide/source/Usage/MRIStep/Skeleton.rst delete mode 100644 doc/arkode/guide/source/Usage/MRIStep/index.rst rename doc/arkode/guide/source/Usage/{MRIStep => MRIStep_c_interface}/Custom_Inner_Stepper/Description.rst (95%) rename doc/arkode/guide/source/Usage/{MRIStep => MRIStep_c_interface}/Custom_Inner_Stepper/Implementing.rst (100%) rename doc/arkode/guide/source/Usage/{MRIStep => MRIStep_c_interface}/Custom_Inner_Stepper/index.rst (100%) rename doc/arkode/guide/source/Usage/{MRIStep => MRIStep_c_interface}/MRIStepCoupling.rst (72%) create mode 100644 doc/arkode/guide/source/Usage/MRIStep_c_interface/Skeleton.rst rename doc/arkode/guide/source/Usage/{MRIStep => MRIStep_c_interface}/User_callable.rst (58%) create mode 100644 doc/arkode/guide/source/Usage/MRIStep_c_interface/index.rst delete mode 100644 doc/arkode/guide/source/Usage/Relaxation.rst delete mode 100644 doc/arkode/guide/source/Usage/SPRKStep/index.rst create mode 100644 doc/arkode/guide/source/Usage/SPRKStep_c_interface/Skeleton.rst rename doc/arkode/guide/source/Usage/{SPRKStep => SPRKStep_c_interface}/User_callable.rst (68%) create mode 100644 doc/arkode/guide/source/Usage/SPRKStep_c_interface/index.rst delete mode 100644 doc/arkode/guide/source/Usage/User_callable.rst delete mode 120000 doc/developers delete mode 100644 doc/shared/figs/arkode/backward_euler_dirk_stab_region.png delete mode 100644 doc/shared/figs/arkode/explicit_midpoint_euler_erk_stab_region.png delete mode 100644 doc/shared/figs/arkode/forward_euler_erk_stab_region.png delete mode 100644 doc/shared/figs/arkode/implicit_midpoint_dirk_stab_region.png delete mode 100644 doc/shared/figs/arkode/implicit_trapezoidal_dirk_stab_region.png delete mode 100644 doc/shared/figs/arkode/ralston_euler_erk_stab_region.png delete mode 100644 doc/shared/sundials_vars.py rename src/sundials/fmod_int64/CMakeLists.txt => doc/shared/versions.py (50%) delete mode 100644 doc/superbuild/source/developers/sundialsdev/index.rst rename examples/cvode/ginkgo/{cv_heat2D_ginkgo.SYCL.out => cv_heat2D_ginkgo.DPCPP.out} (100%) delete mode 100644 examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.out delete mode 100644 examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.out create mode 100644 include/sundials/sundials_stepper.h delete mode 100644 scripts/sundialsdev/__init__.py delete mode 100644 scripts/sundialsdev/logs.py rename src/arkode/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/arkode/{fmod_int64 => fmod}/farkode_arkstep_mod.c (100%) rename src/arkode/{fmod_int64 => fmod}/farkode_arkstep_mod.f90 (99%) rename src/arkode/{fmod_int32 => fmod}/farkode_erkstep_mod.c (100%) rename src/arkode/{fmod_int64 => fmod}/farkode_erkstep_mod.f90 (99%) create mode 100644 src/arkode/fmod/farkode_mod.c create mode 100644 src/arkode/fmod/farkode_mod.f90 rename src/arkode/{fmod_int64 => fmod}/farkode_mristep_mod.c (100%) rename src/arkode/{fmod_int64 => fmod}/farkode_mristep_mod.f90 (98%) rename src/arkode/{fmod_int32 => fmod}/farkode_sprkstep_mod.c (97%) rename src/arkode/{fmod_int32 => fmod}/farkode_sprkstep_mod.f90 (95%) delete mode 100644 src/arkode/fmod_int32/farkode_arkstep_mod.c delete mode 100644 src/arkode/fmod_int32/farkode_arkstep_mod.f90 delete mode 100644 src/arkode/fmod_int32/farkode_erkstep_mod.f90 delete mode 100644 src/arkode/fmod_int32/farkode_mod.c delete mode 100644 src/arkode/fmod_int32/farkode_mod.f90 delete mode 100644 src/arkode/fmod_int32/farkode_mristep_mod.c delete mode 100644 src/arkode/fmod_int32/farkode_mristep_mod.f90 delete mode 100644 src/arkode/fmod_int64/CMakeLists.txt delete mode 100644 src/arkode/fmod_int64/farkode_erkstep_mod.c delete mode 100644 src/arkode/fmod_int64/farkode_mod.c delete mode 100644 src/arkode/fmod_int64/farkode_mod.f90 delete mode 100644 src/arkode/fmod_int64/farkode_sprkstep_mod.c delete mode 100644 src/arkode/fmod_int64/farkode_sprkstep_mod.f90 rename src/cvode/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/cvode/{fmod_int64 => fmod}/fcvode_mod.c (100%) rename src/cvode/{fmod_int64 => fmod}/fcvode_mod.f90 (100%) delete mode 100644 src/cvode/fmod_int32/fcvode_mod.c delete mode 100644 src/cvode/fmod_int32/fcvode_mod.f90 delete mode 100644 src/cvode/fmod_int64/CMakeLists.txt rename src/cvodes/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/cvodes/{fmod_int64 => fmod}/fcvodes_mod.c (100%) rename src/cvodes/{fmod_int64 => fmod}/fcvodes_mod.f90 (100%) delete mode 100644 src/cvodes/fmod_int32/fcvodes_mod.c delete mode 100644 src/cvodes/fmod_int32/fcvodes_mod.f90 delete mode 100644 src/cvodes/fmod_int64/CMakeLists.txt rename src/ida/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/ida/{fmod_int64 => fmod}/fida_mod.c (100%) rename src/ida/{fmod_int64 => fmod}/fida_mod.f90 (100%) delete mode 100644 src/ida/fmod_int32/fida_mod.c delete mode 100644 src/ida/fmod_int32/fida_mod.f90 delete mode 100644 src/ida/fmod_int64/CMakeLists.txt rename src/idas/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/idas/{fmod_int64 => fmod}/fidas_mod.c (100%) rename src/idas/{fmod_int64 => fmod}/fidas_mod.f90 (100%) delete mode 100644 src/idas/fmod_int32/fidas_mod.c delete mode 100644 src/idas/fmod_int32/fidas_mod.f90 delete mode 100644 src/idas/fmod_int64/CMakeLists.txt rename src/kinsol/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/kinsol/{fmod_int64 => fmod}/fkinsol_mod.c (100%) rename src/kinsol/{fmod_int64 => fmod}/fkinsol_mod.f90 (100%) delete mode 100644 src/kinsol/fmod_int32/fkinsol_mod.c delete mode 100644 src/kinsol/fmod_int32/fkinsol_mod.f90 delete mode 100644 src/kinsol/fmod_int64/CMakeLists.txt rename src/nvector/manyvector/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/nvector/manyvector/{fmod_int64 => fmod}/fnvector_manyvector_mod.c (100%) rename src/nvector/manyvector/{fmod_int64 => fmod}/fnvector_manyvector_mod.f90 (99%) rename src/nvector/manyvector/{fmod_int64 => fmod}/fnvector_mpimanyvector_mod.c (100%) rename src/nvector/manyvector/{fmod_int64 => fmod}/fnvector_mpimanyvector_mod.f90 (99%) delete mode 100644 src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.c delete mode 100644 src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.f90 delete mode 100644 src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.c delete mode 100644 src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.f90 delete mode 100644 src/nvector/manyvector/fmod_int64/CMakeLists.txt rename src/nvector/mpiplusx/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/nvector/mpiplusx/{fmod_int64 => fmod}/fnvector_mpiplusx_mod.c (100%) rename src/nvector/mpiplusx/{fmod_int64 => fmod}/fnvector_mpiplusx_mod.f90 (100%) delete mode 100644 src/nvector/mpiplusx/fmod_int32/fnvector_mpiplusx_mod.c delete mode 100644 src/nvector/mpiplusx/fmod_int32/fnvector_mpiplusx_mod.f90 delete mode 100644 src/nvector/mpiplusx/fmod_int64/CMakeLists.txt rename src/nvector/openmp/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/nvector/openmp/{fmod_int64 => fmod}/fnvector_openmp_mod.c (100%) rename src/nvector/openmp/{fmod_int64 => fmod}/fnvector_openmp_mod.f90 (100%) delete mode 100644 src/nvector/openmp/fmod_int32/fnvector_openmp_mod.c delete mode 100644 src/nvector/openmp/fmod_int32/fnvector_openmp_mod.f90 delete mode 100644 src/nvector/openmp/fmod_int64/CMakeLists.txt rename src/nvector/parallel/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/nvector/parallel/{fmod_int64 => fmod}/fnvector_parallel_mod.c (100%) rename src/nvector/parallel/{fmod_int64 => fmod}/fnvector_parallel_mod.f90 (100%) delete mode 100644 src/nvector/parallel/fmod_int32/fnvector_parallel_mod.c delete mode 100644 src/nvector/parallel/fmod_int32/fnvector_parallel_mod.f90 delete mode 100644 src/nvector/parallel/fmod_int64/CMakeLists.txt rename src/nvector/pthreads/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/nvector/pthreads/{fmod_int64 => fmod}/fnvector_pthreads_mod.c (100%) rename src/nvector/pthreads/{fmod_int64 => fmod}/fnvector_pthreads_mod.f90 (100%) delete mode 100644 src/nvector/pthreads/fmod_int32/fnvector_pthreads_mod.c delete mode 100644 src/nvector/pthreads/fmod_int32/fnvector_pthreads_mod.f90 delete mode 100644 src/nvector/pthreads/fmod_int64/CMakeLists.txt rename src/nvector/serial/{fmod_int64 => fmod}/CMakeLists.txt (100%) rename src/nvector/serial/{fmod_int64 => fmod}/fnvector_serial_mod.c (100%) rename src/nvector/serial/{fmod_int64 => fmod}/fnvector_serial_mod.f90 (100%) delete mode 100644 src/nvector/serial/fmod_int32/CMakeLists.txt delete mode 100644 src/nvector/serial/fmod_int32/fnvector_serial_mod.c delete mode 100644 src/nvector/serial/fmod_int32/fnvector_serial_mod.f90 rename src/sunadaptcontroller/imexgus/{fmod_int32 => fmod}/CMakeLists.txt (97%) rename src/sunadaptcontroller/imexgus/{fmod_int32 => fmod}/fsunadaptcontroller_imexgus_mod.c (100%) rename src/sunadaptcontroller/imexgus/{fmod_int32 => fmod}/fsunadaptcontroller_imexgus_mod.f90 (100%) delete mode 100644 src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt delete mode 100644 src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.c delete mode 100644 src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.f90 rename src/sunadaptcontroller/soderlind/{fmod_int64 => fmod}/CMakeLists.txt (97%) rename src/sunadaptcontroller/soderlind/{fmod_int32 => fmod}/fsunadaptcontroller_soderlind_mod.c (100%) rename src/sunadaptcontroller/soderlind/{fmod_int32 => fmod}/fsunadaptcontroller_soderlind_mod.f90 (100%) delete mode 100644 src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt delete mode 100644 src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.c delete mode 100644 src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.f90 rename src/sundials/{fmod_int32 => fmod}/CMakeLists.txt (94%) rename src/sundials/{fmod_int64 => fmod}/fsundials_core_mod.c (99%) rename src/sundials/{fmod_int64 => fmod}/fsundials_core_mod.f90 (99%) delete mode 100644 src/sundials/fmod_int32/fsundials_core_mod.c delete mode 100644 src/sundials/fmod_int32/fsundials_core_mod.f90 delete mode 100644 src/sundials/sundials_macros.h create mode 100644 src/sundials/sundials_stepper.c create mode 100644 src/sundials/sundials_stepper_impl.h rename src/sunlinsol/band/{fmod_int64 => fmod}/CMakeLists.txt (100%) rename src/sunlinsol/band/{fmod_int64 => fmod}/fsunlinsol_band_mod.c (100%) rename src/sunlinsol/band/{fmod_int64 => fmod}/fsunlinsol_band_mod.f90 (100%) delete mode 100644 src/sunlinsol/band/fmod_int32/CMakeLists.txt delete mode 100644 src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.c delete mode 100644 src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.f90 rename src/sunlinsol/dense/{fmod_int64 => fmod}/CMakeLists.txt (100%) rename src/sunlinsol/dense/{fmod_int64 => fmod}/fsunlinsol_dense_mod.c (100%) rename src/sunlinsol/dense/{fmod_int64 => fmod}/fsunlinsol_dense_mod.f90 (100%) delete mode 100644 src/sunlinsol/dense/fmod_int32/CMakeLists.txt delete mode 100644 src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.c delete mode 100644 src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.f90 rename src/sunlinsol/klu/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/sunlinsol/klu/{fmod_int64 => fmod}/fsunlinsol_klu_mod.c (100%) rename src/sunlinsol/klu/{fmod_int64 => fmod}/fsunlinsol_klu_mod.f90 (100%) delete mode 100644 src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.c delete mode 100644 src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.f90 delete mode 100644 src/sunlinsol/klu/fmod_int64/CMakeLists.txt rename src/sunlinsol/lapackdense/{fmod_int64 => fmod}/CMakeLists.txt (100%) rename src/sunlinsol/lapackdense/{fmod_int64 => fmod}/fsunlinsol_lapackdense_mod.c (100%) rename src/sunlinsol/lapackdense/{fmod_int64 => fmod}/fsunlinsol_lapackdense_mod.f90 (100%) delete mode 100644 src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt delete mode 100644 src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.c delete mode 100644 src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.f90 rename src/sunlinsol/pcg/{fmod_int64 => fmod}/CMakeLists.txt (100%) rename src/sunlinsol/pcg/{fmod_int64 => fmod}/fsunlinsol_pcg_mod.c (100%) rename src/sunlinsol/pcg/{fmod_int64 => fmod}/fsunlinsol_pcg_mod.f90 (100%) delete mode 100644 src/sunlinsol/pcg/fmod_int32/CMakeLists.txt delete mode 100644 src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.c delete mode 100644 src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.f90 rename src/sunlinsol/spbcgs/{fmod_int64 => fmod}/CMakeLists.txt (100%) rename src/sunlinsol/spbcgs/{fmod_int64 => fmod}/fsunlinsol_spbcgs_mod.c (100%) rename src/sunlinsol/spbcgs/{fmod_int64 => fmod}/fsunlinsol_spbcgs_mod.f90 (100%) delete mode 100644 src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt delete mode 100644 src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.c delete mode 100644 src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.f90 rename src/sunlinsol/spfgmr/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/sunlinsol/spfgmr/{fmod_int64 => fmod}/fsunlinsol_spfgmr_mod.c (100%) rename src/sunlinsol/spfgmr/{fmod_int64 => fmod}/fsunlinsol_spfgmr_mod.f90 (100%) delete mode 100644 src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.c delete mode 100644 src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.f90 delete mode 100644 src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt rename src/sunlinsol/spgmr/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/sunlinsol/spgmr/{fmod_int64 => fmod}/fsunlinsol_spgmr_mod.c (100%) rename src/sunlinsol/spgmr/{fmod_int64 => fmod}/fsunlinsol_spgmr_mod.f90 (100%) delete mode 100644 src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.c delete mode 100644 src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 delete mode 100644 src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt rename src/sunlinsol/sptfqmr/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/sunlinsol/sptfqmr/{fmod_int64 => fmod}/fsunlinsol_sptfqmr_mod.c (100%) rename src/sunlinsol/sptfqmr/{fmod_int64 => fmod}/fsunlinsol_sptfqmr_mod.f90 (100%) delete mode 100644 src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.c delete mode 100644 src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.f90 delete mode 100644 src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt rename src/sunmatrix/band/{fmod_int64 => fmod}/CMakeLists.txt (100%) rename src/sunmatrix/band/{fmod_int64 => fmod}/fsunmatrix_band_mod.c (99%) rename src/sunmatrix/band/{fmod_int64 => fmod}/fsunmatrix_band_mod.f90 (97%) delete mode 100644 src/sunmatrix/band/fmod_int32/CMakeLists.txt delete mode 100644 src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.c delete mode 100644 src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.f90 rename src/sunmatrix/dense/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/sunmatrix/dense/{fmod_int64 => fmod}/fsunmatrix_dense_mod.c (99%) rename src/sunmatrix/dense/{fmod_int64 => fmod}/fsunmatrix_dense_mod.f90 (97%) delete mode 100644 src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c delete mode 100644 src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.f90 delete mode 100644 src/sunmatrix/dense/fmod_int64/CMakeLists.txt rename src/sunmatrix/sparse/{fmod_int64 => fmod}/CMakeLists.txt (100%) rename src/sunmatrix/sparse/{fmod_int64 => fmod}/fsunmatrix_sparse_mod.c (95%) rename src/sunmatrix/sparse/{fmod_int64 => fmod}/fsunmatrix_sparse_mod.f90 (98%) delete mode 100644 src/sunmatrix/sparse/fmod_int32/CMakeLists.txt delete mode 100644 src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.c delete mode 100644 src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.f90 rename src/sunnonlinsol/fixedpoint/{fmod_int32 => fmod}/CMakeLists.txt (100%) rename src/sunnonlinsol/fixedpoint/{fmod_int32 => fmod}/fsunnonlinsol_fixedpoint_mod.c (100%) rename src/sunnonlinsol/fixedpoint/{fmod_int32 => fmod}/fsunnonlinsol_fixedpoint_mod.f90 (100%) delete mode 100644 src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt delete mode 100644 src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.c delete mode 100644 src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.f90 rename src/sunnonlinsol/newton/{fmod_int64 => fmod}/CMakeLists.txt (100%) rename src/sunnonlinsol/newton/{fmod_int32 => fmod}/fsunnonlinsol_newton_mod.c (100%) rename src/sunnonlinsol/newton/{fmod_int32 => fmod}/fsunnonlinsol_newton_mod.f90 (100%) delete mode 100644 src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt delete mode 100644 src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.c delete mode 100644 src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.f90 create mode 100644 test/env/summit.sh rename test/unit_tests/arkode/CXX_serial/{ark_test_dahlquist_ark_2_0_1.out => ark_test_dahlquist_ark.out} (76%) delete 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_0_1.out => ark_test_dahlquist_ark_0_0.out} (86%) delete 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_1_1.out => ark_test_dahlquist_ark_0_1.out} (88%) delete mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1_0.out delete 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_0_1.out => ark_test_dahlquist_ark_1_0.out} (86%) delete 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_1_1.out => ark_test_dahlquist_ark_1_1.out} (88%) delete mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1_0.out delete mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_-1_0.out rename test/unit_tests/arkode/CXX_serial/{ark_test_dahlquist_ark_2_0_0.out => ark_test_dahlquist_ark_2_0.out} (88%) rename test/unit_tests/arkode/CXX_serial/{ark_test_dahlquist_ark_2_1_0.out => ark_test_dahlquist_ark_2_1.out} (88%) delete mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1_1.out rename test/unit_tests/arkode/CXX_serial/{ark_test_dahlquist_erk_-1.out => ark_test_dahlquist_erk.out} (62%) rename test/unit_tests/arkode/CXX_serial/{ark_test_dahlquist_mri_-1.out => ark_test_dahlquist_mri.out} (79%) delete mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_0.out delete mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_1.out diff --git a/.clang-format b/.clang-format index 8f5802e45d..2ecb664e26 100644 --- a/.clang-format +++ b/.clang-format @@ -79,7 +79,7 @@ EmptyLineAfterAccessModifier : Never EmptyLineBeforeAccessModifier : Always ExperimentalAutoDetectBinPacking : false FixNamespaceComments : true -IncludeBlocks : Preserve +IncludeBlocks : Regroup IncludeCategories : - Regex : '^(<|"(gtest|gmock|isl|json)/)' Priority : 1 diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 51ab03ac92..d0d20d539f 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -2,5 +2,3 @@ fab1cecb7d91cff53b31730af5d00ff154c3b6ce # Remove deprecated types in 7.0.0 cc6960349aa92e2bcad9168a6dacff99b21c329c -# Apply formatting to Fortran files -23581e8454955283139e551a7bcd1b85d8b7c77b diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md deleted file mode 100644 index 1cdc3dfbcb..0000000000 --- a/.github/ISSUE_TEMPLATE/bug.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -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 deleted file mode 100644 index 2d8ea7ab65..0000000000 --- a/.github/ISSUE_TEMPLATE/general.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -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 deleted file mode 100644 index 4080b9fd5f..0000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,10 +0,0 @@ - -<!-- 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 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index df4d15b35c..0000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: 2 -updates: - - - package-ecosystem: "github-actions" - directory: "/" - schedule: - # Check for updates to GitHub Actions every week - interval: "weekly" diff --git a/.github/workflows/build-ci-containers-e4s.yml b/.github/workflows/build-ci-containers-e4s.yml index fe76443ae2..16bd3c73eb 100644 --- a/.github/workflows/build-ci-containers-e4s.yml +++ b/.github/workflows/build-ci-containers-e4s.yml @@ -14,19 +14,19 @@ jobs: run: | cat /proc/cpuinfo - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v3 - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v2 - name: Login to container registry - uses: docker/login-action@v3 + uses: docker/login-action@v2 with: registry: ghcr.io 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@v3.0.0 with: context: "./docker/sundials-ci/e4s-base" build-args: e4s_version=22.05 @@ -44,19 +44,19 @@ jobs: run: | cat /proc/cpuinfo - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v3 - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v2 - name: Login to container registry - uses: docker/login-action@v3 + uses: docker/login-action@v2 with: registry: ghcr.io 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@v3.0.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..d61b14d5a2 100644 --- a/.github/workflows/build-ci-containers-nightly.yml +++ b/.github/workflows/build-ci-containers-nightly.yml @@ -20,19 +20,19 @@ jobs: run: | cat /proc/cpuinfo - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v3 - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v2 - name: Login to container registry - uses: docker/login-action@v3 + uses: docker/login-action@v2 with: registry: ghcr.io 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@v3.0.0 with: context: "./docker/sundials-ci/spack-nightly" build-args: spack_yaml=./int${{ matrix.indexsize }}-${{ matrix.precision }}/spack.yaml diff --git a/.github/workflows/check-clang-format.yml b/.github/workflows/check-clang-format.yml index 2a87a2a35d..8da2ebd3f9 100644 --- a/.github/workflows/check-clang-format.yml +++ b/.github/workflows/check-clang-format.yml @@ -1,6 +1,7 @@ name: Checks - clang-format on: + push: pull_request: workflow_dispatch: @@ -13,10 +14,7 @@ jobs: - name: Install git run: | apt update - apt install -y git python3-pip - - - name: Install fprettify - run: pip install fprettify + apt install -y git - name: Check out repository code uses: actions/checkout@v4 @@ -38,12 +36,12 @@ jobs: - name: Run git diff if we failed if: failure() - run: /usr/bin/git diff > clang_format.patch + run: /usr/bin/git diff > diff - - name: Archive diff as a patch if we failed + - name: Archive diff if we failed uses: actions/upload-artifact@v3 if: failure() with: - name: clang_format.patch + name: diff path: | - ${{ github.workspace }}/clang_format.patch + ${{ github.workspace }}/diff diff --git a/.github/workflows/check-swig.yml b/.github/workflows/check-swig.yml deleted file mode 100644 index 2a4193a239..0000000000 --- a/.github/workflows/check-swig.yml +++ /dev/null @@ -1,49 +0,0 @@ -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/.github/workflows/ubuntu-latest.yml b/.github/workflows/double-precision.yml similarity index 67% rename from .github/workflows/ubuntu-latest.yml rename to .github/workflows/double-precision.yml index 0bc9ab7510..b0ca087ef4 100644 --- a/.github/workflows/ubuntu-latest.yml +++ b/.github/workflows/double-precision.yml @@ -1,11 +1,8 @@ # -name: Build and Test - Ubuntu/gcc (TPLs, no GPUs) +name: Build and Test - Ubuntu/gcc double precision (TPLs, no GPUs) on: push: - branches: - - main - - develop pull_request: merge_group: workflow_dispatch: @@ -24,24 +21,11 @@ jobs: max-parallel: 2 matrix: indexsize: [32, 64] - # 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 - + precision: ['double'] + buildtype: ['Debug', 'Release'] steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v3 with: submodules: true - name: Run test_driver.sh diff --git a/.github/workflows/extended-precision.yml b/.github/workflows/extended-precision.yml new file mode 100644 index 0000000000..51678b6e70 --- /dev/null +++ b/.github/workflows/extended-precision.yml @@ -0,0 +1,48 @@ +# +name: Build and Test - Ubuntu/gcc extended precision (TPLs, no GPUs) + +on: + 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/macos-latest.yml b/.github/workflows/macos-latest.yml index ae0eb137d2..5b78697c81 100644 --- a/.github/workflows/macos-latest.yml +++ b/.github/workflows/macos-latest.yml @@ -22,16 +22,12 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - name: Configure CMake - # 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 + # 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}} - name: Build # Build your program with the given configuration diff --git a/.github/workflows/single-precision.yml b/.github/workflows/single-precision.yml new file mode 100644 index 0000000000..30a53b0402 --- /dev/null +++ b/.github/workflows/single-precision.yml @@ -0,0 +1,48 @@ +# +name: Build and Test - Ubuntu/gcc single precision (TPLs, no GPUs) + +on: + 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/spack-develop.yml b/.github/workflows/spack-develop.yml index 41f312164f..fd23c21a99 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@v4 + uses: actions/checkout@v3 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 2010b54dbf..d2f3fcae0e 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -21,29 +21,21 @@ jobs: fail-fast: false max-parallel: 2 matrix: - # 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] + # 2 is what all other builds use (its the default), so skip it here + logging_level: [0, 1, 3, 4, 5] steps: - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v2 + uses: KyleMayes/install-llvm-action@v1 with: version: "14.0" - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - name: Configure CMake - # 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 + # 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}} - name: Build # Build your program with the given configuration @@ -58,23 +50,16 @@ jobs: steps: - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v2 + uses: KyleMayes/install-llvm-action@v1 with: version: "14.0" - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - name: Configure CMake - # 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 + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++) -DSUNDIALS_BUILD_WITH_PROFILING=${{matrix.profiling}} - name: Build # Build your program with the given configuration diff --git a/.github/workflows/windows-latest-intel.yml b/.github/workflows/windows-latest-intel.yml deleted file mode 100644 index 6ea4e35c34..0000000000 --- a/.github/workflows/windows-latest-intel.yml +++ /dev/null @@ -1,50 +0,0 @@ -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@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 - - - 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 c4a93a5d46..beb55d1efe 100644 --- a/.github/workflows/windows-latest-mingw.yml +++ b/.github/workflows/windows-latest-mingw.yml @@ -10,90 +10,31 @@ concurrency: cancel-in-progress: true env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release jobs: - build_and_test: + buil_and_test: runs-on: windows-latest - defaults: - run: - # 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@v4 + - uses: actions/checkout@v3 - uses: msys2/setup-msys2@v2 with: - msystem: ${{ matrix.msystem }} - update: true - release: false - install: >- - base-devel - ${{ matrix.target-prefix }}-cmake - ${{ matrix.target-prefix }}-gcc - ${{ matrix.target-prefix }}-gcc-fortran - ${{ matrix.target-prefix }}-openblas - ${{ matrix.target-prefix }}-suitesparse - - - name: Configure CMake (Static) - # Configure CMake in a 'build' subdirectory - run: | - cmake \ - -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 (Static) - # Build program - run: cmake --build ${GITHUB_WORKSPACE}/build_static --verbose - - - name: Test (Static) - working-directory: ${{github.workspace}}/build_static - # Execute tests - 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 + msystem: mingw64 + + - 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 + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -C ${{env.BUILD_TYPE}} diff --git a/.github/workflows/windows-latest.yml b/.github/workflows/windows-latest.yml index c94026c3b8..ccfa6c2251 100644 --- a/.github/workflows/windows-latest.yml +++ b/.github/workflows/windows-latest.yml @@ -10,6 +10,7 @@ concurrency: cancel-in-progress: true env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release jobs: @@ -17,14 +18,19 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - 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 + # 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 - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --verbose + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - name: Test working-directory: ${{github.workspace}}/build - run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure + # 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}} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c02b239373..63622ebb08 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -126,8 +126,6 @@ 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 diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 5e5cd86b40..162f9eb490 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -14,7 +14,6 @@ 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/CHANGELOG.md b/CHANGELOG.md index 059d8d3666..d62bdf8087 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,137 +1,34 @@ # SUNDIALS Changelog -## 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 the [Contributing -Guide](./CONTRIBUTING.md) for more 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 `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 -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. - -Enabled the Fortran interfaces to build with 32-bit `sunindextype`. - -### Bug Fixes +## 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). -Renamed the DPCPP value for the `SUNDIALS_GINKGO_BACKENDS` CMake option to `SYCL` -to match Ginkgo's updated naming convention. +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 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 `SUNContext`. Fixes -[GitHub Issue #466](https://github.com/LLNL/sundials/issues/466). +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 `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 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. +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 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. +Added support for Kokkos Kernels v4. -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. +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). -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. +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 diff --git a/CITATIONS.md b/CITATIONS.md index ef97b2c715..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.1.0} + 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.1.0} + 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.1.0} + 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.1.0} + 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.1.0} + 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.1.0} + note = {v7.0.0} } ``` diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f8fa7933f..9c2279f4e2 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.0.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 "1") +set(PACKAGE_VERSION_MINOR "0") 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.1.0") +set(arkodelib_VERSION "6.0.0") set(arkodelib_SOVERSION "6") -set(cvodelib_VERSION "7.1.0") +set(cvodelib_VERSION "7.0.0") set(cvodelib_SOVERSION "7") -set(cvodeslib_VERSION "7.1.0") +set(cvodeslib_VERSION "7.0.0") set(cvodeslib_SOVERSION "7") -set(idalib_VERSION "7.1.0") +set(idalib_VERSION "7.0.0") set(idalib_SOVERSION "7") -set(idaslib_VERSION "6.1.0") +set(idaslib_VERSION "6.0.0") set(idaslib_SOVERSION "6") -set(kinsollib_VERSION "7.1.0") +set(kinsollib_VERSION "7.0.0") set(kinsollib_SOVERSION "7") set(cpodeslib_VERSION "0.0.0") set(cpodeslib_SOVERSION "0") -set(nveclib_VERSION "7.1.0") +set(nveclib_VERSION "7.0.0") set(nveclib_SOVERSION "7") -set(sunmatrixlib_VERSION "5.1.0") +set(sunmatrixlib_VERSION "5.0.0") set(sunmatrixlib_SOVERSION "5") -set(sunlinsollib_VERSION "5.1.0") +set(sunlinsollib_VERSION "5.0.0") set(sunlinsollib_SOVERSION "5") -set(sunnonlinsollib_VERSION "4.1.0") +set(sunnonlinsollib_VERSION "4.0.0") set(sunnonlinsollib_SOVERSION "4") set(sundialslib_VERSION diff --git a/README.md b/README.md index 9a21db1d4d..d143fbbc69 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.0.0 (Feb 2024) ### **Center for Applied Scientific Computing, Lawrence Livermore National Laboratory** diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 980e1e230d..a70315ea5b 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -22,12 +22,6 @@ 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/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp b/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp index 7bbf8743a7..2eed892ee5 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_), - upwindRight(true), + dof(dof), dims{0, 0, 0}, coords{0, 0, 0}, - bc(bc_), - st(st_) + bc(bc), + st(st), + upwindRight(true) { assert(st == StencilType::UPWIND); @@ -121,10 +121,6 @@ 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); @@ -185,12 +181,6 @@ 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) { @@ -206,7 +196,7 @@ class ParallelGrid if ((coords[0] > 0) || (bc == BoundaryType::PERIODIC)) { int nbcoords[] = {coords[0] - 1, coords[1], coords[2]}; - retval = MPI_Cart_rank(cart_comm, nbcoords, &ipW); + int retval = MPI_Cart_rank(cart_comm, nbcoords, &ipW); assert(retval == MPI_SUCCESS); } @@ -225,7 +215,7 @@ class ParallelGrid if ((coords[0] < dims[0] - 1) || (bc == BoundaryType::PERIODIC)) { int nbcoords[] = {coords[0] + 1, coords[1], coords[2]}; - retval = MPI_Cart_rank(cart_comm, nbcoords, &ipE); + int retval = MPI_Cart_rank(cart_comm, nbcoords, &ipE); assert(retval == MPI_SUCCESS); } @@ -244,7 +234,7 @@ class ParallelGrid if ((coords[1] > 0) || (bc == BoundaryType::PERIODIC)) { int nbcoords[] = {coords[0], coords[1] - 1, coords[2]}; - retval = MPI_Cart_rank(cart_comm, nbcoords, &ipS); + int retval = MPI_Cart_rank(cart_comm, nbcoords, &ipS); assert(retval == MPI_SUCCESS); } @@ -263,7 +253,7 @@ class ParallelGrid if ((coords[1] < dims[1] - 1) || (bc == BoundaryType::PERIODIC)) { int nbcoords[] = {coords[0], coords[1] + 1, coords[2]}; - retval = MPI_Cart_rank(cart_comm, nbcoords, &ipN); + int retval = MPI_Cart_rank(cart_comm, nbcoords, &ipN); assert(retval == MPI_SUCCESS); } @@ -282,7 +272,7 @@ class ParallelGrid if ((coords[2] > 0) || (bc == BoundaryType::PERIODIC)) { int nbcoords[] = {coords[0], coords[1], coords[2] - 1}; - retval = MPI_Cart_rank(cart_comm, nbcoords, &ipB); + int retval = MPI_Cart_rank(cart_comm, nbcoords, &ipB); assert(retval == MPI_SUCCESS); } @@ -301,7 +291,7 @@ class ParallelGrid if ((coords[2] < dims[2] - 1) || (bc == BoundaryType::PERIODIC)) { int nbcoords[] = {coords[0], coords[1], coords[2] + 1}; - retval = MPI_Cart_rank(cart_comm, nbcoords, &ipF); + int 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 1bca75cbcc..5f72a5b085 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.c_str()); + snprintf(fname, MXSTR, "%s/mesh.txt", uopt.outputdir); udata.grid->MeshToFile(fname); } @@ -259,7 +259,7 @@ int FillSendBuffers(N_Vector y, UserData* udata) * --------------------------------------------------------------*/ /* Parses the CLI arguments */ -static int ParseArgs(int argc, char* argv[], UserData* udata, UserOptions* uopt) +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 = "."; /* output directory */ + uopt->outputdir = (char*)"."; /* 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.c_str(), udata->myid); + sprintf(fname, "%s/t.%06d.txt", uopt->outputdir, udata->myid); udata->TFID = fopen(fname, "w"); } - sprintf(fname, "%s/u.%06d.txt", uopt->outputdir.c_str(), udata->myid); + sprintf(fname, "%s/u.%06d.txt", uopt->outputdir, udata->myid); udata->UFID = fopen(fname, "w"); - sprintf(fname, "%s/v.%06d.txt", uopt->outputdir.c_str(), udata->myid); + sprintf(fname, "%s/v.%06d.txt", uopt->outputdir, udata->myid); udata->VFID = fopen(fname, "w"); - sprintf(fname, "%s/w.%06d.txt", uopt->outputdir.c_str(), udata->myid); + sprintf(fname, "%s/w.%06d.txt", uopt->outputdir, 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.c_str()); + printf("Output directory: %s\n", uopt->outputdir); } /* return success */ @@ -549,8 +549,7 @@ int SetupProblem(int argc, char* argv[], UserData* udata, UserOptions* uopt, /* Compute the 3D Gaussian function. */ KOKKOS_FUNCTION -static void Gaussian3D(sunrealtype& x, sunrealtype& y, sunrealtype& z, - sunrealtype xmax) +void Gaussian3D(sunrealtype& x, sunrealtype& y, sunrealtype& z, sunrealtype xmax) { /* Gaussian distribution defaults */ const sunrealtype alpha = 0.1; @@ -568,7 +567,7 @@ static void Gaussian3D(sunrealtype& x, sunrealtype& y, sunrealtype& z, } /* Initial condition function */ -int SetIC(N_Vector yvec, UserData* udata) +int SetIC(N_Vector y, UserData* udata) { SUNDIALS_CXX_MARK_FUNCTION(udata->prof); @@ -597,8 +596,8 @@ int SetIC(N_Vector yvec, UserData* udata) const sunrealtype ws = 3.0; /* Create 4D view of y */ - Vec4D yview(N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(yvec)), nxl, - nyl, nzl, dof); + Vec4D yview(N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(y)), 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 ed594b0828..fc4717fefe 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 */ - string outputdir; + char* outputdir; }; /* @@ -113,16 +113,16 @@ struct UserData UserOptions* uopt; /* Constructor that takes the context */ - UserData(SUNContext ctx_) - : ctx(ctx_), - TFID(nullptr), - UFID(nullptr), - VFID(nullptr), - WFID(nullptr), + UserData(SUNContext ctx) + : ctx(ctx), umask(nullptr), vmask(nullptr), wmask(nullptr), - uopt(nullptr) + uopt(nullptr), + TFID(nullptr), + UFID(nullptr), + VFID(nullptr), + WFID(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 2001c2736a..0acdc8625e 100644 --- a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp @@ -58,6 +58,7 @@ 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; @@ -70,20 +71,26 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Select the method order */ - retval = ARKodeSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKodeSetOrder", 1, udata->myid)) { return 1; } + retval = ARKStepSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKStepSetOrder", 1, udata->myid)) { return 1; } /* Attach user data */ - retval = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData*", 1, udata->myid)) { return 1; } + retval = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKStepSetUserData*", 1, udata->myid)) + { + return 1; + } /* Specify tolerances */ - retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKodeSStolerances", 1, udata->myid)) { return 1; } + retval = ARKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKStepSStolerances", 1, udata->myid)) + { + return 1; + } /* Increase the max number of steps allowed between outputs */ - retval = ARKodeSetMaxNumSteps(arkode_mem, 100000); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1, udata->myid)) + retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); + if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1, udata->myid)) { return 1; } @@ -99,8 +106,8 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -114,15 +121,15 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach linear solver */ - retval = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1, udata->myid)) + retval = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_retval(&retval, "ARKStepSetLinearSolver", 1, udata->myid)) { return 1; } /* Attach preconditioner */ - retval = ARKodeSetPreconditioner(arkode_mem, NULL, PSolve); - if (check_retval(&retval, "ARKodeSetPreconditioner", 1, udata->myid)) + retval = ARKStepSetPreconditioner(arkode_mem, NULL, PSolve); + if (check_retval(&retval, "ARKStepSetPreconditioner", 1, udata->myid)) { return 1; } @@ -137,8 +144,8 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -170,8 +177,8 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) do { /* Integrate to output time */ - retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1, udata->myid)) { break; } + retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKStepEvolve", 1, udata->myid)) { break; } /* Output state */ if (uopt->nout > 0) { WriteOutput(t, y, udata, uopt); } @@ -185,24 +192,24 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) while (iout < uopt->nout); /* Get final statistics */ - 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 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); + 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); if (uopt->nls == "newton") { - retval = ARKodeGetNumLinIters(arkode_mem, &nli); - check_retval(&retval, "ARKodeGetNumLinIters", 1, udata->myid); - retval = ARKodeGetNumPrecSolves(arkode_mem, &npsol); - check_retval(&retval, "ARKodeGetNumPrecSolves", 1, udata->myid); + retval = ARKStepGetNumLinIters(arkode_mem, &nli); + check_retval(&retval, "ARKStepGetNumLinIters", 1, udata->myid); + retval = ARKStepGetNumPrecSolves(arkode_mem, &npsol); + check_retval(&retval, "ARKStepGetNumPrecSolves", 1, udata->myid); } /* Print final statistics */ @@ -223,7 +230,7 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Clean up */ - ARKodeFree(&arkode_mem); + ARKStepFree(&arkode_mem); SUNNonlinSolFree(NLS); if (LS) { SUNLinSolFree(LS); } @@ -245,6 +252,7 @@ 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; @@ -257,20 +265,26 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Select the method order */ - retval = ARKodeSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKodeSetOrder", 1, udata->myid)) { return 1; } + retval = ARKStepSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKStepSetOrder", 1, udata->myid)) { return 1; } /* Attach user data */ - retval = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData*", 1, udata->myid)) { return 1; } + retval = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKStepSetUserData*", 1, udata->myid)) + { + return 1; + } /* Specify tolerances */ - retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKodeSStolerances", 1, udata->myid)) { return 1; } + retval = ARKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKStepSStolerances", 1, udata->myid)) + { + return 1; + } /* Increase the max number of steps allowed between outputs */ - retval = ARKodeSetMaxNumSteps(arkode_mem, 100000); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1, udata->myid)) + retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); + if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1, udata->myid)) { return 1; } @@ -286,8 +300,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -300,15 +314,15 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach linear solver */ - retval = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1, udata->myid)) + retval = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_retval(&retval, "ARKStepSetLinearSolver", 1, udata->myid)) { return 1; } /* Attach preconditioner */ - retval = ARKodeSetPreconditioner(arkode_mem, NULL, PSolve); - if (check_retval(&retval, "ARKodeSetPreconditioner", 1, udata->myid)) + retval = ARKStepSetPreconditioner(arkode_mem, NULL, PSolve); + if (check_retval(&retval, "ARKStepSetPreconditioner", 1, udata->myid)) { return 1; } @@ -324,8 +338,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -340,8 +354,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -373,8 +387,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) do { /* Integrate to output time */ - retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1, udata->myid)) { break; } + retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKStepEvolve", 1, udata->myid)) { break; } /* Output state */ if (uopt->nout > 0) { WriteOutput(t, y, udata, uopt); } @@ -388,24 +402,24 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) while (iout < uopt->nout); /* Get final statistics */ - 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 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); + 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); if (uopt->nls == "newton") { - retval = ARKodeGetNumLinIters(arkode_mem, &nli); - check_retval(&retval, "ARKodeGetNumLinIters", 1, udata->myid); - retval = ARKodeGetNumPrecSolves(arkode_mem, &npsol); - check_retval(&retval, "ARKodeGetNumPrecSolves", 1, udata->myid); + retval = ARKStepGetNumLinIters(arkode_mem, &nli); + check_retval(&retval, "ARKStepGetNumLinIters", 1, udata->myid); + retval = ARKStepGetNumPrecSolves(arkode_mem, &npsol); + check_retval(&retval, "ARKStepGetNumPrecSolves", 1, udata->myid); } /* Print final statistics */ @@ -426,7 +440,7 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Clean up */ - ARKodeFree(&arkode_mem); + ARKStepFree(&arkode_mem); if (NLS) { SUNNonlinSolFree(NLS); } if (LS) { SUNLinSolFree(LS); } @@ -443,6 +457,7 @@ 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; @@ -455,27 +470,33 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) } /* Select the method order */ - retval = ARKodeSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKodeSetOrder", 1, udata->myid)) { return 1; } + retval = ERKStepSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ERKStepSetOrder", 1, udata->myid)) { return 1; } /* Attach user data */ - retval = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData", 1, udata->myid)) { return 1; } + retval = ERKStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ERKStepSetUserData", 1, udata->myid)) { return 1; } /* Specify tolerances */ - retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKodeSStolerances", 1, udata->myid)) { return 1; } + retval = ERKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ERKStepSStolerances", 1, udata->myid)) + { + return 1; + } /* Increase the max number of steps allowed between outputs */ - retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1, udata->myid)) + retval = ERKStepSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ERKStepSetMaxNumSteps", 1, udata->myid)) { return 1; } /* Set fixed step size */ - retval = ARKodeSetFixedStep(arkode_mem, 1e-5); - if (check_retval(&retval, "ARKodeSetFixedStep", 1, udata->myid)) { return 1; } + retval = ERKStepSetFixedStep(arkode_mem, 1e-5); + if (check_retval(&retval, "ERKStepSetFixedStep", 1, udata->myid)) + { + return 1; + } /* Output initial condition */ if (uopt->nout > 0) @@ -497,8 +518,8 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) do { /* Integrate to output time */ - retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1, udata->myid)) { break; } + retval = ERKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ERKStepEvolve", 1, udata->myid)) { break; } /* Output state */ if (uopt->nout > 0) { WriteOutput(t, y, udata, uopt); } @@ -512,14 +533,14 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) while (iout < uopt->nout); /* Get final statistics */ - 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 = 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 = ERKStepGetNumRhsEvals(arkode_mem, &nfe); check_retval(&retval, "ERKStepGetNumRhsEvals", 1, udata->myid); - retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ARKodeGetNumErrTestFails", 1, udata->myid); + retval = ERKStepGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ERKStepGetNumErrTestFails", 1, udata->myid); /* Print final statistics */ if (udata->myid == 0) @@ -531,7 +552,7 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) } /* Clean up */ - ARKodeFree(&arkode_mem); + ERKStepFree(&arkode_mem); /* Return success */ return (0); @@ -541,7 +562,7 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) * (Non)linear system functions * --------------------------------------------------------------*/ -static int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) +int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) { /* temporary variables */ UserData* udata; @@ -554,8 +575,8 @@ static int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) sunrealtype tcur, gamma; void* user_data; - ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, &gamma, - &sdata, &user_data); + ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, &gamma, + &sdata, &user_data); udata = (UserData*)user_data; /* update 'z' value as stored predictor + current corrector */ @@ -583,7 +604,7 @@ static int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) return (0); } -static int TaskLocalLSolve(N_Vector delta, void* arkode_mem) +int TaskLocalLSolve(N_Vector delta, void* arkode_mem) { /* local variables */ UserData* udata = NULL; @@ -594,8 +615,8 @@ static int TaskLocalLSolve(N_Vector delta, void* arkode_mem) sunrealtype tcur, gamma; void* user_data = NULL; - ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, &gamma, - &sdata, &user_data); + ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, &gamma, + &sdata, &user_data); udata = (UserData*)user_data; SUNDIALS_CXX_MARK_FUNCTION(udata->prof); @@ -606,12 +627,12 @@ static int TaskLocalLSolve(N_Vector delta, void* arkode_mem) return (retval); } -static SUNNonlinearSolver_Type TaskLocalNewton_GetType(SUNNonlinearSolver NLS) +SUNNonlinearSolver_Type TaskLocalNewton_GetType(SUNNonlinearSolver NLS) { return SUNNONLINEARSOLVER_ROOTFIND; } -static int TaskLocalNewton_Initialize(SUNNonlinearSolver NLS) +int TaskLocalNewton_Initialize(SUNNonlinearSolver NLS) { /* check that the nonlinear solver is non-null */ if (NLS == NULL) { return SUN_ERR_ARG_CORRUPT; } @@ -623,9 +644,9 @@ static int TaskLocalNewton_Initialize(SUNNonlinearSolver NLS) return (SUNNonlinSolInitialize(LOCAL_NLS(NLS))); } -static int TaskLocalNewton_Solve(SUNNonlinearSolver NLS, N_Vector y0, - N_Vector ycor, N_Vector w, sunrealtype tol, - sunbooleantype callLSetup, void* mem) +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; @@ -659,7 +680,7 @@ static int TaskLocalNewton_Solve(SUNNonlinearSolver NLS, N_Vector y0, return recover; } -static int TaskLocalNewton_Free(SUNNonlinearSolver NLS) +int TaskLocalNewton_Free(SUNNonlinearSolver NLS) { /* return if NLS is already free */ if (NLS == NULL) { return SUN_SUCCESS; } @@ -685,8 +706,7 @@ static int TaskLocalNewton_Free(SUNNonlinearSolver NLS) return SUN_SUCCESS; } -static int TaskLocalNewton_SetSysFn(SUNNonlinearSolver NLS, - SUNNonlinSolSysFn SysFn) +int TaskLocalNewton_SetSysFn(SUNNonlinearSolver NLS, SUNNonlinSolSysFn SysFn) { /* check that the nonlinear solver is non-null */ if (NLS == NULL) { return SUN_ERR_ARG_CORRUPT; } @@ -694,9 +714,9 @@ static int TaskLocalNewton_SetSysFn(SUNNonlinearSolver NLS, return (SUNNonlinSolSetSysFn(LOCAL_NLS(NLS), SysFn)); } -static int TaskLocalNewton_SetConvTestFn(SUNNonlinearSolver NLS, - SUNNonlinSolConvTestFn CTestFn, - void* ctest_data) +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; } @@ -704,8 +724,7 @@ static int TaskLocalNewton_SetConvTestFn(SUNNonlinearSolver NLS, return (SUNNonlinSolSetConvTestFn(LOCAL_NLS(NLS), CTestFn, ctest_data)); } -static int TaskLocalNewton_GetNumConvFails(SUNNonlinearSolver NLS, - long int* nconvfails) +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 d029f8c34e..b85c7a3fb6 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 */ -static int SetICDot(N_Vector y, N_Vector yp, UserData* udata) +int SetICDot(N_Vector y, N_Vector yp, UserData* udata) { int retval; diff --git a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp index 49dcc6d8cf..0acdc8625e 100644 --- a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp @@ -71,20 +71,26 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Select the method order */ - retval = ARKodeSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKodeSetOrder", 1, udata->myid)) { return 1; } + retval = ARKStepSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKStepSetOrder", 1, udata->myid)) { return 1; } /* Attach user data */ - retval = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData*", 1, udata->myid)) { return 1; } + retval = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKStepSetUserData*", 1, udata->myid)) + { + return 1; + } /* Specify tolerances */ - retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKodeSStolerances", 1, udata->myid)) { return 1; } + retval = ARKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKStepSStolerances", 1, udata->myid)) + { + return 1; + } /* Increase the max number of steps allowed between outputs */ - retval = ARKodeSetMaxNumSteps(arkode_mem, 100000); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1, udata->myid)) + retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); + if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1, udata->myid)) { return 1; } @@ -100,8 +106,8 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -115,15 +121,15 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach linear solver */ - retval = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1, udata->myid)) + retval = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_retval(&retval, "ARKStepSetLinearSolver", 1, udata->myid)) { return 1; } /* Attach preconditioner */ - retval = ARKodeSetPreconditioner(arkode_mem, NULL, PSolve); - if (check_retval(&retval, "ARKodeSetPreconditioner", 1, udata->myid)) + retval = ARKStepSetPreconditioner(arkode_mem, NULL, PSolve); + if (check_retval(&retval, "ARKStepSetPreconditioner", 1, udata->myid)) { return 1; } @@ -138,8 +144,8 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -171,8 +177,8 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) do { /* Integrate to output time */ - retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1, udata->myid)) { break; } + retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKStepEvolve", 1, udata->myid)) { break; } /* Output state */ if (uopt->nout > 0) { WriteOutput(t, y, udata, uopt); } @@ -186,24 +192,24 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) while (iout < uopt->nout); /* Get final statistics */ - 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 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); + 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); if (uopt->nls == "newton") { - retval = ARKodeGetNumLinIters(arkode_mem, &nli); - check_retval(&retval, "ARKodeGetNumLinIters", 1, udata->myid); - retval = ARKodeGetNumPrecSolves(arkode_mem, &npsol); - check_retval(&retval, "ARKodeGetNumPrecSolves", 1, udata->myid); + retval = ARKStepGetNumLinIters(arkode_mem, &nli); + check_retval(&retval, "ARKStepGetNumLinIters", 1, udata->myid); + retval = ARKStepGetNumPrecSolves(arkode_mem, &npsol); + check_retval(&retval, "ARKStepGetNumPrecSolves", 1, udata->myid); } /* Print final statistics */ @@ -224,7 +230,7 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Clean up */ - ARKodeFree(&arkode_mem); + ARKStepFree(&arkode_mem); SUNNonlinSolFree(NLS); if (LS) { SUNLinSolFree(LS); } @@ -259,20 +265,26 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Select the method order */ - retval = ARKodeSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKodeSetOrder", 1, udata->myid)) { return 1; } + retval = ARKStepSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKStepSetOrder", 1, udata->myid)) { return 1; } /* Attach user data */ - retval = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData*", 1, udata->myid)) { return 1; } + retval = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKStepSetUserData*", 1, udata->myid)) + { + return 1; + } /* Specify tolerances */ - retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKodeSStolerances", 1, udata->myid)) { return 1; } + retval = ARKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKStepSStolerances", 1, udata->myid)) + { + return 1; + } /* Increase the max number of steps allowed between outputs */ - retval = ARKodeSetMaxNumSteps(arkode_mem, 100000); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1, udata->myid)) + retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); + if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1, udata->myid)) { return 1; } @@ -288,8 +300,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -302,15 +314,15 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach linear solver */ - retval = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1, udata->myid)) + retval = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_retval(&retval, "ARKStepSetLinearSolver", 1, udata->myid)) { return 1; } /* Attach preconditioner */ - retval = ARKodeSetPreconditioner(arkode_mem, NULL, PSolve); - if (check_retval(&retval, "ARKodeSetPreconditioner", 1, udata->myid)) + retval = ARKStepSetPreconditioner(arkode_mem, NULL, PSolve); + if (check_retval(&retval, "ARKStepSetPreconditioner", 1, udata->myid)) { return 1; } @@ -326,8 +338,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -342,8 +354,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -375,8 +387,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) do { /* Integrate to output time */ - retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1, udata->myid)) { break; } + retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKStepEvolve", 1, udata->myid)) { break; } /* Output state */ if (uopt->nout > 0) { WriteOutput(t, y, udata, uopt); } @@ -390,24 +402,24 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) while (iout < uopt->nout); /* Get final statistics */ - 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 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); + 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); if (uopt->nls == "newton") { - retval = ARKodeGetNumLinIters(arkode_mem, &nli); - check_retval(&retval, "ARKodeGetNumLinIters", 1, udata->myid); - retval = ARKodeGetNumPrecSolves(arkode_mem, &npsol); - check_retval(&retval, "ARKodeGetNumPrecSolves", 1, udata->myid); + retval = ARKStepGetNumLinIters(arkode_mem, &nli); + check_retval(&retval, "ARKStepGetNumLinIters", 1, udata->myid); + retval = ARKStepGetNumPrecSolves(arkode_mem, &npsol); + check_retval(&retval, "ARKStepGetNumPrecSolves", 1, udata->myid); } /* Print final statistics */ @@ -428,7 +440,7 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Clean up */ - ARKodeFree(&arkode_mem); + ARKStepFree(&arkode_mem); if (NLS) { SUNNonlinSolFree(NLS); } if (LS) { SUNLinSolFree(LS); } @@ -458,27 +470,33 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) } /* Select the method order */ - retval = ARKodeSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKodeSetOrder", 1, udata->myid)) { return 1; } + retval = ERKStepSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ERKStepSetOrder", 1, udata->myid)) { return 1; } /* Attach user data */ - retval = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData", 1, udata->myid)) { return 1; } + retval = ERKStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ERKStepSetUserData", 1, udata->myid)) { return 1; } /* Specify tolerances */ - retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKodeSStolerances", 1, udata->myid)) { return 1; } + retval = ERKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ERKStepSStolerances", 1, udata->myid)) + { + return 1; + } /* Increase the max number of steps allowed between outputs */ - retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1, udata->myid)) + retval = ERKStepSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ERKStepSetMaxNumSteps", 1, udata->myid)) { return 1; } /* Set fixed step size */ - retval = ARKodeSetFixedStep(arkode_mem, 1e-5); - if (check_retval(&retval, "ARKodeSetFixedStep", 1, udata->myid)) { return 1; } + retval = ERKStepSetFixedStep(arkode_mem, 1e-5); + if (check_retval(&retval, "ERKStepSetFixedStep", 1, udata->myid)) + { + return 1; + } /* Output initial condition */ if (uopt->nout > 0) @@ -500,8 +518,8 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) do { /* Integrate to output time */ - retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1, udata->myid)) { break; } + retval = ERKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ERKStepEvolve", 1, udata->myid)) { break; } /* Output state */ if (uopt->nout > 0) { WriteOutput(t, y, udata, uopt); } @@ -515,14 +533,14 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) while (iout < uopt->nout); /* Get final statistics */ - 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 = 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 = ERKStepGetNumRhsEvals(arkode_mem, &nfe); check_retval(&retval, "ERKStepGetNumRhsEvals", 1, udata->myid); - retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ARKodeGetNumErrTestFails", 1, udata->myid); + retval = ERKStepGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ERKStepGetNumErrTestFails", 1, udata->myid); /* Print final statistics */ if (udata->myid == 0) @@ -534,7 +552,7 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) } /* Clean up */ - ARKodeFree(&arkode_mem); + ERKStepFree(&arkode_mem); /* Return success */ return (0); @@ -557,8 +575,8 @@ int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) sunrealtype tcur, gamma; void* user_data; - ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, &gamma, - &sdata, &user_data); + ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, &gamma, + &sdata, &user_data); udata = (UserData*)user_data; /* update 'z' value as stored predictor + current corrector */ @@ -597,8 +615,8 @@ int TaskLocalLSolve(N_Vector delta, void* arkode_mem) sunrealtype tcur, gamma; void* user_data = NULL; - ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, &gamma, - &sdata, &user_data); + ARKStepGetNonlinearSystemData(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/diffusion_2D.cpp b/benchmarks/diffusion_2D/diffusion_2D.cpp index bd18cf1dfb..e5d3ece986 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 = ZERO; - bool outproc = (udata->myid_c == 0); + sunrealtype max; + 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(const void* flagvalue, const string funcname, int opt) +int check_flag(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(const void* flagvalue, const string funcname, int opt) // Check the function return flag value else if (opt == 1 || opt == 2) { - const int errflag = *((const int*)flagvalue); + int errflag = *((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 1ebb3394aa..11e0b350e8 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(const void* flagvalue, const string funcname, int opt); +int check_flag(void* flagvalue, const string funcname, int opt); #endif diff --git a/benchmarks/diffusion_2D/main_arkode.cpp b/benchmarks/diffusion_2D/main_arkode.cpp index c35bf9e9c7..e3f8962ad8 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 = ARKodeSStolerances(arkode_mem, uopts.rtol, uopts.atol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkode_mem, uopts.rtol, uopts.atol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } // Attach user data - flag = ARKodeSetUserData(arkode_mem, (void*)&udata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(arkode_mem, (void*)&udata); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(arkode_mem, LS, A); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, A); + if (check_flag(&flag, "ARKStepSetLinearSolver", 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; + ARKStepSetJacFn(arkode_mem, diffusion_jac); + if (check_flag(&flag, "ARKStepSetJacFn", 1)) return 1; } #endif if (uopts.preconditioning) { // Attach preconditioner - flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } + flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKodeSetLSetupFrequency(arkode_mem, uopts.msbp); - if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } + flag = ARKStepSetLSetupFrequency(arkode_mem, uopts.msbp); + if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKodeSetEpsLin(arkode_mem, uopts.epslin); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + flag = ARKStepSetEpsLin(arkode_mem, uopts.epslin); + if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } // Select method order - flag = ARKodeSetOrder(arkode_mem, uopts.order); - if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } + flag = ARKStepSetOrder(arkode_mem, uopts.order); + if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } // Set fixed step size or adaptivity method if (uopts.hfixed > ZERO) { - flag = ARKodeSetFixedStep(arkode_mem, uopts.hfixed); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = ARKStepSetFixedStep(arkode_mem, uopts.hfixed); + if (check_flag(&flag, "ARKStepSetFixedStep", 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 = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(arkode_mem, uopts.maxsteps); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKStepSetMaxNumSteps(arkode_mem, uopts.maxsteps); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKodeSetStopTime(arkode_mem, udata.tf); - if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = ARKStepSetStopTime(arkode_mem, udata.tf); + if (check_flag(&flag, "ARKStepSetStopTime", 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 = ARKodeEvolve(arkode_mem, tout, u, &t, stepmode); - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, u, &t, stepmode); + if (check_flag(&flag, "ARKStepEvolve", 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 = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); - if (check_flag(&flag, "ARKodePrintAllStats", 1)) { return 1; } + flag = ARKStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(&flag, "ARKStepPrintAllStats", 1)) { return 1; } } // --------- @@ -378,7 +378,7 @@ int main(int argc, char* argv[]) // Free MPI Cartesian communicator MPI_Comm_free(&(udata.comm_c)); - ARKodeFree(&arkode_mem); + ARKStepFree(&arkode_mem); SUNLinSolFree(LS); // Free the SuperLU_DIST structures (also frees user allocated arrays diff --git a/benchmarks/diffusion_2D/mpi_serial/buffers.cpp b/benchmarks/diffusion_2D/mpi_serial/buffers.cpp index a5448b8939..13a35dbffb 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(uarray, "N_VGetArrayPointer", 0)) return -1; + if (check_flag((void*)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 277267993b..9be04d0cde 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 -static sunindextype global_index(sunindextype i, sunindextype j, int x, int y, - UserData* udata) +sunindextype global_index(sunindextype i, sunindextype j, int x, int y, + UserData* udata) { SUNDIALS_CXX_MARK_FUNCTION(udata->prof); @@ -253,13 +253,12 @@ static sunindextype global_index(sunindextype i, sunindextype j, int x, int y, // x -- x processor coordinate // y -- y processor coordinate #if defined(BENCHMARK_ODE) -static int matrix_row(sunindextype i, sunindextype j, int x, int y, - UserData* udata, sunrealtype* vals, sunindextype* col_idx, - sunindextype* row_nnz) +int matrix_row(sunindextype i, sunindextype j, int x, int y, UserData* udata, + sunrealtype* vals, sunindextype* col_idx, sunindextype* row_nnz) #else -static int matrix_row(sunindextype i, sunindextype j, int x, int y, - UserData* udata, sunrealtype cj, sunrealtype* vals, - sunindextype* col_idx, sunindextype* row_nnz) +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 36224a9c38..d522349e3f 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 num_warmups, int ntests, +static void time_stats(N_Vector X, double* times, int nwarmups, int ntests, double* avg, double* sdev, double* min, double* max) { int i, ntotal; /* total number of times collected */ - ntotal = num_warmups + ntests; + ntotal = nwarmups + ntests; /* if running in parallel collect data from all processes */ collect_times(X, times, ntotal); /* compute timing stats */ *avg = 0.0; - *min = times[num_warmups]; - *max = times[num_warmups]; + *min = times[nwarmups]; + *max = times[nwarmups]; - for (i = num_warmups; i < ntotal; i++) + for (i = nwarmups; 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 num_warmups, int ntests, *sdev = 0.0; if (ntests > 1) { - for (i = num_warmups; i < ntotal; i++) + for (i = nwarmups; i < ntotal; i++) { *sdev += (times[i] - *avg) * (times[i] - *avg); } diff --git a/cmake/SundialsBuildOptionsPre.cmake b/cmake/SundialsBuildOptionsPre.cmake index b78212e720..d4defde798 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) - message(FATAL_ERROR "Both static and shared library generation were disabled.") + print_error("Both static and shared library generation were disabled.") endif() # --------------------------------------------------------------- @@ -185,6 +185,11 @@ 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 29f099eb1e..a34ef8ae95 100644 --- a/cmake/SundialsExampleOptions.cmake +++ b/cmake/SundialsExampleOptions.cmake @@ -38,7 +38,8 @@ endif() # 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}") + + sundials_option(EXAMPLES_ENABLE_F2003 BOOL "${DOCSTR}" ON) # Fortran 2003 examples only support double precision if(EXAMPLES_ENABLE_F2003 AND (NOT (SUNDIALS_PRECISION MATCHES "DOUBLE"))) @@ -46,6 +47,14 @@ 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/SundialsSetupCompilers.cmake b/cmake/SundialsSetupCompilers.cmake index f4b226e96d..36f10b44c1 100644 --- a/cmake/SundialsSetupCompilers.cmake +++ b/cmake/SundialsSetupCompilers.cmake @@ -76,38 +76,8 @@ endif() if(ENABLE_ALL_WARNINGS) message(STATUS "Enabling all compiler warnings") - # 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 ${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 - # 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_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}") set(CMAKE_Fortran_FLAGS "-Wall -Wpedantic -Wno-unused-dummy-argument -Wno-c-binding-type -ffpe-summary=none ${CMAKE_Fortran_FLAGS}") endif() @@ -218,17 +188,6 @@ 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/cmake/SundialsSetupFortran.cmake b/cmake/SundialsSetupFortran.cmake index 1daee0b7b2..2e6e8c4de0 100644 --- a/cmake/SundialsSetupFortran.cmake +++ b/cmake/SundialsSetupFortran.cmake @@ -19,6 +19,25 @@ # 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/SundialsTPLOptions.cmake b/cmake/SundialsTPLOptions.cmake index 36e0dc5a1b..42a058c9aa 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, SYCL)" "REF;OMP" +sundials_option(SUNDIALS_GINKGO_BACKENDS STRING "Which Ginkgo backend(s) to build the SUNDIALS Ginkgo interfaces for (REF, OMP, CUDA, HIP, DPCPP)" "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 1e23dfdb58..3e27c2858c 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 "SYCL") + elseif(backend MATCHES "DPCPP") set(vector nvecsycl) elseif(backend MATCHES "OMP") set(vector nvecopenmp) diff --git a/cmake/macros/SundialsAddLibrary.cmake b/cmake/macros/SundialsAddLibrary.cmake index 199f790e66..ca0d226191 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} ${sundials_add_library_UNPARSED_ARGUMENTS}) + add_library(${obj_target} OBJECT ${sources}) set_target_properties(${obj_target} PROPERTIES FOLDER "obj") @@ -173,19 +173,6 @@ 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() @@ -213,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} PUBLIC SUNDIALS_STATIC_DEFINE) + target_compile_definitions(${obj_target} PRIVATE SUNDIALS_STATIC_DEFINE) else() target_compile_definitions(${obj_target} PRIVATE sundials_core_EXPORTS) endif() @@ -252,7 +239,11 @@ macro(sundials_add_library target) # set target name set(_actual_target_name ${target}${_lib_suffix}) - set(_object_sources $<TARGET_OBJECTS:${obj_target}>) + add_library(${_actual_target_name} ${_libtype} $<TARGET_OBJECTS:${obj_target}>) + + set_target_properties(${_actual_target_name} PROPERTIES FOLDER "src") + + # add any object library dependencies if(sundials_add_library_OBJECT_LIBRARIES) if(${_libtype} MATCHES "STATIC") append_static_suffix(sundials_add_library_OBJECT_LIBRARIES _all_objs) @@ -260,14 +251,13 @@ macro(sundials_add_library target) set(_all_objs ${sundials_add_library_OBJECT_LIBRARIES}) endif() foreach(_tmp ${_all_objs}) - list(APPEND _object_sources $<TARGET_OBJECTS:${_tmp}>) + # 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}>) 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}") @@ -306,7 +296,7 @@ macro(sundials_add_library target) # 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} PRIVATE SUNDIALS_STATIC_DEFINE) else() target_compile_definitions(${obj_target} PRIVATE sundials_core_EXPORTS) endif() @@ -335,17 +325,10 @@ macro(sundials_add_library target) # 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 - ) - else() - set_target_properties(${_actual_target_name} PROPERTIES - OUTPUT_NAME ${sundials_add_library_OUTPUT_NAME} - CLEAN_DIRECT_OUTPUT 1 - ) - endif() + set_target_properties(${_actual_target_name} PROPERTIES + OUTPUT_NAME ${sundials_add_library_OUTPUT_NAME} + CLEAN_DIRECT_OUTPUT 1 + ) else() set_target_properties(${_actual_target_name} PROPERTIES OUTPUT_NAME ${target} @@ -372,7 +355,7 @@ macro(sundials_add_library target) endif() # install phase - install(TARGETS ${_actual_target_name} EXPORT sundials-targets) + install(TARGETS ${_actual_target_name} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT sundials-targets) endif() @@ -436,46 +419,38 @@ 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}}" - WINDOWS_EXPORT_ALL_SYMBOLS ON) + set(_properties PROPERTIES Fortran_MODULE_DIRECTORY "${CMAKE_Fortran_MODULE_DIRECTORY}_{{libtype}}") 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" - WINDOWS_EXPORT_ALL_SYMBOLS ON) + set(_properties PROPERTIES Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir") 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} 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} @@ -483,6 +458,7 @@ macro(sundials_add_f2003_library target) SOVERSION ${sundials_add_f2003_library_SOVERSION} ${sundials_add_f2003_library_UNPARSED_ARGUMENTS} ) + endmacro() diff --git a/cmake/tpl/FindKLU.cmake b/cmake/tpl/FindKLU.cmake index a3d817d037..96b9d7343b 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(MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) +if(WIN32) 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(MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) + if(WIN32 AND NOT MSYS) set(CMAKE_FIND_LIBRARY_PREFIXES "") endif() find_library( SUITESPARSECONFIG_LIBRARY ${SUITESPARSECONFIG_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH) diff --git a/cmake/tpl/SundialsGinkgo.cmake b/cmake/tpl/SundialsGinkgo.cmake index 595c96aa5a..cdb99f5411 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 "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.") + 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.") endif() if(SUNDIALS_GINKGO_BACKENDS MATCHES "OMP" AND NOT ENABLE_OPENMP) diff --git a/cmake/tpl/SundialsKLU.cmake b/cmake/tpl/SundialsKLU.cmake index aa71405687..8ab9a7fe72 100644 --- a/cmake/tpl/SundialsKLU.cmake +++ b/cmake/tpl/SundialsKLU.cmake @@ -57,22 +57,6 @@ 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/arkode/examples/source/conf.py b/doc/arkode/examples/source/conf.py index 826730c1f7..c86186cc6d 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/sundials_vars.py'))) -from sundials_vars import * +sys.path.append(os.path.dirname(os.path.abspath('../../../shared/versions.py'))) +from versions 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 97ccdc96e5..916641678b 100644 --- a/doc/arkode/guide/source/ARKodeButcherTable.rst +++ b/doc/arkode/guide/source/ARKodeButcherTable.rst @@ -18,66 +18,55 @@ Butcher Table Data Structure ============================== -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 +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): .. math:: - B \; \equiv \; \begin{array}{r|c} c & A \\ \hline q & b \\ p & \tilde{b} \end{array} - \; = \; - \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 - -.. 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` + \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} - .. c:member:: sunrealtype **A +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 - The method coefficients :math:`A \in \mathbb{R}^s` +.. c:type:: ARKodeButcherTableMem* ARKodeButcherTable - .. c:member:: sunrealtype *c +where ``ARKodeButcherTableMem`` is the structure - The method abscissa :math:`c \in \mathbb{R}^s` +.. code-block:: c - .. c:member:: sunrealtype *b + typedef struct ARKodeButcherTableMem { - The method coefficients :math:`b \in \mathbb{R}^s` + int q; + int p; + int stages; + sunrealtype **A; + sunrealtype *c; + sunrealtype *b; + sunrealtype *d; - .. c:member:: sunrealtype *d + }; - The method embedding coefficients :math:`\tilde{b} \in \mathbb{R}^s` +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}`. .. _ARKodeButcherTable.Functions: @@ -94,14 +83,10 @@ 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 | @@ -153,23 +138,6 @@ 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. - - .. versionadded:: 6.1.0 - .. c:function:: ARKodeButcherTable ARKodeButcherTable_LoadDIRK(ARKODE_DIRKTableID imethod) Retrieves a specified diagonally-implicit Butcher table. The prototype for @@ -204,24 +172,6 @@ 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. - - .. versionadded:: 6.1.0 - - .. c:function:: ARKodeButcherTable ARKodeButcherTable_Alloc(int stages, sunbooleantype embedded) Allocates an empty Butcher table. diff --git a/doc/arkode/guide/source/Butcher.rst b/doc/arkode/guide/source/Butcher.rst index 678510cd4f..015b500a04 100644 --- a/doc/arkode/guide/source/Butcher.rst +++ b/doc/arkode/guide/source/Butcher.rst @@ -150,37 +150,6 @@ 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 @@ -215,74 +184,6 @@ 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 @@ -438,10 +339,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 +412,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`). @@ -1222,37 +1123,6 @@ 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 @@ -1324,69 +1194,6 @@ 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 @@ -2227,11 +2034,9 @@ 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\}`. - -.. c:enum:: ARKODE_SPRKMethodID +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. - 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 22363ef243..c4cad94a8d 100644 --- a/doc/arkode/guide/source/Constants.rst +++ b/doc/arkode/guide/source/Constants.rst @@ -52,8 +52,6 @@ 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). | +-----------------------------------------------+------------------------------------------------------------+ @@ -76,16 +74,8 @@ 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. | @@ -126,9 +116,6 @@ 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). | +-----------------------------------------------+------------------------------------------------------------+ @@ -153,9 +140,6 @@ 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). | +-----------------------------------------------+------------------------------------------------------------+ @@ -184,16 +168,8 @@ 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. | @@ -238,9 +214,6 @@ 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). | +-----------------------------------------------+------------------------------------------------------------+ @@ -257,9 +230,6 @@ 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 | | +-----------------------------------------------+------------------------------------------------------------+ @@ -329,59 +299,30 @@ 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). | +-----------------------------------------------+------------------------------------------------------------+ @@ -391,12 +332,6 @@ 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). | +-----------------------------------------------+------------------------------------------------------------+ @@ -535,9 +470,6 @@ 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. | +-------------------------------------+------+------------------------------------------------------------+ | | @@ -578,18 +510,8 @@ 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/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index 7427e78f0a..6461cbf0d6 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 X.Y.Z ==================================== .. include:: ../../../shared/RecentChanges.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 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>`. + 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>`. * 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 ddbd7c4122..8da6d2735a 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 for solving implicit algebraic systems that arise in computing each -stage and/or step: +ARKODE's time-stepping modules 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 may be run in a variety of "modes": +ARKODE's time stepping modules 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 ARKODE supports +As mentioned above, the time-stepping modules in ARKODE support 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,12 +162,13 @@ 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: -"Hermite" and "Lagrange". The former approach +ARKODE provides two complementary interpolation approaches, +both of which are accessible from any of the +time-stepping modules: "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 more recent 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 new approach that is +designed to provide increased accuracy when integrating stiff problems. +Both are described in detail below. .. _ARKODE.Mathematics.Interpolation.Hermite: @@ -564,8 +565,7 @@ 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 requires that ARKODE be run -using a fixed time-step size. +conservation property :cite:p:`HaWa:06`, SPRKStep employs 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,8 +1014,11 @@ 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 section -:ref:`ARKODE Optional Inputs <ARKODE.Usage.OptionalInputs>`. +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>`. .. _ARKODE.Mathematics.AlgebraicSolvers: @@ -1137,7 +1140,8 @@ 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:`ARKodeSetDeduceImplicitRhs` +mass matrices. This optimization can be enabled by +:c:func:`ARKStepSetDeduceImplicitRhs` and :c:func:`MRIStepSetDeduceImplicitRhs` 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 @@ -1944,9 +1948,10 @@ step (but zero linear solves with the system Jacobian). Rootfinding =============== -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 +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 :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 @@ -2060,8 +2065,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.Tolerances` to satisfy the -inequality constraints. +strategies as discussed in :numref:`ARKODE.Usage.ARKStep.Tolerances` and +:numref:`ARKODE.Usage.ERKStep.Tolerances` to satisfy the inequality constraints. .. _ARKODE.Mathematics.Relaxation: @@ -2125,4 +2130,5 @@ 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.Relaxation`. +:numref:`ARKODE.Usage.ERKStep.Relaxation` and +:numref:`ARKODE.Usage.ARKStep.Relaxation`. diff --git a/doc/arkode/guide/source/Organization.rst b/doc/arkode/guide/source/Organization.rst index 204ed9a999..8ab599ff2d 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.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.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.Organization.ARKODE.Figure: .. figure:: /figs/arkode/arkorg.png :align: center *ARKODE organization*: Overall structure of the ARKODE package. - 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. + 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. 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/index.rst b/doc/arkode/guide/source/Usage/ARKStep/index.rst deleted file mode 100644 index 3edc8baf51..0000000000 --- a/doc/arkode/guide/source/Usage/ARKStep/index.rst +++ /dev/null @@ -1,32 +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.ARKStep: - -====================================== -Using the ARKStep time-stepping module -====================================== - -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. 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 - - User_callable - Relaxation - XBraid diff --git a/doc/arkode/guide/source/Usage/Preconditioners.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Preconditioners.rst similarity index 61% rename from doc/arkode/guide/source/Usage/Preconditioners.rst rename to doc/arkode/guide/source/Usage/ARKStep_c_interface/Preconditioners.rst index 62bdb966b0..d772f5ad4a 100644 --- a/doc/arkode/guide/source/Usage/Preconditioners.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Preconditioners.rst @@ -12,7 +12,7 @@ SUNDIALS Copyright End ---------------------------------------------------------------- -.. _ARKODE.Usage.PreconditionerModules: +.. _ARKODE.Usage.ARKStep.PreconditionerModules: Preconditioner modules ============================ @@ -20,12 +20,13 @@ 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: -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 +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). -.. _ARKODE.Usage.BandPre: +.. _ARKODE.Usage.ARKStep.BandPre: A serial banded preconditioner module ------------------------------------------- @@ -62,70 +63,66 @@ 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.Skeleton` are +skeleton program presented in :numref:`ARKODE.Usage.ARKStep.Skeleton` are *italicized*. -#. *Initialize multi-threaded environment (if appropriate)* +1. *Initialize multi-threaded environment (if appropriate)* -#. *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* - -#. Create iterative linear solver object +6. 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. -#. *Set linear solver optional inputs* - -#. *Attach linear solver module* +7. *Set linear solver optional inputs* -#. Initialize the ARKBANDPRE preconditioner module +8. *Attach linear solver module* - Specify the upper and lower half-bandwidths (``mu`` and ``ml``, - respectively) and call +9. Initialize the ARKBANDPRE preconditioner module - ``ier = ARKBandPrecInit(arkode_mem, N, mu, ml);`` + Specify the upper and lower half-bandwidths (``mu`` and ``ml``, + respectively) and call - to allocate memory and initialize the internal preconditioner - data. + ``ier = ARKBandPrecInit(arkode_mem, N, mu, ml);`` -#. *Create nonlinear solver object* + to allocate memory and initialize the internal preconditioner + data. -#. *Attach nonlinear solver module* +10. *Set optional inputs* -#. *Set nonlinear solver optional inputs* + Note that the user should not call + :c:func:`ARKStepSetPreconditioner()` as it will overwrite the + preconditioner setup and solve functions. -#. *Set optional inputs* +11. *Create nonlinear solver object* - Note that the user should not call - :c:func:`ARKodeSetPreconditioner()` as it will overwrite the - preconditioner setup and solve functions. +12. *Attach nonlinear solver module* -#. *Specify rootfinding problem* +13. *Set nonlinear solver optional inputs* -#. *Advance solution in time* +14. *Specify rootfinding problem* -#. Get optional outputs +15. *Advance solution in time* - Additional optional outputs associated with ARKBANDPRE are - available by way of the two routines described below, - :c:func:`ARKBandPrecGetWorkSpace()` and - :c:func:`ARKBandPrecGetNumRhsEvals()`. +16. Get optional outputs -#. *Deallocate memory for solution vector* + Additional optional outputs associated with ARKBANDPRE are + available by way of the two routines described below, + :c:func:`ARKBandPrecGetWorkSpace()` and + :c:func:`ARKBandPrecGetNumRhsEvals()`. -#. *Free solver memory* +17. *Deallocate memory for solution vector* -#. *Free linear solver memory* +18. *Free solver memory* -#. *Free nonlinear solver memory* +19. *Free linear solver memory* @@ -144,19 +141,20 @@ by calling the following function: Initializes the ARKBANDPRE preconditioner and allocates required (internal) memory for it. - :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. + **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. - :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:: + **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:** The banded approximate Jacobian will have nonzero elements only in locations :math:`(i,j)` with *ml* :math:`\le j-i \le` *mu*. @@ -172,25 +170,26 @@ the ARKBANDPRE module: Returns the sizes of the ARKBANDPRE real and integer workspaces. - :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``. + **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. - .. note:: + **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:** 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:`ARKodeGetLinWorkSpace()`. + the corresponding function :c:func:`ARKStepGetLinWorkSpace()`. @@ -201,29 +200,30 @@ the ARKBANDPRE module: finite-difference banded Jacobian approximation used within the preconditioner setup function. - :param arkode_mem: pointer to the ARKODE memory block. - :param nfevalsBP: number of calls to :math:`f^I`. + **Arguments:** + * *arkode_mem* -- pointer to the ARKStep memory block. + * *nfevalsBP* -- number of calls to :math:`f^I`. - :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:: + **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:** The counter *nfevalsBP* is distinct from the counter *nfevalsLS* returned by the corresponding function - :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. + :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()`. -.. _ARKODE.Usage.BBDPre: +.. _ARKODE.Usage.ARKStep.BBDPre: A parallel band-block-diagonal preconditioner module --------------------------------------------------------- @@ -242,8 +242,9 @@ 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`, -and is included in a software module within the ARKODE package. This +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 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 @@ -338,7 +339,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:`ARKodeSetUserData()` and that was passed to the user's +:c:func:`ARKStepSetUserData()` 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 @@ -351,21 +352,22 @@ 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*. - :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:: - + **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:** 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. @@ -381,20 +383,21 @@ 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*. - :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:: - + **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:** The *cfn* function is expected to save communicated data in space defined within the data structure *user_data*. @@ -419,30 +422,28 @@ 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.Skeleton` are *italicized*. - -#. *Initialize MPI* +:numref:`ARKODE.Usage.ARKStep.Skeleton` are *italicized*. -#. *Create the SUNDIALS simulation context object* +1. *Initialize MPI* -#. *Set problem dimensions* +2. *Set problem dimensions* -#. *Set vector of initial values* +3. *Set vector of initial values* -#. *Create ARKODE object* +4. *Create ARKStep object* -#. *Specify integration tolerances* +5. *Specify integration tolerances* -#. Create iterative linear solver object +6. 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. -#. *Set linear solver optional inputs* +7. *Set linear solver optional inputs* -#. *Attach linear solver module* +8. *Attach linear solver module* -#. Initialize the ARKBBDPRE preconditioner module +9. Initialize the ARKBBDPRE preconditioner module Specify the upper and lower half-bandwidths for computation ``mudq`` and ``mldq``, the upper and lower half-bandwidths for @@ -455,38 +456,36 @@ 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. -#. *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 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()`. -#. *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* - -#. *Finalize MPI* +20. *Finalize MPI* @@ -503,34 +502,35 @@ and attached to the integrator by calling the following functions: Initializes and allocates (internal) memory for the ARKBBDPRE preconditioner. - :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:: - + **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:** 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 ``*StepReInit`` to re-initialize ARKODE for a +calling :c:func:`ARKStepReInit()` to re-initialize ARKStep 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,30 +562,31 @@ 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 -``ARKodeSet***`` functions, must also be made (in the proper order). +``ARKStepSet***`` 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. - :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:: - + **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:** 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. @@ -600,25 +601,26 @@ the ARKBBDPRE module: Returns the processor-local ARKBBDPRE real and integer workspace sizes. - :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``. + **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. - .. note:: + **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:** 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:`ARKodeGetLinWorkSpace()`. + the corresponding function :c:func:`ARKStepGetLinWorkSpace()`. @@ -629,20 +631,22 @@ the ARKBBDPRE module: difference approximation of the Jacobian blocks used within the preconditioner setup function. - :param arkode_mem: pointer to the ARKODE memory block. - :param ngevalsBBDP: the number of calls made to the user-supplied - *gloc* function. + **Arguments:** + * *arkode_mem* -- pointer to the ARKStep memory block. + * *ngevalsBBDP* -- the number of calls made to the user-supplied + *gloc* 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_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`` 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 ARKODE output and +evaluations, where *nlinsetups* is an optional ARKStep output and *npsolves* and *nfevalsLS* are linear solver optional outputs (see -the table :numref:`ARKODE.Usage.ARKLsOutputs`). +the table :numref:`ARKODE.Usage.ARKStep.ARKLsOutputs`). diff --git a/doc/arkode/guide/source/Usage/ARKStep/Relaxation.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Relaxation.rst similarity index 88% rename from doc/arkode/guide/source/Usage/ARKStep/Relaxation.rst rename to doc/arkode/guide/source/Usage/ARKStep_c_interface/Relaxation.rst index ed7ba1fd64..38e66f0e36 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/Relaxation.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Relaxation.rst @@ -17,12 +17,15 @@ Relaxation Methods ================== -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. +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`. +.. 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 -------------------------------- @@ -69,11 +72,6 @@ Enabling or Disabling Relaxation .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetRelaxFn` instead. - - Optional Input Functions ------------------------ @@ -98,11 +96,6 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetRelaxEtaFail` instead. - - .. c:function:: int ARKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) Sets the smallest acceptable value for the relaxation parameter. @@ -124,11 +117,6 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetRelaxLowerBound` instead. - - .. c:function:: int ARKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) Sets the largest acceptable value for the relaxation parameter. @@ -150,11 +138,6 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - 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 @@ -174,11 +157,6 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - 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 @@ -202,19 +180,16 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - 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. - The default value is :c:enumerator:`ARK_RELAX_NEWTON` + The default value is ``ARK_RELAX_NEWTON``. :param arkode_mem: the ARKStep memory structure - :param solver: the nonlinear solver to use + :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 @@ -223,11 +198,6 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - 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 @@ -253,11 +223,6 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - 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 @@ -284,11 +249,6 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetRelaxTol` instead. - - Optional Output Functions ------------------------- @@ -309,11 +269,6 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - 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. @@ -328,11 +283,6 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumRelaxJacEvals` instead. - - .. c:function:: int ARKStepGetNumRelaxFails(void* arkode_mem, long int* fails) Get the total number of times applying relaxation failed. @@ -352,10 +302,6 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumRelaxFails` instead. - .. c:function:: int ARKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails) @@ -372,11 +318,6 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - 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. @@ -391,11 +332,6 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumRelaxSolveFails` instead. - - .. c:function:: int ARKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) Get the number of relaxation parameter nonlinear solver iterations. @@ -409,7 +345,3 @@ about the performance of the relaxation method. ``NULL`` .. versionadded:: 5.6.0 - - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumRelaxSolveIters` instead. diff --git a/doc/arkode/guide/source/Usage/Skeleton.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Skeleton.rst similarity index 73% rename from doc/arkode/guide/source/Usage/Skeleton.rst rename to doc/arkode/guide/source/Usage/ARKStep_c_interface/Skeleton.rst index 5909007646..daa3586143 100644 --- a/doc/arkode/guide/source/Usage/Skeleton.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Skeleton.rst @@ -12,13 +12,13 @@ SUNDIALS Copyright End ---------------------------------------------------------------- -.. _ARKODE.Usage.Skeleton: +.. _ARKODE.Usage.ARKStep.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 ARKODE. +program) for the integration of an ODE IVP using the ARKStep 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`, @@ -77,32 +77,30 @@ 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 ARKODE object +#. Create ARKStep object - 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. + 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. #. Specify integration tolerances - Call :c:func:`ARKodeSStolerances()` or - :c:func:`ARKodeSVtolerances()` to specify either a scalar relative + Call :c:func:`ARKStepSStolerances()` or + :c:func:`ARKStepSVtolerances()` 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:`ARKodeWFtolerances()` + respectively. Alternatively, call :c:func:`ARKStepWFtolerances()` to specify a function which sets directly the weights used in evaluating WRMS vector norms. See - :numref:`ARKODE.Usage.Tolerances` for details. + :numref:`ARKODE.Usage.ARKStep.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:`ARKodeResStolerance()`, :c:func:`ARKodeResVtolerance()`, or - :c:func:`ARKodeResFtolerance()`. + :c:func:`ARKStepResStolerance()`, :c:func:`ARKStepResVtolerance()`, or + :c:func:`ARKStepResFtolerance()`. #. Create matrix object @@ -158,27 +156,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.LinearSolvers`): + with the call (for details see :numref:`ARKODE.Usage.ARKStep.LinearSolvers`): .. code-block:: c - ier = ARKodeSetLinearSolver(...); + ier = ARKStepSetLinearSolver(...); 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.LinearSolvers`): + :numref:`ARKODE.Usage.ARKStep.LinearSolvers`): .. code-block:: c - ier = ARKodeSetMassLinearSolver(...); + ier = ARKStepSetMassLinearSolver(...); #. 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.NonlinearSolvers`), + (see :numref:`ARKODE.Usage.ARKStep.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 @@ -198,41 +196,34 @@ 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 ARKODE using the call (for details see - :numref:`ARKODE.Usage.NonlinearSolvers`): + attached to ARKStep using the call (for details see + :numref:`ARKODE.Usage.ARKStep.NonlinearSolvers`): .. code-block:: c - ier = ARKodeSetNonlinearSolver(...); + ier = ARKStepSetNonlinearSolver(...); #. 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 ARKODE, otherwise the optional inputs will be - overridden by ARKODE defaults. See + solver to ARKStep, otherwise the optional inputs will be + overridden by ARKStep defaults. See :numref:`SUNNonlinSol` for more information on optional inputs. #. Set optional inputs - 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. + 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. #. Specify rootfinding problem - Optionally, call :c:func:`ARKodeRootInit()` to initialize a rootfinding + Optionally, call :c:func:`ARKStepRootInit()` to initialize a rootfinding problem to be solved during the integration of the ODE system. See - :numref:`ARKODE.Usage.RootFinding` for general details, and - :numref:`ARKODE.Usage.OptionalInputs` for relevant optional + :numref:`ARKODE.Usage.ARKStep.RootFinding` for general details, and + :numref:`ARKODE.Usage.ARKStep.OptionalInputs` for relevant optional input calls. #. Advance solution in time @@ -241,24 +232,17 @@ the function to be called or macro to be referenced. .. code-block:: c - ier = ARKodeEvolve(arkode_mem, tout, yout, &tret, itask); + ier = ARKStepEvolve(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.Integration` for details. + :numref:`ARKODE.Usage.ARKStep.Integration` for details. #. Get optional outputs - 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. + Call ``ARKStepGet*`` functions to obtain optional output. See + :numref:`ARKODE.Usage.ARKStep.OptionalOutputs` for details. #. Deallocate memory for solution vector @@ -271,8 +255,8 @@ the function to be called or macro to be referenced. #. Free solver memory - Call :c:func:`ARKodeFree()` to free the memory allocated for - the ARKODE module (and any nonlinear solver module). + Call :c:func:`ARKStepFree()` to free the memory allocated for + the ARKStep module (and any nonlinear solver module). #. Free linear solver and matrix memory @@ -282,14 +266,10 @@ the function to be called or macro to be referenced. #. Free nonlinear solver memory - If a user-supplied ``SUNNonlinearSolver`` was provided to ARKODE, + If a user-supplied ``SUNNonlinearSolver`` was provided to ARKStep, 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/ARKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst similarity index 71% rename from doc/arkode/guide/source/Usage/ARKStep/User_callable.rst rename to doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst index a6c07ac5e6..4da2461e96 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst @@ -17,23 +17,22 @@ ARKStep User-callable functions ================================ -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. +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. -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*: +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). -* temporal adaptivity -* implicit nonlinear and/or linear solvers -* non-identity mass matrices -* relaxation Runge--Kutta methods .. _ARKODE.Usage.ARKStep.Initialization: @@ -74,9 +73,6 @@ ARKStep initialization and deallocation functions **Return value:** None - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeFree` instead. .. _ARKODE.Usage.ARKStep.Tolerances: @@ -84,6 +80,39 @@ 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) @@ -100,9 +129,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSStolerances` instead. .. c:function:: int ARKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) @@ -123,9 +149,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSVtolerances` instead. .. c:function:: int ARKStepWFtolerances(void* arkode_mem, ARKEwtFn efun) @@ -143,9 +166,44 @@ 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:: 6.1.0 - Use :c:func:`ARKodeWFtolerances` instead. + +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. @@ -163,9 +221,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeResStolerance` instead. .. c:function:: int ARKStepResVtolerance(void* arkode_mem, N_Vector rabstol) @@ -183,9 +238,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeResVtolerance` instead. .. c:function:: int ARKStepResFtolerance(void* arkode_mem, ARKRwtFn rfun) @@ -203,9 +255,117 @@ 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:: 6.1.0 - Use :c:func:`ARKodeResFtolerance` instead. + +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. @@ -214,6 +374,74 @@ ARKStep tolerance specification functions 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 @@ -256,9 +484,8 @@ Linear solver interface functions insufficient to store :math:`\mathcal{A}` then it will need to be resized internally by ARKStep. - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeSetLinearSolver` instead. + @@ -267,6 +494,57 @@ Linear solver interface functions 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) @@ -318,9 +596,7 @@ Mass matrix solver specification functions mass-matrix-times-vector product routine (see :c:type:`ARKLsMassTimesVecFn` and :c:func:`ARKStepSetMassTimes()`). - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeSetMassLinearSolver` instead. .. _ARKODE.Usage.ARKStep.NonlinearSolvers: @@ -328,6 +604,23 @@ Mass matrix solver specification functions 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) @@ -350,9 +643,7 @@ Nonlinear solver interface functions default; a call to this routine replaces that module with the supplied *NLS* object. - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeSetNonlinearSolver` instead. .. _ARKODE.Usage.ARKStep.RootFinding: @@ -360,6 +651,15 @@ Nonlinear solver interface functions 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) @@ -389,9 +689,7 @@ Rootfinding initialization function problem but the prior one did, then call *ARKStepRootInit* with *nrtfn = 0*. - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeRootInit` instead. .. _ARKODE.Usage.ARKStep.Integration: @@ -399,6 +697,12 @@ Rootfinding initialization function 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) @@ -508,9 +812,7 @@ ARKStep solver function On all other error returns, *tret* and *yout* are left unchanged from those provided to the routine. - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeEvolve` instead. .. _ARKODE.Usage.ARKStep.OptionalInputs: @@ -518,12 +820,68 @@ ARKStep solver 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) @@ -545,17 +903,40 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetDefaults` instead. .. c:function:: int ARKStepSetInterpolantType(void* arkode_mem, int itype) - .. deprecated:: 6.1.0 + 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. - 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) @@ -598,16 +979,14 @@ Optional inputs for ARKStep obtained by the integrator are returned at the ends of the time interval. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetInterpolantDegree` instead. .. c:function:: int ARKStepSetDenseOrder(void* arkode_mem, int dord) - .. deprecated:: 5.2.0 + *This function is deprecated, and will be removed in a future release. + Users should transition to calling* :c:func:`ARKStepSetInterpolantDegree()` + *instead.* - Use :c:func:`ARKodeSetInterpolantDegree` instead. .. c:function:: int ARKStepSetDiagnostics(void* arkode_mem, FILE* diagfp) @@ -694,9 +1073,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:: 6.1.0 - Use :c:func:`ARKodeSetFixedStep` instead. @@ -724,9 +1101,7 @@ Optional inputs for ARKStep This routine will also reset the step size and error history. - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeSetInitStep` instead. .. c:function:: int ARKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) @@ -750,9 +1125,7 @@ Optional inputs for ARKStep A negative value indicates that no warning messages should be issued. - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeSetMaxHnilWarns` instead. .. c:function:: int ARKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) @@ -776,9 +1149,6 @@ Optional inputs for ARKStep Passing *mxsteps* < 0 disables the test (not recommended). - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxNumSteps` instead. .. c:function:: int ARKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) @@ -797,9 +1167,6 @@ Optional inputs for ARKStep **Notes:** Pass *hmax* :math:`\le 0.0` to set the default value of :math:`\infty`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxStep` instead. .. c:function:: int ARKStepSetMinStep(void* arkode_mem, sunrealtype hmin) @@ -818,9 +1185,6 @@ Optional inputs for ARKStep **Notes:** Pass *hmin* :math:`\le 0.0` to set the default value of 0. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMinStep` instead. .. c:function:: int ARKStepSetStopTime(void* arkode_mem, sunrealtype tstop) @@ -848,10 +1212,6 @@ Optional inputs for ARKStep :c:func:`ARKStepReset` will remain active but can be disabled by calling :c:func:`ARKStepClearStopTime`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetStopTime` instead. - .. c:function:: int ARKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) @@ -869,10 +1229,6 @@ Optional inputs for ARKStep .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetInterpolateStopTime` instead. - .. c:function:: int ARKStepClearStopTime(void* arkode_mem) @@ -891,10 +1247,6 @@ Optional inputs for ARKStep .. versionadded:: 5.5.1 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeClearStopTime` instead. - .. c:function:: int ARKStepSetUserData(void* arkode_mem, void* user_data) @@ -919,9 +1271,6 @@ Optional inputs for ARKStep this function must be made *before* any calls to :c:func:`ARKStepSetLinearSolver()` and/or :c:func:`ARKStepSetMassLinearSolver()`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetUserData` instead. .. c:function:: int ARKStepSetMaxErrTestFails(void* arkode_mem, int maxnef) @@ -942,9 +1291,6 @@ Optional inputs for ARKStep The default value is 7; set *maxnef* :math:`\le 0` to specify this default. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxErrTestFails` instead. .. c:function:: int ARKStepSetOptimalParams(void* arkode_mem) @@ -968,148 +1314,6 @@ Optional inputs for ARKStep all problems are different, so these values may not be optimal for all users. - .. deprecated:: 6.1.0 - - 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) @@ -1154,10 +1358,6 @@ Optional inputs for ARKStep and :c:func:`ARKStepSetFixedStep()` are incompatible, and should not be used simultaneously. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetConstraints` instead. - .. c:function:: int ARKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) @@ -1176,9 +1376,6 @@ Optional inputs for ARKStep Passing *maxfails* <= 0 results in ARKStep using the default value (10). - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxNumConstrFails` instead. .. _ARKODE.Usage.ARKStep.ARKStepMethodInputTable: @@ -1227,9 +1424,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetOrder` instead. .. c:function:: int ARKStepSetImEx(void* arkode_mem) @@ -1348,8 +1542,6 @@ 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`. @@ -1389,9 +1581,6 @@ 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`. - @@ -1432,9 +1621,6 @@ 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`. - @@ -1443,6 +1629,34 @@ 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) @@ -1459,10 +1673,6 @@ Optional inputs for time step adaptivity .. versionadded:: 5.7.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetAdaptController` instead. - .. c:function:: int ARKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) @@ -1557,12 +1767,6 @@ Optional inputs for time step adaptivity .. versionadded:: 5.7.0 - .. deprecated:: 6.1.0 - - 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. @@ -1580,9 +1784,6 @@ Optional inputs for time step adaptivity Any non-positive parameter will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetCFLFraction` instead. .. c:function:: int ARKStepSetErrorBias(void* arkode_mem, sunrealtype bias) @@ -1629,9 +1830,6 @@ Optional inputs for time step adaptivity **Notes:** Any interval *not* containing 1.0 will imply a reset to the default values. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetFixedStepBounds` instead. .. c:function:: int ARKStepSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) @@ -1653,9 +1851,6 @@ Optional inputs for time step adaptivity **Notes:** Any value outside the interval :math:`(0,1]` will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxCFailGrowth` instead. .. c:function:: int ARKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) @@ -1675,9 +1870,6 @@ Optional inputs for time step adaptivity **Notes:** Any value outside the interval :math:`(0,1]` will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxEFailGrowth` instead. .. c:function:: int ARKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) @@ -1698,9 +1890,6 @@ Optional inputs for time step adaptivity **Notes:** Any value :math:`\le 1.0` will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxFirstGrowth` instead. .. c:function:: int ARKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) @@ -1721,9 +1910,6 @@ Optional inputs for time step adaptivity Any value :math:`\le 1.0` will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxGrowth` instead. .. c:function:: int ARKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) @@ -1746,9 +1932,6 @@ Optional inputs for time step adaptivity Any value outside the interval :math:`(0,1)` will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMinReduction` instead. .. c:function:: int ARKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) @@ -1769,9 +1952,6 @@ Optional inputs for time step adaptivity Any value :math:`\le 0` will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetSafetyFactor` instead. .. c:function:: int ARKStepSetSmallNumEFails(void* arkode_mem, int small_nef) @@ -1792,9 +1972,6 @@ Optional inputs for time step adaptivity **Notes:** Any value :math:`\le 0` will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetSmallNumEFails` instead. .. c:function:: int ARKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) @@ -1821,9 +1998,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetStabilityFn` instead. @@ -1832,6 +2006,32 @@ Optional inputs for time step adaptivity 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) @@ -1861,9 +2061,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetLinear` instead. .. c:function:: int ARKStepSetNonlinear(void* arkode_mem) @@ -1885,9 +2082,6 @@ Optional inputs for implicit stage solves :c:func:`ARKStepSetDeltaGammaMax()` to reset the step size ratio threshold to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetNonlinear` instead. .. c:function:: int ARKStepSetPredictorMethod(void* arkode_mem, int method) @@ -1933,9 +2127,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetPredictorMethod` instead. .. c:function:: int ARKStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) @@ -1956,9 +2147,6 @@ Optional inputs for implicit stage solves See :numref:`ARKODE.Usage.StagePredictFn` for more information on this user-supplied routine. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetStagePredictFn` instead. .. c:function:: int ARKStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) @@ -1984,9 +2172,6 @@ Optional inputs for implicit stage solves When using a non-default nonlinear solver, this function must be called *after* :c:func:`ARKStepSetNonlinearSolver()`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetNlsRhsFn` instead. .. c:function:: int ARKStepSetMaxNonlinIters(void* arkode_mem, int maxcor) @@ -2008,9 +2193,6 @@ Optional inputs for implicit stage solves The default value is 3; set *maxcor* :math:`\le 0` to specify this default. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxNonlinIters` instead. .. c:function:: int ARKStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) @@ -2031,9 +2213,6 @@ Optional inputs for implicit stage solves The default value is 0.1; set *nlscoef* :math:`\le 0` to specify this default. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetNonlinConvCoef` instead. .. c:function:: int ARKStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) @@ -2052,9 +2231,6 @@ Optional inputs for implicit stage solves **Notes:** Any non-positive parameter will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetNonlinCRDown` instead. .. c:function:: int ARKStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) @@ -2075,9 +2251,6 @@ Optional inputs for implicit stage solves **Notes:** Any non-positive parameter will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetNonlinRDiv` instead. .. c:function:: int ARKStepSetMaxConvFails(void* arkode_mem, int maxncf) @@ -2106,9 +2279,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetMaxConvFails` instead. .. c:function:: int ARKStepSetDeduceImplicitRhs(void *arkode_mem, sunbooleantype deduce) @@ -2129,10 +2299,6 @@ Optional inputs for implicit stage solves .. versionadded:: 5.2.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetDeduceImplicitRhs` instead. - .. _ARKODE.Usage.ARKStep.ARKLsInputs: @@ -2140,13 +2306,81 @@ Optional inputs for implicit stage solves 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) @@ -2167,11 +2401,9 @@ Optional inputs for the ARKLS linear solver interface **Notes:** Any non-positive parameter will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetDeltaGammaMax` instead. - +.. index:: + single: optional input; linear solver setup frequency (ARKStep) .. c:function:: int ARKStepSetLSetupFrequency(void* arkode_mem, int msbp) @@ -2193,10 +2425,10 @@ 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:: 6.1.0 - - 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) @@ -2230,9 +2462,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:: 6.1.0 - Use :c:func:`ARKodeSetJacEvalFrequency` instead. @@ -2243,6 +2473,59 @@ Optional inputs for the ARKLS linear solver interface 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) @@ -2272,10 +2555,6 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules The function type :c:func:`ARKLsJacFn()` is described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetJacFn` instead. - .. c:function:: int ARKStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) @@ -2303,10 +2582,6 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules The function type :c:func:`ARKLsLinSysFn()` is described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetLinSysFn` instead. - .. c:function:: int ARKStepSetMassFn(void* arkode_mem, ARKLsMassFn mass) @@ -2334,10 +2609,6 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules The function type :c:func:`ARKLsMassFn()` is described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMassFn` instead. - .. c:function:: int ARKStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) @@ -2359,16 +2630,47 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules Linear solution scaling is enabled by default when a matrix-based linear solver is attached. - .. deprecated:: 6.1.0 - - 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) @@ -2403,10 +2705,19 @@ Optional inputs for matrix-free ``SUNLinearSolver`` modules :c:type:`ARKLsJacTimesVecFn` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: 6.1.0 - - 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) @@ -2433,9 +2744,21 @@ 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:: 6.1.0 - Use :c:func:`ARKodeSetJacTimesRhsFn` instead. + +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). + .. c:function:: int ARKStepSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn mtsetup, ARKLsMassTimesVecFn mtimes, void* mtimes_data) @@ -2474,9 +2797,6 @@ Optional inputs for matrix-free ``SUNLinearSolver`` modules :c:type:`ARKLsMassTimesVecFn` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMassTimes` instead. @@ -2485,6 +2805,51 @@ Optional inputs for matrix-free ``SUNLinearSolver`` modules 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) @@ -2517,10 +2882,6 @@ Optional inputs for iterative ``SUNLinearSolver`` modules :c:func:`ARKLsPrecSolveFn()` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetPreconditioner` instead. - .. c:function:: int ARKStepSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, ARKLsMassPrecSolveFn psolve) @@ -2553,9 +2914,6 @@ Optional inputs for iterative ``SUNLinearSolver`` modules :c:func:`ARKLsMassPrecSolveFn()` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMassPreconditioner` instead. .. c:function:: int ARKStepSetEpsLin(void* arkode_mem, sunrealtype eplifac) @@ -2582,9 +2940,6 @@ Optional inputs for iterative ``SUNLinearSolver`` modules interface has been initialized through a call to :c:func:`ARKStepSetLinearSolver()`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetEpsLin` instead. .. c:function:: int ARKStepSetMassEpsLin(void* arkode_mem, sunrealtype eplifac) @@ -2611,9 +2966,20 @@ Optional inputs for iterative ``SUNLinearSolver`` modules Passing a value *eplifac* :math:`\le 0` indicates to use the default value of 0.05. - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeSetMassEpsLin` instead. +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. .. c:function:: int ARKStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) @@ -2643,9 +3009,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetLSNormFactor` instead. .. c:function:: int ARKStepSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac) @@ -2675,15 +3038,31 @@ 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:: 6.1.0 - 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. @@ -2706,9 +3085,6 @@ Rootfinding optional input functions **Notes:** The default behavior is to monitor for both zero-crossing directions. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetRootDirection` instead. .. c:function:: int ARKStepSetNoInactiveRootWarn(void* arkode_mem) @@ -2732,9 +3108,7 @@ Rootfinding optional input functions first step), ARKStep will issue a warning which can be disabled with this optional input function. - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeSetNoInactiveRootWarn` instead. @@ -2743,6 +3117,19 @@ Rootfinding optional input functions 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) @@ -2781,9 +3168,6 @@ Interpolated output function functions :c:func:`ARKStepGetCurrentTime()` and :c:func:`ARKStepGetLastStep()`, respectively. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetDky` instead. @@ -2792,11 +3176,101 @@ Interpolated output function 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) @@ -2811,9 +3285,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetWorkSpace` instead. .. c:function:: int ARKStepGetNumSteps(void* arkode_mem, long int* nsteps) @@ -2829,9 +3300,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumSteps` instead. .. c:function:: int ARKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) @@ -2855,9 +3323,6 @@ Main solver optional output functions local error test condition, or to ensure convergence of the nonlinear solver. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetActualInitStep` instead. .. c:function:: int ARKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) @@ -2873,9 +3338,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetLastStep` instead. .. c:function:: int ARKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) @@ -2890,9 +3352,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetCurrentStep` instead. .. c:function:: int ARKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) @@ -2907,9 +3366,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetCurrentTime` instead. .. c:function:: int ARKStepGetCurrentState(void *arkode_mem, N_Vector *ycur) @@ -2929,10 +3385,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetCurrentState` instead. - .. c:function:: int ARKStepGetCurrentGamma(void *arkode_mem, sunrealtype *gamma) @@ -2947,9 +3399,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetCurrentGamma` instead. .. c:function:: int ARKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac) @@ -2966,9 +3415,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetTolScaleFactor` instead. .. c:function:: int ARKStepGetErrWeights(void* arkode_mem, N_Vector eweight) @@ -2987,9 +3433,6 @@ Main solver optional output functions The user must allocate space for *eweight*, that will be filled in by this function. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetErrWeights` instead. .. c:function:: int ARKStepGetResWeights(void* arkode_mem, N_Vector rweight) @@ -3008,9 +3451,6 @@ Main solver optional output functions The user must allocate space for *rweight*, that will be filled in by this function. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetResWeights` instead. .. c:function:: int ARKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) @@ -3029,10 +3469,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetStepStats` instead. - .. c:function:: int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) @@ -3061,12 +3497,8 @@ Main solver optional output functions .. versionadded:: 5.2.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodePrintAllStats` instead. - -.. c:function:: char* ARKStepGetReturnFlagName(long int flag) +.. c:function:: char *ARKStepGetReturnFlagName(long int flag) Returns the name of the ARKStep constant corresponding to *flag*. See :ref:`ARKODE.Constants`. @@ -3078,9 +3510,7 @@ Main solver optional output functions The return value is a string containing the name of the corresponding constant. - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeGetReturnFlagName` instead. @@ -3097,9 +3527,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumExpSteps` instead. .. c:function:: int ARKStepGetNumAccSteps(void* arkode_mem, long int* accsteps) @@ -3115,9 +3542,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumAccSteps` instead. .. c:function:: int ARKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts) @@ -3132,9 +3556,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumStepAttempts` instead. .. c:function:: int ARKStepGetNumRhsEvals(void* arkode_mem, long int* nfe_evals, long int* nfi_evals) @@ -3170,9 +3591,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumErrTestFails` instead. .. c:function:: int ARKStepGetNumStepSolveFails(void* arkode_mem, long int* ncnf) @@ -3187,9 +3605,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumStepSolveFails` instead. .. c:function:: int ARKStepGetCurrentButcherTables(void* arkode_mem, ARKodeButcherTable *Bi, ARKodeButcherTable *Be) @@ -3255,9 +3670,6 @@ 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:: 6.1.0 - - 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) @@ -3292,9 +3704,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumConstrFails` instead. .. c:function:: int ARKStepGetUserData(void* arkode_mem, void** user_data) @@ -3312,16 +3721,26 @@ Main solver optional output functions .. versionadded:: 5.3.0 - .. deprecated:: 6.1.0 - - 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 @@ -3339,10 +3758,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumLinSolvSetups` instead. - .. c:function:: int ARKStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) @@ -3362,9 +3777,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumNonlinSolvIters` instead. .. c:function:: int ARKStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nncfails) @@ -3384,9 +3796,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumNonlinSolvConvFails` instead. .. c:function:: int ARKStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, long int* nncfails) @@ -3407,9 +3816,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNonlinSolvStats` instead. @@ -3418,6 +3824,17 @@ Implicit solver optional output functions 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 @@ -3445,9 +3862,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetRootInfo` instead. .. c:function:: int ARKStepGetNumGEvals(void* arkode_mem, long int* ngevals) @@ -3463,9 +3877,7 @@ Rootfinding optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeGetNumGEvals` instead. .. _ARKODE.Usage.ARKStep.ARKLsOutputs: @@ -3473,6 +3885,47 @@ Rootfinding optional output functions 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 @@ -3490,11 +3943,6 @@ 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:: 6.1.0 - - 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 @@ -3507,11 +3955,6 @@ 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:: 6.1.0 - - 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 @@ -3524,11 +3967,6 @@ 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:: 6.1.0 - - 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. @@ -3553,10 +3991,6 @@ Linear solver interface optional output functions In a parallel setting, the above values are global (i.e. summed over all processors). - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetLinWorkSpace` instead. - .. c:function:: int ARKStepGetNumJacEvals(void* arkode_mem, long int* njevals) @@ -3575,10 +4009,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumJacEvals` instead. - .. c:function:: int ARKStepGetNumPrecEvals(void* arkode_mem, long int* npevals) @@ -3599,10 +4029,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumPrecEvals` instead. - .. c:function:: int ARKStepGetNumPrecSolves(void* arkode_mem, long int* npsolves) @@ -3622,10 +4048,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumPrecSolves` instead. - .. c:function:: int ARKStepGetNumLinIters(void* arkode_mem, long int* nliters) @@ -3644,10 +4066,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumLinIters` instead. - .. c:function:: int ARKStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails) @@ -3666,10 +4084,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumLinConvFails` instead. - .. c:function:: int ARKStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetup) @@ -3689,10 +4103,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumJTSetupEvals` instead. - .. c:function:: int ARKStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals) @@ -3712,10 +4122,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumJtimesEvals` instead. - .. c:function:: int ARKStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) @@ -3741,10 +4147,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumLinRhsEvals` instead. - .. c:function:: int ARKStepGetLastLinFlag(void* arkode_mem, long int* lsflag) @@ -3796,12 +4198,8 @@ Linear solver interface optional output functions *SUN_ERR_EXT_FAIL*, indicating an unrecoverable failure in an external iterative linear solver package. - .. deprecated:: 6.1.0 - 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*. @@ -3813,9 +4211,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetLinReturnFlagName` instead. @@ -3843,10 +4238,6 @@ Linear solver interface optional output functions In a parallel setting, the above values are global (i.e. summed over all processors). - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetMassWorkSpace` instead. - .. c:function:: int ARKStepGetNumMassSetups(void* arkode_mem, long int* nmsetups) @@ -3868,10 +4259,6 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumMassSetups` instead. - .. c:function:: int ARKStepGetNumMassMultSetups(void* arkode_mem, long int* nmvsetups) @@ -3892,11 +4279,6 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: 6.1.0 - - 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' @@ -3917,10 +4299,6 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumMassMult` instead. - .. c:function:: int ARKStepGetNumMassSolves(void* arkode_mem, long int* nmsolves) @@ -3940,10 +4318,6 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumMassSolves` instead. - .. c:function:: int ARKStepGetNumMassPrecEvals(void* arkode_mem, long int* nmpevals) @@ -3964,10 +4338,6 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumMassPrecEvals` instead. - .. c:function:: int ARKStepGetNumMassPrecSolves(void* arkode_mem, long int* nmpsolves) @@ -3988,10 +4358,6 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumMassPrecSolves` instead. - .. c:function:: int ARKStepGetNumMassIters(void* arkode_mem, long int* nmiters) @@ -4011,10 +4377,6 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumMassIters` instead. - .. c:function:: int ARKStepGetNumMassConvFails(void* arkode_mem, long int* nmcfails) @@ -4034,10 +4396,6 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumMassConvFails` instead. - .. c:function:: int ARKStepGetNumMTSetups(void* arkode_mem, long int* nmtsetup) @@ -4058,10 +4416,6 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumMTSetups` instead. - .. c:function:: int ARKStepGetLastMassFlag(void* arkode_mem, long int* mlsflag) @@ -4082,9 +4436,7 @@ Linear solver interface optional output functions will match those described above for the function :c:func:`ARKStepGetLastLinFlag()`. - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeGetLastMassFlag` instead. @@ -4093,6 +4445,24 @@ Linear solver interface optional output functions 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) @@ -4114,10 +4484,6 @@ General usability functions for this pointer, since parameters for all processes would be identical. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeWriteParameters` instead. - .. c:function:: int ARKStepWriteButcher(void* arkode_mem, FILE *fp) @@ -4143,10 +4509,8 @@ General usability functions for this pointer, since tables for all processes would be identical. - .. deprecated:: 6.1.0 - Use :c:func:`ARKStepGetCurrentButcherTables` and :c:func:`ARKodeButcherTable_Write` - instead. + @@ -4240,6 +4604,44 @@ 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 @@ -4268,9 +4670,6 @@ ARKStep reset function If an error occurred, :c:func:`ARKStepReset()` also sends an error message to the error handler function. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeReset` instead. @@ -4279,6 +4678,36 @@ ARKStep reset function 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 @@ -4346,10 +4775,6 @@ ARKStep system resize function **Example codes:** * ``examples/arkode/C_serial/ark_heat1D_adapt.c`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeResize` instead. - .. _ARKStep_CInterface.MRIStepInterface: diff --git a/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst similarity index 60% rename from doc/arkode/guide/source/Usage/ARKStep/XBraid.rst rename to doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst index 665610283a..ffc80e5901 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/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 ARKODE in a traditional sequential +The prior sections discuss using ARKStep 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 ARKODE. In this +of ordinary differential equations that can be evolved with ARKStep. 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 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. +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. @@ -65,7 +65,7 @@ ARKStep time-stepping module to also use XBraid. SUNBraid Interface ------------------ -Interfacing ARKODE with XBraid requires defining two data structures. The +Interfacing ARKStep 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 ARKODE and XBraid for +provides all the functionaly needed combine ARKStep 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 exsting code that uses ARKStep to also use XBraid. @@ -156,21 +156,25 @@ example usage of the function. This function returns a vector to use as a template for creating new vectors with :c:func:`N_VClone()`. - :param app: input, a SUNBraidApp instance (XBraid app structure). - :param y: output, the template vector. + **Arguments:** + * *app* -- input, a SUNBraidApp instance (XBraid app structure). + * *y* -- output, the template vector. - :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`. + **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`. - .. code-block:: C + **Usage:** - /* Get template vector */ - flag = SUNBraidApp_GetVecTmpl(app, y_ptr); - if (flag != SUNBRAID_SUCCESS) return flag; + .. code-block:: C + + /* Get template vector */ + flag = SUNBraidApp_GetVecTmpl(app, y_ptr); + if (flag != SUNBRAID_SUCCESS) return flag; @@ -188,16 +192,20 @@ instance. This function creates a new SUNBraidApp instance with the content and operations initialized to ``NULL``. - :param app: output, an empty SUNBraidApp instance (XBraid app structure). + **Arguments:** + * *app* -- output, an empty SUNBraidApp instance (XBraid app structure). + + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * *SUNBRAID_ALLOCFAIL* if a memory allocation failed. - :retval SUNBRAID_SUCCESS: if successful. - :retval SUNBRAID_ALLOCFAIL: if a memory allocation failed. + **Usage:** - .. 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; @@ -205,14 +213,18 @@ instance. This function destroys an empty SUNBraidApp instance. - :param app: input, an empty SUNBraidApp instance (XBraid app structure). + **Arguments:** + * *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:: @@ -234,15 +246,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: -.. c:type:: struct _braid_Vector_struct *SUNBraidVector; - - Pointer to vector wrapper (same as braid_Vector) - -.. c:struct:: _braid_Vector_struct +.. code-block:: C - .. c:member:: N_Vector y + struct _braid_Vector_struct + { + N_Vector y; + }; - SUNDIALS N_Vector wrapped by the ``braid_Vector`` + /* Poiner to vector wrapper (same as braid_Vector) */ + typedef struct _braid_Vector_struct *SUNBraidVector; To assist in creating creating and destroying this structure the following utility functions are provided. @@ -251,18 +263,22 @@ utility functions are provided. This function creates a new SUNBraidVector wrapping the N_Vector y. - :param y: input, the N_Vector to wrap. - :param u: output, the SUNBraidVector wrapping *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. - :retval SUNBRAID_SUCCESS: if successful. - :retval SUNBRAID_ILLINPUT: if *y* is ``NULL``. - :retval SUNBRAID_ALLOCFAIL: if a memory allocation fails. + **Usage:** - .. 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:: @@ -276,18 +292,22 @@ utility functions are provided. This function retrieves the wrapped N_Vector from the SUNBraidVector. - :param u: input, the SUNBraidVector wrapping *y*. - :param y: output, the wrapped N_Vector. + **Arguments:** + * *u* -- input, the SUNBraidVector wrapping *y*. + * *y* -- output, the wrapped N_Vector. - :retval SUNBRAID_SUCCESS: if successful. - :retval SUNBRAID_ILLINPUT: if *u* is ``NULL``. - :retval SUNBRAID_MEMFAIL: if *y* is ``NULL``. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * *SUNBRAID_ILLINPUT* if *u* is ``NULL``. + * *SUNBRAID_MEMFAIL* if *y* is ``NULL``. - .. code-block:: C + **Usage:** - /* Create new vector wrapper */ - flag = SUNBraidVector_GetNVector(u, y_ptr); - if (flag != SUNBRAID_SUCCESS) return flag; + .. code-block:: C + + /* Create new vector wrapper */ + flag = SUNBraidVector_GetNVector(u, y_ptr); + if (flag != SUNBRAID_SUCCESS) return flag; @@ -301,14 +321,16 @@ 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()`. - :param app: input, a SUNBraidApp instance (XBraid app structure). - :param u: input, the SUNBraidVector to clone. - :param v_ptr: output, the new SUNBraidVector. + **Arguments:** + * *app* -- input, a SUNBraidApp instance (XBraid app structure). + * *u* -- input, the SUNBraidVector to clone. + * *v_ptr* -- output, the new SUNBraidVector. - :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. + **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. @@ -317,10 +339,12 @@ N_Vector operations. This function destroys the SUNBraidVector and the wrapped N_Vector using :c:func:`N_VDestroy()`. - :param app: input, a SUNBraidApp instance (XBraid app structure). - :param u: input, the SUNBraidVector to destroy. + **Arguments:** + * *app* -- input, a SUNBraidApp instance (XBraid app structure). + * *u* -- input, the SUNBraidVector to destroy. - :retval SUNBRAID_SUCCESS: if successful. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. @@ -329,15 +353,17 @@ N_Vector operations. This function computes the vector sum :math:`\alpha x + \beta y \rightarrow y` using :c:func:`N_VLinearSum()`. - :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`. + **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`. - :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``. + **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``. @@ -346,13 +372,15 @@ N_Vector operations. This function computes the 2-norm of the vector *u* using :c:func:`N_VDotProd()`. - :param app: input, a SUNBraidApp instance (XBraid app structure). - :param u: input, the vector *u*. - :param norm_ptr: output, the L2 norm of *u*. + **Arguments:** + * *app* -- input, a SUNBraidApp instance (XBraid app structure). + * *u* -- input, the vector *u*. + * *norm_ptr* -- output, the L2 norm of *u*. - :retval SUNBRAID_SUCCESS: if successful. - :retval SUNBRAID_ILLINPUT: if *u* is ``NULL``. - :retval SUNBRAID_MEMFAIL: if the wrapped N_Vector is ``NULL``. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * *SUNBRAID_ILLINPUT* if *u* is ``NULL``. + * *SUNBRAID_MEMFAIL* if the wrapped N_Vector is ``NULL``. @@ -361,14 +389,16 @@ 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()`. - :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. + **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. - :retval SUNBRAID_SUCCESS: if successful - :retval otherwise: an error flag from :c:func:`SUNBraidApp_GetVecTmpl` - or :c:func:`N_VBufSize()`. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * An error flag from :c:func:`SUNBraidApp_GetVecTmpl` or + :c:func:`N_VBufSize()`. @@ -377,15 +407,17 @@ N_Vector operations. This function packs the message buffer for exchanging vector data using :c:func:`N_VBufPack()`. - :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. + **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. - :retval SUNBRAID_SUCCESS: if successful. - :retval SUNBRAID_ILLINPUT: if *u* is ``NULL``. - :retval otherwise: An error flag from :c:func:`N_VBufPack()`. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * *SUNBRAID_ILLINPUT* if *u* is ``NULL``. + * An error flag from :c:func:`N_VBufPack()`. @@ -395,17 +427,19 @@ N_Vector operations. SUNBraidVector with the buffer data using :c:func:`N_VBufUnpack()`, :c:func:`SUNBraidApp_GetVecTmpl`, and :c:func:`N_VClone()`. - :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. + **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. - :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()`. + **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()`. @@ -446,9 +480,9 @@ ARKBraid Interface ------------------ This section describes the ARKBraid implementation of a SUNBraidApp for using -the ARKODE's ARKStep time-stepping module with XBraid. The following section +the ARKStep integration module with XBraid. The following section :numref:`ARKODE.Usage.ARKStep.ARKBraid_InitDealloc` describes routines for creating, -initializing, and destroying the ARKODE + XBraid interface, routines for +initializing, and destroying the ARKStep + 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 @@ -456,7 +490,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 ARKODE, +wish to create their own SUNBraidApp implementation using ARKStep, :numref:`ARKODE.Usage.ARKStep.ARKBraid_Utility` describes some helpful functions available to the user. @@ -481,19 +515,20 @@ if an error occurred. The possible return codes are given in private ARKBraid interface structure, and attaches the necessary SUNBraidOps implementations. - :param arkode_mem: input, a pointer to an ARKODE memory structure. - :param app: output, an ARKBraid instance (XBraid app structure). + **Arguments:** + * *arkode_mem* -- input, a pointer to an ARKStep memory structure. + * *app* -- output, an ARKBraid instance (XBraid app structure). - :retval SUNBRAID_SUCCESS: if successful. - :retval SUNBRAID_ILLINPUT: *arkode_mem* is ``NULL``. - :retval SUNBRAID_ALLOCFAIL: if a memory allocation failed. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * *SUNBRAID_ILLINPUT* *arkode_mem* is ``NULL``. + * *SUNBRAID_ALLOCFAIL* if a memory allocation failed. .. warning:: The ARKBraid interface is ARKStep-specific. Although one could eventually - construct an XBraid interface to other of ARKODE time-stepping modules - (e.g., ERKStep or MRIStep), those are not currently supported by this - implementation. + construct an XBraid interface to either ERKStep or MRIStep, those are not + supported by this implementation. @@ -503,19 +538,21 @@ 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. - :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()`. + **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()`. .. note:: @@ -535,9 +572,11 @@ if an error occurred. The possible return codes are given in This function deallocates an ARKBraid instance. - :param app: input, a pointer to an ARKBraid instance. + **Arguments:** + * *app* -- input, a pointer to an ARKBraid instance. - :retval SUNBRAID_SUCCESS: if successful. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. @@ -560,13 +599,15 @@ error occurred. The possible return codes are given in This function sets the step function provided to XBraid (default :c:func:`ARKBraid_Step()`). - :param app: input, an ARKBraid instance. - :param step: input, an XBraid step function. If *step* is ``NULL``, the - default function will be used. + **Arguments:** + * *app* -- input, an ARKBraid instance. + * *step* -- input, an XBraid step function. If *step* is ``NULL``, the + default function will be used. - :retval SUNBRAID_SUCCESS: if successful. - :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. - :retval SUNBRAID_MEMFAIL: if the *app* content is ``NULL``. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. + * *SUNBRAID_MEMFAIL* if the *app* content is ``NULL``. .. note:: @@ -579,13 +620,15 @@ error occurred. The possible return codes are given in This function sets the vector initialization function provided to XBraid (default :c:func:`ARKBraid_Init()`). - :param app: input, an ARKBraid instance. - :param init: input, an XBraid vector initialization function. If *init* is - ``NULL``, the default function will be used. + **Arguments:** + * *app* -- input, an ARKBraid instance. + * *init* -- input, an XBraid vector initialization function. If *init* is + ``NULL``, the default function will be used. - :retval SUNBRAID_SUCCESS: if successful. - :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. - :retval SUNBRAID_MEMFAIL: if the *app* content is ``NULL``. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. + * *SUNBRAID_MEMFAIL* if the *app* content is ``NULL``. .. note:: @@ -598,13 +641,15 @@ error occurred. The possible return codes are given in This function sets the spatial norm function provided to XBraid (default :c:func:`SUNBraidVector_SpatialNorm()`). - :param app: input, an ARKBraid instance. - :param snorm: input, an XBraid spatial norm function. If *snorm* is ``NULL``, - the default function will be used. + **Arguments:** + * *app* -- input, an ARKBraid instance. + * *snorm* -- input, an XBraid spatial norm function. If *snorm* is ``NULL``, + the default function will be used. - :retval SUNBRAID_SUCCESS: if successful. - :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. - :retval SUNBRAID_MEMFAIL: if the *app* content is ``NULL``. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. + * *SUNBRAID_MEMFAIL* if the *app* content is ``NULL``. .. note:: @@ -617,13 +662,15 @@ error occurred. The possible return codes are given in This function sets the user access function provided to XBraid (default :c:func:`ARKBraid_Access()`). - :param app: input, an ARKBraid instance. - :param init: input, an XBraid user access function. If *access* is ``NULL``, - the default function will be used. + **Arguments:** + * *app* -- input, an ARKBraid instance. + * *init* -- input, an XBraid user access function. If *access* is ``NULL``, + the default function will be used. - :retval SUNBRAID_SUCCESS: if successful. - :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. - :retval SUNBRAID_MEMFAIL: if the *app* content is ``NULL``. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. + * *SUNBRAID_MEMFAIL* if the *app* content is ``NULL``. .. note:: @@ -646,30 +693,18 @@ 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 ARKODE memory to use as a template + 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:`SUNBraidApp_GetVecTmpl()`. - :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``. - - - -.. 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()`. + **Arguments:** + * *app* -- input, an ARKBraid instance. + * *tmpl* -- output, a template vector. - :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``. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. + * *SUNBRAID_MEMFAIL* if the *app* content or ARKStep memory is ``NULL``. @@ -678,29 +713,30 @@ error occurred. The possible return codes are given in This function returns the ARKStep memory structure pointer attached with :c:func:`ARKBraid_Create()`. - :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``. + **Arguments:** + * *app* -- input, an ARKBraid instance. + * *arkode_mem* -- output, a pointer to the ARKStep memory structure. - .. deprecated:: 6.1.0 + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. + * *SUNBRAID_MEMFAIL* if the *app* content or ARKStep memory is ``NULL``. - 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:`ARKodeSetUserData()`. + :c:func:`ARKStepSetUserData()`. - :param app: input, an ARKBraid instance. - :param user_data: output, a pointer to the user data structure. + **Arguments:** + * *app* -- input, an ARKBraid instance. + * *user_data* -- output, a pointer to the user data 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``. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. + * *SUNBRAID_MEMFAIL* if the *app* content or ARKStep memory is ``NULL``. @@ -709,26 +745,14 @@ error occurred. The possible return codes are given in This function returns the return value from the most recent XBraid function call. - :param app: input, an ARKBraid instance. - :param last_flag: output, the XBraid return value. - - :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. + **Arguments:** + * *app* -- input, an ARKBraid instance. + * *last_flag* -- output, the XBraid return value. - :retval SUNBRAID_SUCCESS: if successful. - :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. - :retval SUNBRAID_MEMFAIL: if the *app* content is ``NULL``. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. + * *SUNBRAID_MEMFAIL* if the *app* content is ``NULL``. @@ -737,16 +761,14 @@ error occurred. The possible return codes are given in This function returns the return value from the most recent ARKStep function call. - :param app: input, an ARKBraid instance. - :param last_flag: output, the ARKStep return value. - - :retval SUNBRAID_SUCCESS: if successful. - :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. - :retval SUNBRAID_MEMFAIL: if the *app* content is ``NULL``. + **Arguments:** + * *app* -- input, an ARKBraid instance. + * *last_flag* -- output, the ARKStep return value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKBraid_GetLastARKodeFlag` instead. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. + * *SUNBRAID_MEMFAIL* if the *app* content is ``NULL``. .. c:function:: int ARKBraid_GetSolution(braid_App app, sunrealtype *tout, N_Vector yout) @@ -754,20 +776,22 @@ 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()`. - :param app: input, an ARKBraid instance. - :param last_flag: output, the ARKODE return value. + **Arguments:** + * *app* -- input, an ARKBraid instance. + * *last_flag* -- output, the ARKStep return value. - :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``. + **Return value:** + * *SUNBRAID_SUCCESS* if successful. + * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. + * *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 ARKODE with - :c:func:`ARKodeSetUserData()`. This user data pointer can be retrieved + output within the user data pointer attached to ARKStep with + :c:func:`ARKStepSetUserData()`. This user data pointer can be retrieved from the ARKBraid structure with :c:func:`ARKBraid_GetUserData()`. @@ -795,21 +819,23 @@ 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()`. - :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()`. + **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()`. .. note:: @@ -828,14 +854,16 @@ 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()`. - :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. + **Arguments:** + * *app* -- input, an ARKBraid instance. + * *t* -- input, the initialization time for the output vector. + * *u_ptr* -- output, the new and initialized SUNBraidVector. - :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. + **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. .. note:: @@ -855,17 +883,19 @@ in :numref:`ARKODE.Usage.ARKStep.SUNBraidReturnCodes.Table`. :c:func:`ARKBraid_GetSolution()`. A user-defined access function may be set with :c:func:`ARKBraid_SetAccessFn()`. - :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*. + **Arguments:** + * *app* -- input, an ARKBraid instance. + * *u* -- input, the vector to be accessed. + * *status* -- input, a status object to query for information about *u*. - :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()`. + **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()`. @@ -880,10 +910,9 @@ 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 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**. +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**. #. **Initialize MPI** @@ -962,7 +991,7 @@ steps are **bold**. Advanced ARKBraid Utility Functions ----------------------------------- -This section describes utility functions utilized in the ARKODE + XBraid +This section describes utility functions utilized in the ARKStep + 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. @@ -972,25 +1001,27 @@ 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 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. + 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. diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/index.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/index.rst new file mode 100644 index 0000000000..b7ba4f3b02 --- /dev/null +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/index.rst @@ -0,0 +1,64 @@ +.. ---------------------------------------------------------------- + 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.ARKStep: + +====================================== +Using the ARKStep time-stepping module +====================================== + +This chapter 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. + +.. toctree:: + :maxdepth: 1 + + Skeleton + User_callable + Relaxation + Preconditioners + XBraid diff --git a/doc/arkode/guide/source/Usage/ERKStep/index.rst b/doc/arkode/guide/source/Usage/ERKStep/index.rst deleted file mode 100644 index d799e0bc86..0000000000 --- a/doc/arkode/guide/source/Usage/ERKStep/index.rst +++ /dev/null @@ -1,31 +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: - -====================================== -Using the ERKStep time-stepping module -====================================== - -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 - - User_callable - Relaxation diff --git a/doc/arkode/guide/source/Usage/ERKStep/Relaxation.rst b/doc/arkode/guide/source/Usage/ERKStep_c_interface/Relaxation.rst similarity index 88% rename from doc/arkode/guide/source/Usage/ERKStep/Relaxation.rst rename to doc/arkode/guide/source/Usage/ERKStep_c_interface/Relaxation.rst index 979e8bff02..605a5493ea 100644 --- a/doc/arkode/guide/source/Usage/ERKStep/Relaxation.rst +++ b/doc/arkode/guide/source/Usage/ERKStep_c_interface/Relaxation.rst @@ -17,11 +17,9 @@ Relaxation Methods ================== -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 - +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`. Enabling or Disabling Relaxation -------------------------------- @@ -63,11 +61,6 @@ Enabling or Disabling Relaxation .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetRelaxFn` instead. - - Optional Input Functions ------------------------ @@ -92,11 +85,6 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetRelaxEtaFail` instead. - - .. c:function:: int ERKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) Sets the smallest acceptable value for the relaxation parameter. @@ -118,11 +106,6 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetRelaxLowerBound` instead. - - .. c:function:: int ERKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) Sets the largest acceptable value for the relaxation parameter. @@ -144,11 +127,6 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - 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 @@ -168,11 +146,6 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - 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 @@ -196,19 +169,16 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - 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. - The default value is :c:enumerator:`ARK_RELAX_NEWTON` + The default value is ``ARK_RELAX_NEWTON``. :param arkode_mem: the ERKStep memory structure - :param solver: the nonlinear solver to use + :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 @@ -217,11 +187,6 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - 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 @@ -246,11 +211,6 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - 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 @@ -278,11 +238,6 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetRelaxTol` instead. - - Optional Output Functions ------------------------- @@ -303,11 +258,6 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - 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. @@ -322,11 +272,6 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumRelaxJacEvals` instead. - - .. c:function:: int ERKStepGetNumRelaxFails(void* arkode_mem, long int* fails) Get the total number of times applying relaxation failed. @@ -346,11 +291,6 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumRelaxFails` instead. - - .. c:function:: int ERKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails) @@ -367,11 +307,6 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - 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. @@ -386,11 +321,6 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumRelaxSolveFails` instead. - - .. c:function:: int ERKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) Get the number of relaxation parameter nonlinear solver iterations. @@ -404,8 +334,3 @@ about the performance of the relaxation method. ``NULL`` .. versionadded:: 5.6.0 - - .. deprecated:: 6.1.0 - - 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 new file mode 100644 index 0000000000..308cff4b50 --- /dev/null +++ b/doc/arkode/guide/source/Usage/ERKStep_c_interface/Skeleton.rst @@ -0,0 +1,146 @@ +.. ---------------------------------------------------------------- + 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/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst similarity index 66% rename from doc/arkode/guide/source/Usage/ERKStep/User_callable.rst rename to doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst index 017aa17110..16bfba3761 100644 --- a/doc/arkode/guide/source/Usage/ERKStep/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 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. +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. -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 +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). @@ -71,10 +71,6 @@ ERKStep initialization and deallocation functions **Return value:** None - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeFree` instead. - .. _ARKODE.Usage.ERKStep.Tolerances: @@ -82,6 +78,40 @@ 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. @@ -97,10 +127,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSStolerances` instead. - .. c:function:: int ERKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) @@ -121,10 +147,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSVtolerances` instead. - .. c:function:: int ERKStepWFtolerances(void* arkode_mem, ARKEwtFn efun) @@ -142,9 +164,108 @@ 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:: 6.1.0 - Use :c:func:`ARKodeWFtolerances` instead. + + +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. @@ -153,6 +274,16 @@ ERKStep tolerance specification functions 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 @@ -181,10 +312,6 @@ Rootfinding initialization function problem but the prior one did, then call *ERKStepRootInit* with *nrtfn = 0*. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeRootInit` instead. - @@ -193,6 +320,15 @@ Rootfinding initialization function 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`. @@ -283,10 +419,6 @@ ERKStep solver function On all other error returns, *tret* and *yout* are left unchanged from those provided to the routine. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeEvolve` instead. - @@ -295,12 +427,85 @@ ERKStep solver function 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 @@ -321,18 +526,39 @@ 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:: 6.1.0 - Use :c:func:`ARKodeSetDefaults` instead. +.. 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). -.. c:function:: int ERKStepSetInterpolantType(void* arkode_mem, int itype) + **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. - .. deprecated:: 6.1.0 + 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()`. - This function is now a wrapper to :c:func:`ARKodeSetInterpolantType`, see - the documentation for that function instead. + If this routine is not called, the Hermite interpolation module will be used. @@ -376,17 +602,13 @@ Optional inputs for ERKStep obtained by the integrator are returned at the ends of the time interval. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetInterpolantDegree` instead. - .. c:function:: int ERKStepSetDenseOrder(void* arkode_mem, int dord) - .. deprecated:: 5.2.0 - - Use :c:func:`ARKodeSetInterpolantDegree` instead. + *This function is deprecated, and will be removed in a future release. + Users should transition to calling* :c:func:`ERKStepSetInterpolantDegree()` + *instead.* @@ -473,9 +695,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetFixedStep` instead. @@ -503,10 +722,6 @@ Optional inputs for ERKStep This routine will also reset the step size and error history. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetInitStep` instead. - .. c:function:: int ERKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) @@ -530,9 +745,6 @@ Optional inputs for ERKStep A negative value indicates that no warning messages should be issued. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxHnilWarns` instead. @@ -557,10 +769,6 @@ Optional inputs for ERKStep Passing *mxsteps* < 0 disables the test (not recommended). - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxNumSteps` instead. - .. c:function:: int ERKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) @@ -579,10 +787,6 @@ Optional inputs for ERKStep **Notes:** Pass *hmax* :math:`\le 0.0` to set the default value of :math:`\infty`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxStep` instead. - .. c:function:: int ERKStepSetMinStep(void* arkode_mem, sunrealtype hmin) @@ -601,10 +805,6 @@ Optional inputs for ERKStep **Notes:** Pass *hmin* :math:`\le 0.0` to set the default value of 0. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMinStep` instead. - .. c:function:: int ERKStepSetStopTime(void* arkode_mem, sunrealtype tstop) @@ -632,11 +832,6 @@ Optional inputs for ERKStep :c:func:`ERKStepReset` will remain active but can be disabled by calling :c:func:`ERKStepClearStopTime`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetStopTime` instead. - - .. c:function:: int ERKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) @@ -654,11 +849,6 @@ Optional inputs for ERKStep .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetInterpolateStopTime` instead. - - .. c:function:: int ERKStepClearStopTime(void* arkode_mem) @@ -677,11 +867,6 @@ Optional inputs for ERKStep .. versionadded:: 5.5.1 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeClearStopTime` instead. - - .. c:function:: int ERKStepSetUserData(void* arkode_mem, void* user_data) @@ -702,9 +887,6 @@ Optional inputs for ERKStep user-supplied functions for which it is an argument; otherwise ``NULL`` is passed. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetUserData` instead. @@ -726,10 +908,6 @@ Optional inputs for ERKStep The default value is 7; set *maxnef* :math:`\le 0` to specify this default. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxErrTestFails` instead. - .. c:function:: int ERKStepSetConstraints(void* arkode_mem, N_Vector constraints) @@ -774,11 +952,6 @@ Optional inputs for ERKStep and :c:func:`ERKStepSetFixedStep()` are incompatible, and should not be used simultaneously. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetConstraints` instead. - - .. c:function:: int ERKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) @@ -797,10 +970,6 @@ Optional inputs for ERKStep Passing *maxfails* <= 0 results in ERKStep using the default value (10). - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxNumConstrFails` instead. - .. _ARKODE.Usage.ERKStep.ERKStepMethodInput: @@ -846,10 +1015,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetOrder` instead. - .. c:function:: int ERKStepSetTable(void* arkode_mem, ARKodeButcherTable B) @@ -881,8 +1046,6 @@ 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) @@ -903,9 +1066,6 @@ 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) @@ -927,8 +1087,6 @@ 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`. @@ -943,6 +1101,43 @@ 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. @@ -963,11 +1158,6 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. .. versionadded:: 5.7.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetAdaptController` instead. - - .. c:function:: int ERKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) @@ -1028,7 +1218,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. @@ -1059,12 +1249,6 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. .. versionadded:: 5.7.0 - .. deprecated:: 6.1.0 - - 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. @@ -1082,10 +1266,6 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. Any non-positive parameter will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetCFLFraction` instead. - .. c:function:: int ERKStepSetErrorBias(void* arkode_mem, sunrealtype bias) @@ -1133,10 +1313,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetFixedStepBounds` instead. - .. c:function:: int ERKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) @@ -1156,10 +1332,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetMaxEFailGrowth` instead. - .. c:function:: int ERKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) @@ -1180,10 +1352,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetMaxFirstGrowth` instead. - .. c:function:: int ERKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) @@ -1204,10 +1372,6 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. Any value :math:`\le 1.0` will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxGrowth` instead. - .. c:function:: int ERKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) @@ -1230,10 +1394,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetMinReduction` instead. - .. c:function:: int ERKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) @@ -1254,10 +1414,6 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. Any non-positive parameter will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetSafetyFactor` instead. - .. c:function:: int ERKStepSetSmallNumEFails(void* arkode_mem, int small_nef) @@ -1278,10 +1434,6 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **Notes:** Any non-positive parameter will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetSmallNumEFails` instead. - .. c:function:: int ERKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) @@ -1308,10 +1460,6 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. where the right-hand side function :math:`f(t,y)` contains stiff terms. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetStabilityFn` instead. - @@ -1321,6 +1469,24 @@ 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. @@ -1343,10 +1509,6 @@ Rootfinding optional input functions **Notes:** The default behavior is to monitor for both zero-crossing directions. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetRootDirection` instead. - .. c:function:: int ERKStepSetNoInactiveRootWarn(void* arkode_mem) @@ -1370,9 +1532,6 @@ Rootfinding optional input functions first step), ERKStep will issue a warning which can be disabled with this optional input function. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetNoInactiveRootWarn` instead. @@ -1382,6 +1541,20 @@ Rootfinding optional input functions 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 @@ -1419,9 +1592,6 @@ Interpolated output function functions :c:func:`ERKStepGetCurrentTime()` and :c:func:`ERKStepGetLastStep()`, respectively. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetDky` instead. @@ -1430,12 +1600,96 @@ Interpolated output function 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) @@ -1450,10 +1704,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetWorkSpace` instead. - .. c:function:: int ERKStepGetNumSteps(void* arkode_mem, long int* nsteps) @@ -1469,10 +1719,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumSteps` instead. - .. c:function:: int ERKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) @@ -1495,10 +1741,6 @@ Main solver optional output functions bounds :math:`(h_{min} \le h_0 \le h_{max})`, or to satisfy the local error test condition. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetActualInitStep` instead. - .. c:function:: int ERKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) @@ -1514,10 +1756,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetLastStep` instead. - .. c:function:: int ERKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) @@ -1532,10 +1770,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetCurrentStep` instead. - .. c:function:: int ERKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) @@ -1550,10 +1784,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetCurrentTime` instead. - .. c:function:: int ERKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac) @@ -1570,10 +1800,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetTolScaleFactor` instead. - .. c:function:: int ERKStepGetErrWeights(void* arkode_mem, N_Vector eweight) @@ -1592,10 +1818,6 @@ Main solver optional output functions The user must allocate space for *eweight*, that will be filled in by this function. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetErrWeights` instead. - .. c:function:: int ERKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) @@ -1614,11 +1836,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetStepStats` instead. - - .. c:function:: int ERKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) @@ -1646,13 +1863,9 @@ Main solver optional output functions .. versionadded:: 5.2.0 - .. deprecated:: 6.1.0 - 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`. @@ -1664,10 +1877,6 @@ Main solver optional output functions The return value is a string containing the name of the corresponding constant. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetReturnFlagName` instead. - .. c:function:: int ERKStepGetNumExpSteps(void* arkode_mem, long int* expsteps) @@ -1683,10 +1892,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumExpSteps` instead. - .. c:function:: int ERKStepGetNumAccSteps(void* arkode_mem, long int* accsteps) @@ -1702,10 +1907,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumAccSteps` instead. - .. c:function:: int ERKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts) @@ -1720,10 +1921,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumStepAttempts` instead. - .. c:function:: int ERKStepGetNumRhsEvals(void* arkode_mem, long int* nf_evals) @@ -1754,10 +1951,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumErrTestFails` instead. - .. c:function:: int ERKStepGetCurrentButcherTable(void* arkode_mem, ARKodeButcherTable *B) @@ -1821,10 +2014,6 @@ 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:: 6.1.0 - - 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) @@ -1857,10 +2046,6 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumConstrFails` instead. - .. c:function:: int ERKStepGetUserData(void* arkode_mem, void** user_data) @@ -1878,17 +2063,26 @@ Main solver optional output functions .. versionadded:: 5.3.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetUserData` instead. - - .. _ARKODE.Usage.ERKStep.ERKStepRootOutputs: Rootfinding optional output functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. _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()` | + +--------------------------------------------------+---------------------------------+ + + + .. c:function:: int ERKStepGetRootInfo(void* arkode_mem, int* rootsfound) Returns an array showing which functions were found to @@ -1916,10 +2110,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetRootInfo` instead. - .. c:function:: int ERKStepGetNumGEvals(void* arkode_mem, long int* ngevals) @@ -1935,9 +2125,6 @@ Rootfinding optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumGEvals` instead. @@ -1946,6 +2133,28 @@ 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) @@ -1967,11 +2176,6 @@ General usability functions for this pointer, since parameters for all processes would be identical. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeWriteParameters` instead. - - .. c:function:: int ERKStepWriteButcher(void* arkode_mem, FILE *fp) @@ -1993,10 +2197,6 @@ General usability functions for this pointer, since tables for all processes would be identical. - .. deprecated:: 6.1.0 - - Use :c:func:`ERKStepGetCurrentButcherTable` and :c:func:`ARKodeButcherTable_Write` - instead. @@ -2079,6 +2279,40 @@ 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) @@ -2108,10 +2342,6 @@ ERKStep reset function If an error occurred, :c:func:`ERKStepReset()` also sends an error message to the error handler function. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeReset` instead. - @@ -2120,6 +2350,35 @@ ERKStep reset function 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) @@ -2154,6 +2413,22 @@ ERKStep system resize function to :c:func:`ERKStepSetConstraints()` is required to re-enable constraint checking. - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeResize` instead. +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``. diff --git a/doc/arkode/guide/source/Usage/ERKStep_c_interface/index.rst b/doc/arkode/guide/source/Usage/ERKStep_c_interface/index.rst new file mode 100644 index 0000000000..d4b2498243 --- /dev/null +++ b/doc/arkode/guide/source/Usage/ERKStep_c_interface/index.rst @@ -0,0 +1,45 @@ +.. ---------------------------------------------------------------- + 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: + +====================================== +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. + +.. toctree:: + :maxdepth: 1 + + Skeleton + User_callable + Relaxation diff --git a/doc/arkode/guide/source/Usage/MRIStep/Skeleton.rst b/doc/arkode/guide/source/Usage/MRIStep/Skeleton.rst deleted file mode 100644 index f1275b0ae3..0000000000 --- a/doc/arkode/guide/source/Usage/MRIStep/Skeleton.rst +++ /dev/null @@ -1,146 +0,0 @@ -.. ---------------------------------------------------------------- - Programmer(s): David J. Gardner @ LLNL - Daniel R. Reynolds @ SMU - ---------------------------------------------------------------- - Based on ERKStep by 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.MRIStep.Skeleton: - -A skeleton of the user's main program -============================================ - -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:: MRIStep 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 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. - - Once the ARKStep object is setup, create an ``MRIStepInnerStepper`` object - with :c:func:`ARKStepCreateMRIStepInnerStepper`. - - * If supplying a user-defined fast (inner) integrator, create the - ``MRIStepInnerStepper`` object as described in section - :numref:`ARKODE.Usage.MRIStep.CustomInnerStepper`. - - .. note:: - - When using ARKStep as a fast (inner) integrator it is the user's - responsibility to create, configure, and attach the integrator to the - MRIStep module. User-specified options regarding how this fast integration - should be performed (e.g., adaptive vs. fixed time step, - explicit/implicit/ImEx partitioning, algebraic solvers, etc.) will be - respected during evolution of the fast time scale during MRIStep - integration. - - Due to the algorithms supported in MRIStep, the ARKStep module used for - the fast time scale must be configured with an identity mass matrix. - - 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:`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:`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:`ARKodeRootInit()` - for more details. - -#. Create an MRIStep object for the slow (outer) integration - - Create the MRIStep object by calling :c:func:`MRIStepCreate`. One of the - 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 - 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* - - #. *Create matrix object* - - #. *Create linear solver object* - - #. *Set linear solver optional inputs* - - #. *Attach linear solver module* - - #. *Create nonlinear solver object* - - #. *Attach nonlinear solver module* - - #. *Set nonlinear solver optional inputs* - -#. *Set optional inputs* - -#. *Specify rootfinding problem* - -#. *Advance solution in time* - -#. *Get optional outputs* - -#. *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:`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:`ARKodeFree` to free the memory allocated for the MRIStep - slow integration object. - -#. *Free linear solver and matrix memory (as appropriate)* - -#. *Free nonlinear solver memory (as appropriate)* - -#. *Free the SUNContext object* - -#. *Finalize MPI, if used* diff --git a/doc/arkode/guide/source/Usage/MRIStep/index.rst b/doc/arkode/guide/source/Usage/MRIStep/index.rst deleted file mode 100644 index a1d91c144b..0000000000 --- a/doc/arkode/guide/source/Usage/MRIStep/index.rst +++ /dev/null @@ -1,34 +0,0 @@ -.. ---------------------------------------------------------------- - Programmer(s): 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.MRIStep: - -========================================== -Using the MRIStep time-stepping module -========================================== - -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 - - Skeleton - User_callable - MRIStepCoupling - Custom_Inner_Stepper/index diff --git a/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Description.rst similarity index 95% rename from doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst rename to doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Description.rst index 523bd8a7be..9e17b38bc2 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Description.rst @@ -20,16 +20,17 @@ 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. +implementations of the virtual methods. The :c:type:`MRIStepInnerStepper` +type is defined in ``include/arkode/arkode.h`` as -.. c:type:: MRIStepInnerStepper +.. c:type:: struct _MRIStepInnerStepper *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 ``_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. .. _ARKODE.Usage.MRIStep.CustomInnerStepper.Description.BaseMethods: diff --git a/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Implementing.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Implementing.rst similarity index 100% rename from doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Implementing.rst rename to doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Implementing.rst diff --git a/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/index.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/index.rst similarity index 100% rename from doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/index.rst rename to doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/index.rst diff --git a/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/MRIStepCoupling.rst similarity index 72% rename from doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst rename to doc/arkode/guide/source/Usage/MRIStep_c_interface/MRIStepCoupling.rst index 88fb32a748..cb8a725b4d 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/MRIStepCoupling.rst @@ -18,61 +18,59 @@ 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`. The MRI coupling tables are stored in an -:c:func:`MRIStepCoupling` object which is a pointer to a -:c:struct:`MRIStepCouplingMem` strucutre: +: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: .. c:type:: MRIStepCouplingMem *MRIStepCoupling -.. c:struct:: MRIStepCouplingMem +where ``MRIStepCouplingMem`` is the structure - Structure for storing the coupling coefficients defining an MIS, MRI-GARK, or - IMEX-MRI-GARK method. +.. code-block:: 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)}`. + struct MRIStepCouplingMem + { + int nmat; + int stages; + int q; + int p; + sunrealtype ***G; + sunrealtype ***W; + sunrealtype *c; + }; - .. c:member:: int nmat +and the members of the strucutre are: - 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`, + * ``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`, - .. c:member:: int stages + * ``stages`` is the number of abscissae i.e., :math:`s+1` above, - The number of abscissae i.e., :math:`s+1` above + * ``q`` and ``p`` indicate the orders of accuracy for both the method and + the embedding, respectively, - .. c:member:: int q + * ``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`, - The method order of accuracy + * ``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 - .. 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 + * ``c`` is an array of length ``stages`` containing the slow abscissae + :math:`c^S` for the method. .. _ARKODE.Usage.MRIStep.MRIStepCoupling.Functions: @@ -306,46 +304,36 @@ 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_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 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:: 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_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 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:: 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` - ==================================== =========== =============== =================== + =========================== =========== =============== =================== + 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` + =========================== =========== =============== =================== diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/Skeleton.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/Skeleton.rst new file mode 100644 index 0000000000..a4a079570b --- /dev/null +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/Skeleton.rst @@ -0,0 +1,322 @@ +.. ---------------------------------------------------------------- + Programmer(s): David J. Gardner @ LLNL + Daniel R. Reynolds @ SMU + ---------------------------------------------------------------- + Based on ERKStep by 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.MRIStep.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 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. + +.. 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 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 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 + ARKStep. + + Once the ARKStep object is setup, create an ``MRIStepInnerStepper`` object + with :c:func:`ARKStepCreateMRIStepInnerStepper`. + + * If supplying a user-defined fast (inner) integrator, create the + ``MRIStepInnerStepper`` object as described in section + :numref:`ARKODE.Usage.MRIStep.CustomInnerStepper`. + + .. note:: + + When using ARKStep as a fast (inner) integrator it is the user's + responsibility to create, configure, and attach the integrator to the + MRIStep module. User-specified options regarding how this fast integration + should be performed (e.g., adaptive vs. fixed time step, + explicit/implicit/ImEx partitioning, algebraic solvers, etc.) will be + respected during evolution of the fast time scale during MRIStep + integration. + + Due to the algorithms supported in MRIStep, the ARKStep module used for + the fast time scale must be configured with an identity mass matrix. + + 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 + 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 + 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()` + for more details. + +#. Create an MRIStep object for the slow (outer) integration + + Create the MRIStep object by calling :c:func:`MRIStepCreate`. One of the + 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:`MRIStepSetFixedStep()` 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 + + ier = MRIStepSetNonlinearSolver(...); + + #. 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 MRIStep, otherwise the optional inputs will be + overridden by MRIStep defaults. See :numref:`SUNNonlinSol` for more + information on optional inputs. + + #. Create matrix object + + 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. + + For the SUNDIALS-supplied SUNMATRIX implementations, the + matrix object may be created using a call of the form + + .. code-block:: c + + SUNMatrix A = SUNBandMatrix(...); + + or similar for other matrix modules (see :numref:`SUNMatrix` for + further information). + + #. Create linear solver object + + 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. + + 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); + +#. 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 + 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*) + + 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 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/MRIStep/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst similarity index 58% rename from doc/arkode/guide/source/Usage/MRIStep/User_callable.rst rename to doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst index 95f13fb608..dbb44c425c 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst @@ -18,20 +18,21 @@ MRIStep User-callable functions ================================== -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. +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. -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 +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). @@ -110,10 +111,6 @@ MRIStep initialization and deallocation functions **Return value:** None - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeFree` instead. - .. _ARKODE.Usage.MRIStep.Tolerances: @@ -121,6 +118,40 @@ 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. @@ -136,10 +167,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSStolerances` instead. - .. c:function:: int MRIStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) @@ -160,10 +187,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSVtolerances` instead. - .. c:function:: int MRIStepWFtolerances(void* arkode_mem, ARKEwtFn efun) @@ -181,9 +204,100 @@ 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:: 6.1.0 - Use :c:func:`ARKodeWFtolerances` instead. + + +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. @@ -192,6 +306,74 @@ MRIStep tolerance specification functions 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 @@ -233,10 +415,6 @@ Linear solver interface functions insufficient to store :math:`\mathcal{A}` then it will need to be resized internally by MRIStep. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetLinearSolver` instead. - .. _ARKODE.Usage.MRIStep.NonlinearSolvers: @@ -244,6 +422,24 @@ Linear solver interface functions 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 @@ -264,10 +460,6 @@ Nonlinear solver interface functions default; a call to this routine replaces that module with the supplied *NLS* object. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetNonlinearSolver` instead. - .. _ARKODE.Usage.MRIStep.RootFinding: @@ -275,6 +467,18 @@ Nonlinear solver interface functions 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 @@ -305,10 +509,6 @@ Rootfinding initialization function Rootfinding is only supported for the slow (outer) integrator and should not be actived for the fast (inner) integrator. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeRootInit` instead. - .. _ARKODE.Usage.MRIStep.Integration: @@ -316,6 +516,13 @@ Rootfinding initialization function 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`. @@ -414,10 +621,6 @@ MRIStep solver function On all other error returns, *tret* and *yout* are left unchanged from those provided to the routine. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeEvolve` instead. - .. _ARKODE.Usage.MRIStep.OptionalInputs: @@ -425,12 +628,79 @@ MRIStep solver 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) @@ -449,23 +719,49 @@ 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:: 6.1.0 - Use :c:func:`ARKodeSetDefaults` instead. +.. 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). -.. c:function:: int MRIStepSetInterpolantType(void* arkode_mem, int itype) + **Arguments:** + + * *arkode_mem* -- pointer to the MRIStep memory block. + + * *itype* -- requested interpolant type (``ARK_INTERP_HERMITE`` or ``ARK_INTERP_LAGRANGE``) - .. deprecated:: 6.1.0 + **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 - This function is now a wrapper to :c:func:`ARKodeSetInterpolantType`, see - the documentation for that function instead. + **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. @@ -514,17 +810,14 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetInterpolantDegree` instead. - .. c:function:: int MRIStepSetDenseOrder(void* arkode_mem, int dord) - .. deprecated:: 5.2.0 + *This function is deprecated, and will be removed in a future release. + Users should transition to calling* :c:func:`MRIStepSetInterpolantDegree()` + *instead.* - Use :c:func:`ARKodeSetInterpolantDegree` instead. .. c:function:: int MRIStepSetDiagnostics(void* arkode_mem, FILE* diagfp) @@ -584,9 +877,35 @@ 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:: 6.1.0 - Use :c:func:`ARKodeSetFixedStep` instead. + +.. + .. 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*. + @@ -615,9 +934,6 @@ Optional inputs for MRIStep A negative value indicates that no warning messages should be issued. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxHnilWarns` instead. @@ -646,10 +962,51 @@ Optional inputs for MRIStep Passing *mxsteps* < 0 disables the test (not recommended). - .. deprecated:: 6.1.0 - 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) @@ -683,11 +1040,6 @@ Optional inputs for MRIStep :c:func:`MRIStepReset` will remain active but can be disabled by calling :c:func:`MRIStepClearStopTime`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetStopTime` instead. - - .. c:function:: int MRIStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) @@ -705,11 +1057,6 @@ Optional inputs for MRIStep .. versionadded:: 5.6.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetInterpolateStopTime` instead. - - .. c:function:: int MRIStepClearStopTime(void* arkode_mem) @@ -728,11 +1075,6 @@ Optional inputs for MRIStep .. versionadded:: 5.5.1 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeClearStopTime` instead. - - .. c:function:: int MRIStepSetUserData(void* arkode_mem, void* user_data) @@ -763,11 +1105,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetUserData` instead. - - .. c:function:: int MRIStepSetPreInnerFn(void* arkode_mem, MRIStepPreInnerFn prefn) @@ -787,7 +1124,6 @@ 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. @@ -805,6 +1141,28 @@ 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. @@ -845,11 +1203,6 @@ Optional inputs for IVP method selection * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetOrder` instead. - - .. c:function:: int MRIStepSetCoupling(void* arkode_mem, MRIStepCoupling C) @@ -874,10 +1227,6 @@ 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: @@ -885,6 +1234,31 @@ 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)` @@ -913,10 +1287,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetLinear` instead. - .. c:function:: int MRIStepSetNonlinear(void* arkode_mem) @@ -938,10 +1308,6 @@ Optional inputs for implicit stage solves :c:func:`MRIStepSetDeltaGammaMax()` to reset the step size ratio threshold to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetNonlinear` instead. - .. c:function:: int MRIStepSetPredictorMethod(void* arkode_mem, int method) @@ -978,10 +1344,6 @@ Optional inputs for implicit stage solves **The "bootstrap" predictor (option 4 above) has been deprecated, and will be removed from a future release.** - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetPredictorMethod` instead. - .. c:function:: int MRIStepSetMaxNonlinIters(void* arkode_mem, int maxcor) @@ -1002,10 +1364,6 @@ Optional inputs for implicit stage solves **Notes:** The default value is 3; set *maxcor* :math:`\le 0` to specify this default. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetMaxNonlinIters` instead. - .. c:function:: int MRIStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) @@ -1024,10 +1382,6 @@ Optional inputs for implicit stage solves **Notes:** The default value is 0.1; set *nlscoef* :math:`\le 0` to specify this default. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetNonlinConvCoef` instead. - .. c:function:: int MRIStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) @@ -1045,10 +1399,6 @@ Optional inputs for implicit stage solves **Notes:** Any non-positive parameter will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetNonlinCRDown` instead. - .. c:function:: int MRIStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) @@ -1068,10 +1418,6 @@ Optional inputs for implicit stage solves **Notes:** Any non-positive parameter will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetNonlinRDiv` instead. - .. c:function:: int MRIStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) @@ -1091,11 +1437,6 @@ Optional inputs for implicit stage solves **Notes:** See :numref:`ARKODE.Usage.StagePredictFn` for more information on this user-supplied routine. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetStagePredictFn` instead. - - .. c:function:: int MRIStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fs) @@ -1119,11 +1460,6 @@ Optional inputs for implicit stage solves When using a non-default nonlinear solver, this function must be called *after* :c:func:`MRIStepSetNonlinearSolver()`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetNlsRhsFn` instead. - - .. c:function:: int MRIStepSetDeduceImplicitRhs(void *arkode_mem, sunbooleantype deduce) @@ -1143,23 +1479,87 @@ Optional inputs for implicit stage solves .. versionadded:: 5.2.0 - .. deprecated:: 6.1.0 - - 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 @@ -1177,11 +1577,9 @@ Optional inputs for the ARKLS linear solver interface **Notes:** Any non-positive parameter will imply a reset to the default value. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetDeltaGammaMax` instead. - +.. index:: + single: optional input; linear solver setup frequency (MRIStep) .. c:function:: int MRIStepSetLSetupFrequency(void* arkode_mem, int msbp) @@ -1203,11 +1601,10 @@ 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:: 6.1.0 - - 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) @@ -1236,9 +1633,8 @@ 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:: 6.1.0 - Use :c:func:`ARKodeSetJacEvalFrequency` instead. + @@ -1248,6 +1644,48 @@ Optional inputs for the ARKLS linear solver interface 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 @@ -1274,11 +1712,6 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules The function type :c:func:`ARKLsJacFn()` is described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetJacFn` instead. - - .. c:function:: int MRIStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) @@ -1305,11 +1738,6 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules The function type :c:func:`ARKLsLinSysFn()` is described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetLinSysFn` instead. - - .. c:function:: int MRIStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) @@ -1330,17 +1758,47 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules **Notes:** Linear solution scaling is enabled by default when a matrix-based linear solver is attached. - .. deprecated:: 6.1.0 - - 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. @@ -1373,9 +1831,15 @@ Optional inputs for matrix-free ``SUNLinearSolver`` modules :c:type:`ARKLsJacTimesVecFn` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: 6.1.0 - 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:`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. .. c:function:: int MRIStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) @@ -1401,10 +1865,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetJacTimesRhsFn` instead. - @@ -1414,6 +1874,44 @@ Optional inputs for matrix-free ``SUNLinearSolver`` modules 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. @@ -1444,11 +1942,6 @@ Optional inputs for iterative ``SUNLinearSolver`` modules :c:func:`ARKLsPrecSolveFn()` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetPreconditioner` instead. - - .. c:function:: int MRIStepSetEpsLin(void* arkode_mem, sunrealtype eplifac) @@ -1473,11 +1966,6 @@ Optional inputs for iterative ``SUNLinearSolver`` modules interface has been initialized through a call to :c:func:`MRIStepSetLinearSolver()`. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetEpsLin` instead. - - .. c:function:: int MRIStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) @@ -1506,10 +1994,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetLSNormFactor` instead. - .. _ARKODE.Usage.MRIStep.MRIStepRootfindingInput: @@ -1517,6 +2001,22 @@ Optional inputs for iterative ``SUNLinearSolver`` modules 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. @@ -1538,10 +2038,6 @@ Rootfinding optional input functions **Notes:** The default behavior is to monitor for both zero-crossing directions. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetRootDirection` instead. - .. c:function:: int MRIStepSetNoInactiveRootWarn(void* arkode_mem) @@ -1564,10 +2060,6 @@ Rootfinding optional input functions first step), MRIStep will issue a warning which can be disabled with this optional input function. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeSetNoInactiveRootWarn` instead. - .. _ARKODE.Usage.MRIStep.InterpolatedOutput: @@ -1575,6 +2067,20 @@ Rootfinding optional input functions 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 @@ -1620,10 +2126,6 @@ Interpolated output function functions :c:func:`MRIStepGetCurrentTime()` and :c:func:`MRIStepGetLastStep()`, respectively. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetDky` instead. - .. _ARKODE.Usage.MRIStep.OptionalOutputs: @@ -1631,6 +2133,57 @@ Interpolated output function 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: @@ -1638,6 +2191,56 @@ 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. @@ -1656,11 +2259,6 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetWorkSpace` instead. - - .. c:function:: int MRIStepGetNumSteps(void* arkode_mem, long int* nssteps, long int* nfsteps) @@ -1681,10 +2279,23 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeGetNumSteps` instead. +.. + .. c:function:: int MRIStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) + + Returns the value of the integration step size used on the first step. + + **Arguments:** + + * *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) @@ -1704,10 +2315,23 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeGetLastStep` instead. +.. + .. c:function:: int MRIStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) + + 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) @@ -1726,10 +2350,6 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetCurrentTime` instead. - .. c:function:: int MRIStepGetCurrentState(void *arkode_mem, N_Vector *ycur) @@ -1751,10 +2371,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetCurrentState` instead. - .. c:function:: int MRIStepGetCurrentGamma(void *arkode_mem, sunrealtype *gamma) @@ -1773,9 +2389,6 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetCurrentGamma` instead. .. c:function:: int MRIStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac) @@ -1796,10 +2409,6 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetTolScaleFactor` instead. - .. c:function:: int MRIStepGetErrWeights(void* arkode_mem, N_Vector eweight) @@ -1820,9 +2429,29 @@ Main solver optional output functions **Notes:** The user must allocate space for *eweight*, that will be filled in by this function. - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeGetErrWeights` instead. +.. + .. 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`` .. c:function:: int MRIStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) @@ -1852,12 +2481,8 @@ Main solver optional output functions .. versionadded:: 5.2.0 - .. deprecated:: 6.1.0 - - 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`. @@ -1870,10 +2495,61 @@ Main solver optional output functions The return value is a string containing the name of the corresponding constant. - .. deprecated:: 6.1.0 - Use :c:func:`ARKodeGetReturnFlagName` instead. +.. + .. 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`` + + +.. + .. 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) @@ -1896,6 +2572,24 @@ 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) @@ -1913,10 +2607,6 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumStepSolveFails` instead. - .. c:function:: int MRIStepGetCurrentCoupling(void* arkode_mem, MRIStepCoupling *C) @@ -1955,6 +2645,65 @@ 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. @@ -1971,7 +2720,6 @@ 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 @@ -1991,17 +2739,30 @@ Main solver optional output functions .. versionadded:: 5.3.0 - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetUserData` instead. - - .. _ARKODE.Usage.MRIStep.MRIStepImplicitSolverOutputs: 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()` | + +------------------------------------------------------+----------------------------------------------+ + + + + .. c:function:: int MRIStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) Returns the number of calls made to the linear solver's @@ -2023,10 +2784,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumLinSolvSetups` instead. - .. c:function:: int MRIStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) @@ -2050,10 +2807,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumNonlinSolvIters` instead. - .. c:function:: int MRIStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nncfails) @@ -2077,10 +2830,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumNonlinSolvConvFails` instead. - .. c:function:: int MRIStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, long int* nncfails) @@ -2107,10 +2856,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNonlinSolvStats` instead. - .. _ARKODE.Usage.MRIStep.MRIStepRootOutputs: @@ -2118,6 +2863,17 @@ 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 @@ -2144,10 +2900,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetRootInfo` instead. - .. c:function:: int MRIStepGetNumGEvals(void* arkode_mem, long int* ngevals) @@ -2163,10 +2915,6 @@ Rootfinding optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumGEvals` instead. - .. _ARKODE.Usage.MRIStep.ARKLsOutputs: @@ -2174,6 +2922,48 @@ Rootfinding optional output functions 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 @@ -2191,11 +2981,6 @@ 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:: 6.1.0 - - 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 @@ -2208,11 +2993,6 @@ 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:: 6.1.0 - - 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 @@ -2226,11 +3006,6 @@ 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:: 6.1.0 - - 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. @@ -2260,10 +3035,6 @@ Linear solver interface optional output functions In a parallel setting, the above values are global (i.e., summed over all processors). - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetLinWorkSpace` instead. - .. c:function:: int MRIStepGetNumJacEvals(void* arkode_mem, long int* njevals) @@ -2287,10 +3058,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumJacEvals` instead. - .. c:function:: int MRIStepGetNumPrecEvals(void* arkode_mem, long int* npevals) @@ -2316,10 +3083,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumPrecEvals` instead. - .. c:function:: int MRIStepGetNumPrecSolves(void* arkode_mem, long int* npsolves) @@ -2344,10 +3107,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumPrecSolves` instead. - .. c:function:: int MRIStepGetNumLinIters(void* arkode_mem, long int* nliters) @@ -2371,10 +3130,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumLinIters` instead. - .. c:function:: int MRIStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails) @@ -2398,10 +3153,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumLinConvFails` instead. - .. c:function:: int MRIStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetup) @@ -2426,10 +3177,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumJTSetupEvals` instead. - .. c:function:: int MRIStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals) @@ -2454,10 +3201,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumJtimesEvals` instead. - .. c:function:: int MRIStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) @@ -2487,10 +3230,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNumLinRhsEvals` instead. - .. c:function:: int MRIStepGetLastLinFlag(void* arkode_mem, long int* lsflag) @@ -2546,12 +3285,8 @@ Linear solver interface optional output functions *SUN_ERR_EXT_FAIL*, indicating an unrecoverable failure in an external iterative linear solver package. - .. deprecated:: 6.1.0 - - 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*. @@ -2564,10 +3299,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetLinReturnFlagName` instead. - @@ -2576,6 +3307,25 @@ Linear solver interface optional output functions 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. @@ -2599,10 +3349,6 @@ General usability functions for this pointer, since parameters for all processes would be identical. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeWriteParameters` instead. - .. c:function:: int MRIStepWriteCoupling(void* arkode_mem, FILE *fp) @@ -2627,10 +3373,6 @@ General usability functions for this pointer, since tables for all processes would be identical. - .. deprecated:: 6.1.0 - - Use :c:func:`MRIStepGetCurrentCoupling` and :c:func:`MRIStepCoupling_Write` - instead. .. _ARKODE.Usage.MRIStep.Reinitialization: @@ -2725,6 +3467,47 @@ 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 @@ -2764,10 +3547,6 @@ MRIStep reset function (*tR*, *yR*) arguments for the :c:type:`MRIStepInnerStepper` object that is used to evolve the MRI "fast" time scale subproblems. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeReset` instead. - .. _ARKODE.Usage.MRIStep.Resizing: @@ -2775,6 +3554,22 @@ MRIStep reset function 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. @@ -2841,7 +3636,3 @@ MRIStep system resize function 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 - - 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 new file mode 100644 index 0000000000..d22e91746f --- /dev/null +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/index.rst @@ -0,0 +1,46 @@ +.. ---------------------------------------------------------------- + Programmer(s): 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.MRIStep: + +========================================== +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. + +.. toctree:: + :maxdepth: 1 + + Skeleton + User_callable + MRIStepCoupling + Custom_Inner_Stepper/index diff --git a/doc/arkode/guide/source/Usage/Relaxation.rst b/doc/arkode/guide/source/Usage/Relaxation.rst deleted file mode 100644 index a3b237ccbd..0000000000 --- a/doc/arkode/guide/source/Usage/Relaxation.rst +++ /dev/null @@ -1,359 +0,0 @@ -.. ----------------------------------------------------------------------------- - 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:: 6.1.0 - -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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 diff --git a/doc/arkode/guide/source/Usage/SPRKStep/index.rst b/doc/arkode/guide/source/Usage/SPRKStep/index.rst deleted file mode 100644 index ec3dbdc935..0000000000 --- a/doc/arkode/guide/source/Usage/SPRKStep/index.rst +++ /dev/null @@ -1,35 +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: - -========================================== -Using the SPRKStep time-stepping module -========================================== - -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. - -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`` - -.. toctree:: - :maxdepth: 1 - - User_callable diff --git a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/Skeleton.rst b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/Skeleton.rst new file mode 100644 index 0000000000..2cf457359c --- /dev/null +++ b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/Skeleton.rst @@ -0,0 +1,143 @@ +.. ---------------------------------------------------------------- + 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/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst similarity index 68% rename from doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst rename to doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst index d8f4dec8f9..9dc6d5f359 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst @@ -15,20 +15,22 @@ SPRKStep User-callable functions ================================== -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.). +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). + .. _ARKODE.Usage.SPRKStep.Initialization: @@ -70,16 +72,26 @@ SPRKStep initialization and deallocation functions :param arkode_mem: pointer to the SPRKStep memory block. - .. deprecated:: 6.1.0 - - 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 @@ -104,16 +116,20 @@ 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:: 6.1.0 - - 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) @@ -199,10 +215,6 @@ SPRKStep solver function On all other error returns, *tret* and *yout* are left unchanged from those provided to the routine. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeEvolve` instead. - @@ -211,12 +223,63 @@ SPRKStep solver function 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) @@ -237,17 +300,42 @@ 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:: 6.1.0 - Use :c:func:`ARKodeSetDefaults` instead. +.. 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). -.. c:function:: int SPRKStepSetInterpolantType(void* arkode_mem, int itype) + :param arkode_mem: pointer to the SPRKStep memory block. + :param itype: requested interpolant type (``ARK_INTERP_HERMITE`` or ``ARK_INTERP_LAGRANGE``) - .. deprecated:: 6.1.0 + :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. - 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) @@ -284,10 +372,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetInterpolantDegree` instead. - .. c:function:: int SPRKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) @@ -300,10 +384,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetFixedStep` instead. - .. c:function:: int SPRKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) @@ -323,10 +403,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetMaxNumSteps` instead. - .. c:function:: int SPRKStepSetStopTime(void* arkode_mem, sunrealtype tstop) @@ -350,10 +426,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetStopTime` instead. - .. c:function:: int SPRKStepClearStopTime(void* arkode_mem) @@ -367,10 +439,6 @@ Optional inputs for SPRKStep :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeClearStopTime` instead. - .. c:function:: int SPRKStepSetUserData(void* arkode_mem, void* user_data) @@ -388,10 +456,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetUserData` instead. - .. _ARKODE.Usage.SPRKStep.SPRKStepMethodInput: @@ -406,7 +470,7 @@ Optional inputs for IVP method selection +=============================+===========================================+=====================================+ | Set integrator method order | :c:func:`SPRKStepSetOrder()` | 4 | +-----------------------------+-------------------------------------------+-------------------------------------+ - | Set SPRK method | :c:func:`SPRKStepSetMethod()` | ``ARKODE_SPRK_MCLACHLAN_4_4`` | + | Set SPRK method | :c:func:`SPRKStepSetMethod()` | :c:type:`ARKODE_SPRK_MCLACHLAN_4_4` | +-----------------------------+-------------------------------------------+-------------------------------------+ | Set SPRK method by name | :c:func:`SPRKStepSetMethodName()` | "ARKODE_SPRK_MCLACHLAN_4_4" | +-----------------------------+-------------------------------------------+-------------------------------------+ @@ -437,10 +501,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetOrder` instead. - .. c:function:: int SPRKStepSetMethod(void* arkode_mem, ARKodeSPRKTable sprk_table) @@ -458,10 +518,6 @@ 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) @@ -474,10 +530,6 @@ 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) @@ -497,13 +549,29 @@ 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) @@ -524,10 +592,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeSetRootDirection` instead. - .. c:function:: int SPRKStepSetNoInactiveRootWarn(void* arkode_mem) @@ -546,16 +610,22 @@ Rootfinding optional input functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` - .. deprecated:: 6.1.0 - - 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*, @@ -596,22 +666,84 @@ Interpolated output function It is only legal to call this function after a successful return from :c:func:`SPRKStepEvolve()`. - .. deprecated:: 6.1.0 - - 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) @@ -624,10 +756,6 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumSteps` instead. - .. c:function:: int SPRKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) @@ -640,10 +768,6 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetLastStep` instead. - .. c:function:: int SPRKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) @@ -655,10 +779,6 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetCurrentStep` instead. - .. c:function:: int SPRKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) @@ -670,10 +790,6 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetCurrentTime` instead. - .. c:function:: int SPRKStepGetCurrentState(void *arkode_mem, N_Vector *ycur) @@ -691,10 +807,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetCurrentState` instead. - .. c:function:: int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) @@ -710,10 +822,6 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetStepStats` instead. - .. c:function:: int SPRKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) @@ -737,9 +845,6 @@ Main solver optional output functions read and output the data from a SUNDIALS CSV output file using the key and value pair format. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodePrintAllStats` instead. .. c:function:: char *SPRKStepGetReturnFlagName(long int flag) @@ -752,10 +857,6 @@ Main solver optional output functions :returns: The return value is a string containing the name of the corresponding constant. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetReturnFlagName` instead. - .. c:function:: int SPRKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts) @@ -767,10 +868,6 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetNumStepAttempts` instead. - .. c:function:: int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, long int* nf2) @@ -808,16 +905,26 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the ARKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - 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. @@ -840,10 +947,6 @@ Rootfinding optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeGetRootInfo` instead. - .. c:function:: int SPRKStepGetNumGEvals(void* arkode_mem, long int* ngevals) @@ -856,16 +959,28 @@ Rootfinding optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - 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. @@ -882,10 +997,6 @@ General usability functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeWriteParameters` instead. - .. _ARKODE.Usage.SPRKStep.Reinitialization: @@ -950,6 +1061,22 @@ 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 @@ -974,7 +1101,3 @@ 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:: 6.1.0 - - 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 new file mode 100644 index 0000000000..536d94391c --- /dev/null +++ b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/index.rst @@ -0,0 +1,45 @@ +.. ---------------------------------------------------------------- + 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: + +========================================== +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. + +The example programs located in the source code ``examples/arkode`` folder, may +be helpful as templates for new codes. In particular, + +* ``examples/arkode/C_serial/ark_harmonic_symplectic.c`` +* ``examples/arkode/C_serial/ark_damped_harmonic_symplectic.c``, and +* ``examples/arkode/C_serial/ark_kepler.c`` + +demonstrate ``SPRKStep`` usage. + +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/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst deleted file mode 100644 index fd9261eaa3..0000000000 --- a/doc/arkode/guide/source/Usage/User_callable.rst +++ /dev/null @@ -1,4687 +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.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.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:: 6.1.0 - - This function replaces stepper specific versions in ARKStep, ERKStep, - MRIStep, and SPRKStep. - - -.. _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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -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:: 6.1.0 - - - - - -.. _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:: 6.1.0 - - - -.. _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:: 6.1.0 - - - -.. _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:: 6.1.0 - - - -.. _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. 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 - 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:: 6.1.0 - - - -.. _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 -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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. c:function:: int ARKodeSetInterpolantType(void* arkode_mem, int itype) - - 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``, - ``ARK_INTERP_LAGRANGE``, or ``ARK_INTERP_NONE`` - - :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. - - .. 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:: 6.1.0 - - This function replaces stepper specific versions in ARKStep, ERKStep, - MRIStep, and SPRKStep. - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - - -.. 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:: 6.1.0 - - - -.. 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:: 6.1.0 - - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - - -.. _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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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 the stepper ``SetAdaptivityMethod`` functions or - :c:func:`ARKodeSetAdaptController` will be called, then this routine must be called - *second*. - - .. versionadded:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - - -.. _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`` -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`` -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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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 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 - *after* :c:func:`ARKodeSetNonlinearSolver`. - - .. versionadded:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. _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:: 6.1.0 - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - - - - - -.. _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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. _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:: 6.1.0 - - -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:: 6.1.0 - - -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:: 6.1.0 - - - -.. _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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -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:: 6.1.0 - - -.. 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:: 6.1.0 - - - -.. _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:: 6.1.0 - - -.. 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:: 6.1.0 - - - - -.. _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:: 6.1.0 - - - -.. _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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. _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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. _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:: 6.1.0 - - -.. 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:: 6.1.0 - - - -.. _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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - -.. 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:: 6.1.0 - - - - -.. _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:: 6.1.0 - - - -.. _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:: 6.1.0 - - - -.. _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:: 6.1.0 diff --git a/doc/arkode/guide/source/Usage/User_supplied.rst b/doc/arkode/guide/source/Usage/User_supplied.rst index cb27409c48..88942bff99 100644 --- a/doc/arkode/guide/source/Usage/User_supplied.rst +++ b/doc/arkode/guide/source/Usage/User_supplied.rst @@ -20,60 +20,52 @@ User-supplied functions The user-supplied functions for ARKODE consist of: -* at least one function :ref:`defining the ODE <ARKODE.Usage.ODERHS>` - (required), +* at least one function defining the ODE (required), -* a function that - :ref:`provides the error weight vector <ARKODE.Usage.ErrorWeight>` (optional), +* a function that handles error and warning messages (optional), -* a function that - :ref:`provides the residual weight vector <ARKODE.Usage.ResidualWeight>` (optional), +* a function that provides the error weight vector (optional), -* a function that - :ref:`handles explicit time step stability <ARKODE.Usage.StabilityFn>` (optional), +* a function that provides the residual weight vector (optional, ARKStep only), -* a function that - :ref:`updates the implicit stage prediction <ARKODE.Usage.StagePredictFn>` (optional), +* a function that handles adaptive time step error control (optional, ARKStep/ERKStep only), -* a function that - :ref:`defines auxiliary temporal root-finding problem(s) to solve <ARKODE.Usage.RootfindingFn>` (optional), +* a function that handles explicit time step stability (optional, ARKStep/ERKStep 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 updates the implicit stage prediction (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), +* 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), * if the problem involves a non-identity mass matrix :math:`M\ne I` with ARKStep: - * one or two functions that - :ref:`provide mass-matrix-related information <ARKODE.Usage.MassFn>` + * one or two functions that provide mass-matrix-related information for the linear and mass matrix solvers (required), - * one or two functions that - :ref:`define the mass matrix preconditioner <ARKODE.Usage.MassPrecSolveFn>` + * one or two functions that define the mass matrix preconditioner for use if an iterative mass matrix solver is chosen (optional), and -* a function that - :ref:`handles vector resizing operations <ARKODE.Usage.VecResizeFn>`, if the +* a function that handles vector resizing operations, if the underlying vector structure supports resizing (as opposed to deletion/recreation), and if the user plans to call - :c:func:`ARKodeResize` (optional). + :c:func:`ARKStepResize`, :c:func:`ERKStepResize`, or + :c:func:`MRIStepResize` (optional). -* 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 +* MRIStep only: functions to be called before and after each inner integration 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 - :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). +* 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). .. _ARKODE.Usage.ODERHS: @@ -82,26 +74,31 @@ ODE right-hand side ----------------------------- The user must supply at least one function of type :c:type:`ARKRhsFn` to -specify the IVP-defininig right-hand side function(s) when creating the -ARKODE time-stepping module: +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: + .. 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`. - :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`. + **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`. - :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). + **Return value:** - .. note:: + 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:** Allocation of memory for `ydot` is handled within ARKODE. @@ -113,17 +110,18 @@ ARKODE time-stepping module: "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 ARKodeEvolve) + nonlinear iteration, or reducing the step size in ARKStep or ERKStep) 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 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. + 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. @@ -146,16 +144,18 @@ in :numref:`ARKODE.Mathematics.Error.Norm`. This function computes the WRMS error weights for the vector :math:`y`. - :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. + **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 - .. note:: + **Return value:** + An *ARKEwtFn* function must return 0 if it + successfully set the error weights, and -1 otherwise. + **Notes:** Allocation of memory for *ewt* is handled within ARKODE. The error weight vector must have all components positive. It is @@ -166,14 +166,8 @@ in :numref:`ARKODE.Mathematics.Error.Norm`. .. _ARKODE.Usage.ResidualWeight: -Residual weight function ------------------------- - -.. warning:: - - The functions in this section are specific to time-stepping modules - that support non-identity mass matrices. - +Residual weight function (ARKStep only) +---------------------------------------- As an alternative to providing the scalar or vector absolute residual tolerances (when the IVP units differ from the solution units), the @@ -190,18 +184,19 @@ in :numref:`ARKODE.Mathematics.Error.Norm`. This function computes the WRMS residual weights for the vector :math:`y`. - :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. + **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()`. - .. note:: + **Return value:** + An *ARKRwtFn* function must return 0 if it + successfully set the residual weights, and -1 otherwise. - Allocation of memory for *rwt* is handled within ARKODE. + **Notes:** + Allocation of memory for *rwt* is handled within ARKStep. The residual weight vector must have all components positive. It is the user's responsibility to perform this test and return -1 if it @@ -211,15 +206,9 @@ in :numref:`ARKODE.Mathematics.Error.Norm`. .. _ARKODE.Usage.AdaptivityFn: -Time step adaptivity function +Time step adaptivity function (ARKStep and ERKStep only) -------------------------------------------------------- -.. 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 @@ -233,48 +222,41 @@ 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. - :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`. + **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`. - :return: An *ARKAdaptFn* function should return 0 if it - successfully set the next step size, and a non-zero value otherwise. + **Return value:** + 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 ---------------------------- - -.. warning:: - - The functions in this section are specific to time-stepping modules - that support temporal adaptivity. - +Explicit stability function (ARKStep and ERKStep only) +------------------------------------------------------ A user may supply a function to predict the maximum stable step size -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` +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` 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 @@ -288,19 +270,21 @@ step, and the accuracy-based time step. This function predicts the maximum stable step size for the explicit portion of the ODE system. - :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:: - + **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:** 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. @@ -310,19 +294,19 @@ step, and the accuracy-based time step. .. _ARKODE.Usage.StagePredictFn: -Implicit stage prediction function ----------------------------------- +Implicit stage prediction function (ARKStep and MRIStep only) +------------------------------------------------------------- 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 ARKODE predictor +If supplied, this routine will be called *after* any existing ARKStep or MRIStep 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:`ARKodeSetPredictorMethod`, thereby leaving -the default trivial predictor in place. +recommended that the user *not* call :c:func:`ARKStepSetPredictorMethod` or +:c:func:`MRIStepSetPredictorMethod`, thereby leaving the default trivial predictor in place. @@ -330,25 +314,27 @@ the default trivial predictor in place. This function updates the prediction for the implicit stage solution. - :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:: - + **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:** 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:`ARKodeSetPredictorMethod`. If both are selected, then ARKODE will + routine :c:func:`ARKStepSetPredictorMethod()`. If both are selected, then ARKStep will override its built-in implicit predictor routine to instead use option 0 (trivial predictor). @@ -368,60 +354,65 @@ 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. - :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*). + **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 - .. note:: + **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*). + **Notes:** Allocation of memory for *gout* is handled within ARKODE. .. _ARKODE.Usage.JacobianFn: -Jacobian construction ---------------------- +Jacobian construction (matrix-based linear solvers, ARKStep and MRIStep only) +----------------------------------------------------------------------------- If a matrix-based linear solver module is used (i.e., a non-NULL ``SUNMatrix`` -object was supplied to :c:func:`ARKodeSetLinearSolver`, the user may provide a -function of type :c:type:`ARKLsJacFn` to provide the Jacobian approximation or +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 :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). - :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:: - + **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:** Information regarding the specific ``SUNMatrix`` structure (e.g.~number of rows, upper/lower bandwidth, sparsity type) may be obtained through using the @@ -448,8 +439,9 @@ function of type :c:type:`ARKLsJacFn` to provide the Jacobian approximation 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 ``ARKSodeGet*`` functions listed in - :numref:`ARKODE.Usage.OptionalOutputs`. The unit roundoff can be + 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``. @@ -486,47 +478,51 @@ function of type :c:type:`ARKLsJacFn` to provide the Jacobian approximation or This function computes the linear system matrix :math:`\mathcal{A}(t,y) = M(t) - \gamma J(t,y)` (or an approximation to it). - :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*). + **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*). .. _ARKODE.Usage.JTimesFn: -Jacobian-vector product ------------------------ +Jacobian-vector product (matrix-free linear solvers, ARKStep and MRIStep only) +------------------------------------------------------------------------------ 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:`ARKodeSetLinearSolver`, the user may provide a function +:c:func:`ARKStepSetLinearSolver` or :c:func:`MRIStepSetLinearSolver`, +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. @@ -537,40 +533,43 @@ 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). - :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:: - + **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:** 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 ``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``. + 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``. .. _ARKODE.Usage.JTSetupFn: -Jacobian-vector product setup ------------------------------ +Jacobian-vector product setup (matrix-free linear solvers, ARKStep and MRIStep only) +------------------------------------------------------------------------------------ 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 @@ -583,19 +582,21 @@ defined as follows: This function preprocesses and/or evaluates any Jacobian-related data needed by the Jacobian-times-vector routine. - :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:: - + **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:** 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 @@ -607,18 +608,20 @@ 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 ``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``. + 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``. .. _ARKODE.Usage.PrecSolveFn: -Preconditioner solve --------------------- +Preconditioner solve (iterative linear solvers, ARKStep and MRIStep only) +------------------------------------------------------------------------- If a user-supplied preconditioner is to be used with a SUNLinSol solver module, then the user must provide a function of type @@ -636,41 +639,44 @@ preconditioner matrices should approximate :math:`\mathcal{A}`. This function solves the preconditioner system :math:`Pz=r`. - :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). + **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). .. _ARKODE.Usage.PrecSetupFn: -Preconditioner setup --------------------- +Preconditioner setup (iterative linear solvers, ARKStep and MRIStep only) +------------------------------------------------------------------------- -If the user's preconditioner routine above requires that any data be +If the user's preconditioner routine requires that any data be preprocessed or evaluated, then these actions need to occur within a user-supplied function of type :c:type:`ARKLsPrecSetupFn`. @@ -680,33 +686,35 @@ user-supplied function of type :c:type:`ARKLsPrecSetupFn`. This function preprocesses and/or evaluates Jacobian-related data needed by the preconditioner. - :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:: - + **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:** 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) - @@ -731,8 +739,9 @@ 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 ``ARKodeGet*`` functions listed in - :numref:`ARKODE.Usage.OptionalOutputs`. The unit roundoff can be + ``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``. @@ -740,12 +749,11 @@ user-supplied function of type :c:type:`ARKLsPrecSetupFn`. .. _ARKODE.Usage.MassFn: -Mass matrix construction ------------------------- +Mass matrix construction (matrix-based linear solvers, ARKStep only) +-------------------------------------------------------------------- -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 +If a matrix-based mass-matrix linear solver is used (i.e., a non-NULL +SUNMATRIX was supplied to :c:func:`ARKStepSetMassLinearSolver`, the user must provide a function of type :c:type:`ARKLsMassFn` to provide the mass matrix approximation. @@ -755,22 +763,23 @@ the mass matrix approximation. This function computes the mass matrix :math:`M(t)` (or an approximation to it). - :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:: - + **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:** 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 @@ -809,14 +818,13 @@ the mass matrix approximation. .. _ARKODE.Usage.MTimesFn: -Mass matrix-vector product --------------------------- +Mass matrix-vector product (matrix-free linear solvers, ARKStep only) +--------------------------------------------------------------------- -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 +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 function of type :c:type:`ARKLsMassTimesVecFn` in the following form, to compute matrix-vector products :math:`M(t)\, v`. @@ -826,27 +834,28 @@ compute matrix-vector products :math:`M(t)\, v`. This function computes the product :math:`M(t)\, v` (or an approximation to it). - :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`. + **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()`. - :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. + **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. .. _ARKODE.Usage.MTSetupFn: -Mass matrix-vector product setup --------------------------------- +Mass matrix-vector product setup (matrix-free linear solvers, ARKStep only) +--------------------------------------------------------------------------- -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 +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: @@ -857,24 +866,25 @@ 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. - :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`. + **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()`. - :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. + **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. .. _ARKODE.Usage.MassPrecSolveFn: -Mass matrix preconditioner solve --------------------------------- +Mass matrix preconditioner solve (iterative linear solvers, ARKStep only) +------------------------------------------------------------------------- -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 +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 @@ -888,38 +898,39 @@ approximate :math:`M(t)`. This function solves the preconditioner system :math:`Pz=r`. - :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). + **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). .. _ARKODE.Usage.MassPrecSetupFn: -Mass matrix preconditioner setup --------------------------------- +Mass matrix preconditioner setup (iterative linear solvers, ARKStep only) +------------------------------------------------------------------------- -For problems involving a non-identity mass matrix and an iterative linear -solver, if the user's mass matrix preconditioner above requires that any +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`. @@ -931,18 +942,19 @@ occur within a user-supplied function of type This function preprocesses and/or evaluates mass-matrix-related data needed by the preconditioner. - :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`. + **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()`. - :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:: + **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). + **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 @@ -964,7 +976,8 @@ 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:`ARKodeResize` +integration steps, through calls to the :c:func:`ARKStepResize`, +:c:func:`ERKStepResize`, or :c:func:`MRIStepResize` 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 @@ -972,7 +985,8 @@ 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:`ARKodeResize` so that all +this function may be supplied to :c:func:`ARKStepResize`, +:c:func:`ERKStepResize`, or :c:func:`MRIStepResize`, 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: @@ -983,16 +997,18 @@ following form: This function resizes the vector *y* to match the dimensions of the supplied vector, *ytemplate*. - :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. + **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`. - .. note:: + **Return value:** + An *ARKVecResizeFn* function should return 0 if it successfully + resizes the vector *y*, and a non-zero value otherwise. + **Notes:** If this function is not supplied, then ARKODE will instead destroy the vector *y* and clone a new vector *y* off of *ytemplate*. @@ -1013,19 +1029,20 @@ integrator for the inner integration. .. c:type:: int (*MRIStepPreInnerFn)(sunrealtype t, N_Vector* f, int num_vecs, void* user_data) - :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. + **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()`. - .. note:: + **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. + **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. @@ -1043,18 +1060,19 @@ outer integrator for the outer integration. .. c:type:: int (*MRIStepPostInnerFn)(sunrealtype t, N_Vector y, void* user_data) - :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`. + **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`. - :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:: + **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. + **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. @@ -1069,15 +1087,17 @@ Relaxation function When applying relaxation, an :c:func:`ARKRelaxFn` function is required to compute the conservative or dissipative function :math:`\xi(y)`. - :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`. + **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`. - :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. + **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. .. _ARKODE.Usage.RelaxJacFn: @@ -1090,12 +1110,14 @@ Relaxation Jacobian function compute the Jacobian :math:`\xi'(y)` of the :c:func:`ARKRelaxFn` :math:`\xi(y)`. - :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. + **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. diff --git a/doc/arkode/guide/source/Usage/index.rst b/doc/arkode/guide/source/Usage/index.rst index 93b63d84b8..fba04368cd 100644 --- a/doc/arkode/guide/source/Usage/index.rst +++ b/doc/arkode/guide/source/Usage/index.rst @@ -16,66 +16,23 @@ Using ARKODE ************ -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>`, +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>`, :ref:`ERKStep <ARKODE.Usage.ERKStep>`, :ref:`SPRKStep <ARKODE.Usage.SPRKStep>` -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. - +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. .. toctree:: :maxdepth: 1 - General - Skeleton - User_callable - User_supplied - Relaxation - Preconditioners - ARKStep/index.rst - ERKStep/index.rst - SPRKStep/index.rst - MRIStep/index.rst + General.rst + 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/conf.py b/doc/arkode/guide/source/conf.py index a0817d416f..db90126fc6 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/sundials_vars.py'))) -from sundials_vars import * +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'))) # -- General configuration ---------------------------------------------------- diff --git a/doc/arkode/guide/source/index.rst b/doc/arkode/guide/source/index.rst index e809010fd0..809a408329 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 92046f510c..5607ca9084 100644 --- a/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst +++ b/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst @@ -74,128 +74,8 @@ access to the internal integrator data required to evaluate :eq:`ARKODE_Residual_corrector` or :eq:`ARKODE_FixedPt_corrector`. -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) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +ARKStep advanced output functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Two notable functions were already listed in :numref:`ARKODE.Usage.ARKStep.ARKStepMainOutputs`: @@ -226,10 +106,6 @@ of user-supplied SUNNonlinSol modules are as follows. * ``ARK_SUCCESS`` if successful. * ``ARK_MEM_NULL`` if the ARKStep memory was ``NULL``. - .. deprecated:: 6.1.0 - - 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) @@ -290,10 +166,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNonlinearSystemData` instead. - .. c:function:: int ARKStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) @@ -310,13 +182,10 @@ of user-supplied SUNNonlinSol modules are as follows. * ``ARK_SUCCESS`` if successful. * ``ARK_MEM_NULL`` if the ARKStep memory was ``NULL``. - .. deprecated:: 6.1.0 - - Use :c:func:`ARKodeComputeState` instead. -MRIStep advanced output functions (deprecated) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +MRIStep advanced output functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Two notable functions were already listed in :numref:`ARKODE.Usage.MRIStep.MRIStepMainOutputs`: @@ -393,10 +262,6 @@ 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:: 6.1.0 - - Use :c:func:`ARKodeGetNonlinearSystemData` instead. - .. c:function:: int MRIStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) @@ -412,7 +277,3 @@ of user-supplied SUNNonlinSol modules are as follows. **Return value:** * ``ARK_SUCCESS`` if successful. * ``ARK_MEM_NULL`` if the MRIStep memory was ``NULL``. - - .. 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 651efba809..c0025d1f07 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 X.Y.Z ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/cvode/guide/source/Usage/index.rst b/doc/cvode/guide/source/Usage/index.rst index 722e20533e..2384ad9b31 100644 --- a/doc/cvode/guide/source/Usage/index.rst +++ b/doc/cvode/guide/source/Usage/index.rst @@ -578,9 +578,7 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated functions ``CVDlsSetLinearSolver`` and ``CVSpilsSetLinearSolver``. + 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. .. c:function:: int CVDiag(void* cvode_mem) @@ -1372,9 +1370,7 @@ through :c:func:`CVodeSetUserData`. The function type :c:type:`CVLsJacFn` is described in :numref:`CVODE.Usage.CC.user_fct_sim.jacFn`. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVDlsSetJacFn``. + 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. To specify a user-supplied linear system function ``linsys``, CVLS provides @@ -1479,9 +1475,7 @@ 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`. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsSetJacTimes``. + 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. When using the internal difference quotient the user may optionally supply an @@ -1564,9 +1558,7 @@ the :c:func:`CVodeSetEpsLin` function. The function type :c:type:`CVLsPrecSetupFn` is described in :numref:`CVODE.Usage.CC.user_fct_sim.precondFn` - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsSetPreconditioner``. + 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. .. c:function:: int CVodeSetEpsLin(void* cvode_mem, sunrealtype eplifac) @@ -1590,9 +1582,7 @@ the :c:func:`CVodeSetEpsLin` function. If ``eplifac`` = 0.0 is passed, the default value is used. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsSetEpsLin``. + 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. .. c:function:: int CVodeSetLSNormFactor(void* cvode_mem, sunrealtype nrmfac) @@ -2917,10 +2907,7 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated functions ``CVDlsGetWorkspace`` and - ``CVSpilsGetWorkspace``. + 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. .. c:function:: int CVodeGetNumJacEvals(void* cvode_mem, long int *njevals) @@ -2936,9 +2923,8 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVDlsGetNumJacEvals``. + **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. .. c:function:: int CVodeGetNumLinRhsEvals(void* cvode_mem, long int *nfevalsLS) @@ -2957,10 +2943,7 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated functions ``CVDlsGetNumRhsEvals`` and - ``CVSpilsGetNumRhsEvals``. + 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. .. c:function:: int CVodeGetNumLinIters(void* cvode_mem, long int *nliters) @@ -2976,9 +2959,8 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsGetNumLinIters``. + **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. .. c:function:: int CVodeGetNumLinConvFails(void* cvode_mem, long int *nlcfails) @@ -2994,9 +2976,8 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsGetNumConvFails``. + **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. .. c:function:: int CVodeGetNumPrecEvals(void* cvode_mem, long int *npevals) @@ -3012,9 +2993,8 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsGetNumPrecEvals``. + **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. .. c:function:: int CVodeGetNumPrecSolves(void* cvode_mem, long int *npsolves) @@ -3100,10 +3080,7 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated functions ``CVDlsGetLastFlag`` and - ``CVSpilsGetLastFlag``. + 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. .. c:function:: int CVodeGetLinReturnFlagName(long int lsflag) @@ -3116,10 +3093,8 @@ 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". - .. versionadded:: 4.0.0 - - Replaces the deprecated functions ``CVDlsGetReturnFlagName`` and - ``CVSpilsGetReturnFlagName``. + **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. .. _CVODE.Usage.CC.optional_output.optout_diag: @@ -3576,9 +3551,10 @@ side function (or an approximation of it). ``CVLsJacFn`` is defined as follows: SUNMATRIX_SPARSE type and accessor macros are documented in :numref:`SUNMatrix.Sparse`. - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVDlsJacFn``. + 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. .. _CVODE.Usage.CC.user_fct_sim.linsysFn: @@ -3650,9 +3626,10 @@ 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``. - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVSpilsJacTimesVecFn``. + 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. .. _CVODE.Usage.CC.user_fct_sim.jtsetupFn: @@ -3694,9 +3671,11 @@ 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``. - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVSpilsJacTimesSetupFn``. + 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. .. _CVODE.Usage.CC.user_fct_sim.psolveFn: @@ -3734,9 +3713,11 @@ 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). - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVSpilsPrecSolveFn``. + **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. .. _CVODE.Usage.CC.user_fct_sim.precondFn: @@ -3793,9 +3774,10 @@ 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``. - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVSpilsPrecSetupFn``. + 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. .. _CVODE.Usage.CC.precond: diff --git a/doc/cvode/guide/source/conf.py b/doc/cvode/guide/source/conf.py index 3d86ad65cb..403ce410fd 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/sundials_vars.py'))) -from sundials_vars import * +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'))) # -- General configuration ---------------------------------------------------- diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index fbf0685067..55ea22f2cd 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 X.Y.Z ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/cvodes/guide/source/Usage/ADJ.rst b/doc/cvodes/guide/source/Usage/ADJ.rst index fde6cd2261..038019c16f 100644 --- a/doc/cvodes/guide/source/Usage/ADJ.rst +++ b/doc/cvodes/guide/source/Usage/ADJ.rst @@ -644,12 +644,11 @@ 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`). - - .. versionadded:: 4.0.0 - - Replaces the deprecated functions ``CVDlsSetLinearSolverB`` and - ``CVSpilsSetLinearSolverB``. + :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. .. c:function:: int CVDiagB(void * cvode_mem, int which) @@ -906,9 +905,8 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVDlsSetJacFnB``. + **Notes:** + The previous routine :c:type:`CVDlsSetJacFnB` is now deprecated. .. c:function:: int CVodeSetJacFnBS(void * cvode_mem, int which, CVLsJacFnBS jacBS) @@ -929,9 +927,8 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVDlsSetJacFnBS``. + **Notes:** + The previous routine :c:type:`CVDlsSetJacFnBS` is now deprecated. .. c:function:: int CVodeSetLinSysFnB(void * cvode_mem, int which, CVLsLinSysFnB linsysB) @@ -1015,9 +1012,8 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsSetJacTimesB``. + **Notes:** + The previous routine ``CVSpilsSetJacTimesB`` is now deprecated. .. c:function:: int CVodeSetJacTimesBS(void * cvode_mem, int which, CVLsJacTimesVecFnBS jtvBS) @@ -1039,9 +1035,8 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsSetJacTimesBS``. + **Notes:** + The previous routine ``CVSpilsSetJacTimesBS`` is now deprecated. When using the internal difference quotient the user may optionally supply an @@ -1101,11 +1096,7 @@ 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. - - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsSetPrecSolveFnB``. + The ``psetupB`` argument may be ``NULL`` if no setup operation is involved in the preconditioner. The previous routine :c:type:`CVSpilsSetPrecSolveFnB` is now deprecated. .. c:function:: int CVodeSetPreconditionerBS(void * cvode_mem, int which, CVLsPrecSetupFnBS psetupBS, CVLsPrecSolveFnBS psolveBS) @@ -1129,11 +1120,8 @@ potentially non-differentiable factor. **Notes:** The ``psetupBS`` argument may be ``NULL`` if no setup operation is - involved in the preconditioner. - - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsSetPrecSolveFnBS``. + involved in the preconditioner. The previous routine + :c:type:`CVSpilsSetPrecSolveFnBS` is now deprecated. .. c:function:: int CVodeSetEpsLinB(void * cvode_mem, int which, sunrealtype eplifacB) @@ -1158,11 +1146,8 @@ potentially non-differentiable factor. **Notes:** The default value is :math:`0.05`. Passing a value ``eplifacB = 0.0`` - also indicates using the default value. - - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsSetEpsLinB``. + also indicates using the default value. The previous routine + ``CVSpilsSetEpsLinB`` is now deprecated. .. c:function:: int CVodeSetLSNormFactorB(void * cvode_mem, int which, sunrealtype nrmfac) @@ -1247,9 +1232,7 @@ 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 :c:struct:`CVadjCheckPointRec`. The user must - allocate space for the array ``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``. **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block created by :c:func:`CVodeCreate`. @@ -1258,37 +1241,16 @@ any case, it must be within the last checkpoint interval used by **Return value:** * ``void`` - 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 - - The step counter at ``t0`` - - .. c:member:: int order - - The method order at ``t0`` - - .. c:member:: sunrealtype step + **Notes:** + The members of each record ``ckpnt[i]`` are: - The step size at ``t0`` + * ``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`` Backward integration of quadrature equations @@ -1480,7 +1442,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. **Return value:** A :c:type:`CVRhsFnB` should return 0 if successful, a positive value if a recoverable @@ -1530,7 +1492,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to user data, same as passed to :c:func:`CVodeSetUserDataB`. **Return value:** A :c:type:`CVRhsFnBS` should return 0 if successful, a positive value if a @@ -1579,7 +1541,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to user data, same as passed to :c:func:`CVodeSetUserDataB`. **Return value:** A :c:type:`CVQuadRhsFnB` should return 0 if successful, a positive value @@ -1629,7 +1591,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to user data, same as passed to :c:func:`CVodeSetUserDataB`. **Return value:** A :c:type:`CVQuadRhsFnBS` should return 0 if successful, a positive value if a recoverable @@ -1681,7 +1643,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`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:** @@ -1707,17 +1669,16 @@ 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``). - - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVDlsJacFnB``. + 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. .. 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) @@ -1733,7 +1694,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`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:** @@ -1765,11 +1726,12 @@ 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``). - - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVDlsJacFnBS``. + 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. @@ -1798,7 +1760,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`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:** @@ -1841,7 +1803,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`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:** @@ -1894,7 +1856,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`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:** @@ -1911,11 +1873,8 @@ 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`. - - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVSpilsJacTimesVecFnB``. + :math:`-({\partial f}/{\partial y_i})^T v_B`. The previous function type + :c:type:`CVSpilsJacTimesVecFnB` is deprecated. .. 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); @@ -1932,7 +1891,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`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:** @@ -1947,11 +1906,8 @@ 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`. - - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVSpilsJacTimesVecFnBS``. + :c:type:`CVLsJacTimesVecFn`. The previous function type + :c:type:`CVSpilsJacTimesVecFnBS` is deprecated. .. _CVODES.Usage.ADJ.user_supplied.jactimesvecsetup_b: @@ -1974,7 +1930,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to user data :c:func:`CVodeSetUserDataB`. **Return value:** The value returned by the Jacobian-vector setup function @@ -1994,11 +1950,12 @@ 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``. - - .. versionadded:: 4.0.0 - - Replaces the deprecated function type ``CVSpilsJacTimesSetupFnB``. + ``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. .. c:type:: int (*CVLsJacTimesSetupFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, void *user_dataB) @@ -2013,7 +1970,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to the same user data provided to :c:func:`CVodeSetUserDataB`. **Return value:** The value returned by the Jacobian-vector setup function @@ -2033,11 +1990,12 @@ 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``. - - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVSpilsJacTimesSetupFnBS``. + ``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. .. _CVODES.Usage.ADJ.user_supplied.psolve_b: @@ -2068,7 +2026,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. **Return value:** The return value of a preconditioner solve function for the backward @@ -2076,9 +2034,8 @@ following two types: which case the step will be retried), or negative for an unrecoverable error (in which case the integration is halted). - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVSpilsPrecSolveFnB``. + **Notes:** + The previous function type :c:type:`CVSpilsPrecSolveFnB` is deprecated. .. 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) @@ -2095,7 +2052,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. **Return value:** The return value of a preconditioner solve function for the backward @@ -2104,9 +2061,8 @@ following two types: negative for an unrecoverable error (in which case the integration is halted). - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVSpilsPrecSolveFnBS``. + **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. .. _CVODES.Usage.ADJ.user_supplied.psetup_b: @@ -2131,7 +2087,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. **Return value:** The return value of a preconditioner setup function for the backward @@ -2139,9 +2095,12 @@ 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). - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVSpilsPrecSetupFnB``. + **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. .. 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) @@ -2159,7 +2118,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. **Return value:** The return value of a preconditioner setup function for the backward @@ -2167,9 +2126,8 @@ 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). - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVSpilsPrecSetupFnBS``. + **Notes:** + The previous function type :c:type:`CVSpilsPrecSetupFnBS` is deprecated. Using CVODES preconditioner modules for the backward problem @@ -2214,7 +2172,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:`CVBandPrecInitB` was successful. + * ``CVLS_SUCCESS`` -- The call to :c:func:`CVodeBandPrecInitB` 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. @@ -2265,7 +2223,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:`CVBBDPrecInitB` was successful. + * ``CVLS_SUCCESS`` -- The call to :c:func:`CVodeBBDPrecInitB` 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. @@ -2285,10 +2243,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:`CVBBDPrecReInitB` was successful. + * ``CVLS_SUCCESS`` -- The call to :c:func:`CVodeBBDPrecReInitB` 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:`CVBBDPrecInitB` has not been previously called. + * ``CVLS_PMEM_NULL`` -- The :c:func:`CVodeBBDPrecInitB` has not been previously called. * ``CVLS_LMEM_NULL`` -- No linear solver has been attached. * ``CVLS_ILL_INPUT`` -- An invalid parameter has been passed. @@ -2320,7 +2278,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. **Return value:** An :c:type:`CVBBDLocalFnB` should return 0 if successful, a positive value @@ -2354,7 +2312,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 ``CVodeSetUserDataB``. + * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`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 bec66d6d76..5a9e74a97c 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:`CVodeGetSensDky1` succeeded. + * ``CV_SUCCESS`` -- :c:func:`CVodeGetQuadDky1` 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:`CVodeGetQuadSensDky1` succeeded. + * ``CV_SUCCESS`` -- :c:func:`CVodeGetQuadDky1` 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 18dce59206..449bb24857 100644 --- a/doc/cvodes/guide/source/Usage/SIM.rst +++ b/doc/cvodes/guide/source/Usage/SIM.rst @@ -581,9 +581,7 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated functions ``CVDlsSetLinearSolver`` and ``CVSpilsSetLinearSolver``. + 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. .. c:function:: int CVDiag(void* cvode_mem) @@ -1369,9 +1367,7 @@ through :c:func:`CVodeSetUserData`. The function type :c:type:`CVLsJacFn` is described in :numref:`CVODES.Usage.SIM.user_supplied.jacFn`. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVDlsSetJacFn``. + 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. To specify a user-supplied linear system function ``linsys``, CVLS provides @@ -1476,9 +1472,7 @@ 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`. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsSetJacTimes``. + 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. When using the internal difference quotient the user may optionally supply an @@ -1561,9 +1555,7 @@ the :c:func:`CVodeSetEpsLin` function. The function type :c:type:`CVLsPrecSetupFn` is described in :numref:`CVODES.Usage.SIM.user_supplied.precondFn`. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsSetPreconditioner``. + 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. .. c:function:: int CVodeSetEpsLin(void* cvode_mem, sunrealtype eplifac) @@ -1587,9 +1579,7 @@ the :c:func:`CVodeSetEpsLin` function. If ``eplifac`` = 0.0 is passed, the default value is used. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsSetEpsLin``. + 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. .. c:function:: int CVodeSetLSNormFactor(void* cvode_mem, sunrealtype nrmfac) @@ -2912,9 +2902,7 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated functions ``CVDlsGetWorkspace`` and ``CVSpilsGetWorkspace``. + 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. .. c:function:: int CVodeGetNumJacEvals(void* cvode_mem, long int *njevals) @@ -2930,9 +2918,8 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVDlsGetNumJacEvals``. + **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. .. c:function:: int CVodeGetNumLinRhsEvals(void* cvode_mem, long int *nfevalsLS) @@ -2951,9 +2938,7 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated functions ``CVDlsGetNumRhsEvals`` and ``CVSpilsGetNumRhsEvals``. + 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. .. c:function:: int CVodeGetNumLinIters(void* cvode_mem, long int *nliters) @@ -2969,9 +2954,8 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsGetNumLinIters``. + **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. .. c:function:: int CVodeGetNumLinConvFails(void* cvode_mem, long int *nlcfails) @@ -2987,9 +2971,8 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsGetNumConvFails``. + **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. .. c:function:: int CVodeGetNumPrecEvals(void* cvode_mem, long int *npevals) @@ -3005,9 +2988,8 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``CVSpilsGetNumPrecEvals``. + **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. .. c:function:: int CVodeGetNumPrecSolves(void* cvode_mem, long int *npsolves) @@ -3093,9 +3075,7 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated functions ``CVDlsGetLastFlag`` and ``CVSpilsGetLastFlag``. + 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. .. c:function:: int CVodeGetLinReturnFlagName(long int lsflag) @@ -3108,9 +3088,8 @@ 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". - .. versionadded:: 4.0.0 - - Replaces the deprecated functions ``CVDlsGetReturnFlagName`` and ``CVSpilsGetReturnFlagName``. + **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. .. _CVODES.Usage.SIM.optional_output.optout_diag: @@ -3575,9 +3554,10 @@ side function (or an approximation of it). ``CVLsJacFn`` is defined as follows: SUNMATRIX_SPARSE type and accessor macros are documented in :numref:`SUNMatrix.Sparse`. - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVDlsJacFn``. + 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. .. _CVODES.Usage.SIM.user_supplied.linsysFn: @@ -3649,9 +3629,10 @@ 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``. - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVSpilsJacTimesVecFn``. + 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. .. _CVODES.Usage.SIM.user_supplied.jtsetupFn: @@ -3693,9 +3674,11 @@ 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``. - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVSpilsJacTimesSetupFn``. + 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. .. _CVODES.Usage.SIM.user_supplied.psolveFn: @@ -3733,9 +3716,11 @@ 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). - .. versionadded:: 4.0.0 - - Replaces the deprecated type ``CVSpilsPrecSolveFn``. + **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. .. _CVODES.Usage.SIM.user_supplied.precondFn: @@ -3792,9 +3777,10 @@ 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``. - .. versionadded:: 4.0.0 - - Replaces the deprecated function type ``CVSpilsPrecSetupFn``. + 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. .. _CVODES.Usage.purequad: diff --git a/doc/cvodes/guide/source/conf.py b/doc/cvodes/guide/source/conf.py index a8a21e28a1..6ed2b1895e 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/sundials_vars.py'))) -from sundials_vars import * +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'))) # -- General configuration ---------------------------------------------------- diff --git a/doc/developers b/doc/developers deleted file mode 120000 index 9b2ae4b9e1..0000000000 --- a/doc/developers +++ /dev/null @@ -1 +0,0 @@ -superbuild/source/developers \ No newline at end of file diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 029b9a3523..19dfc9a9d3 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 X.Y.Z ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/ida/guide/source/Usage/index.rst b/doc/ida/guide/source/Usage/index.rst index 2402ae83eb..02bf3732d1 100644 --- a/doc/ida/guide/source/Usage/index.rst +++ b/doc/ida/guide/source/Usage/index.rst @@ -588,9 +588,13 @@ pertinent to their choice of linear solver. the documentation of the particular ``SUNMatrix`` in Chapter :numref:`SUNMatrix` for further information). - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsSetLinearSolver``. + 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. .. _IDA.Usage.CC.nonlin_solv_init: @@ -1255,9 +1259,12 @@ 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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``IDADlsSetJacFn``. + 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. When using a matrix-based linear solver the matrix information will be updated @@ -1362,9 +1369,12 @@ without using global data in the program. solver interface has been initialized through a call to :c:func:`IDASetLinearSolver`. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsSetJacTimes``. + 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. When using the default difference-quotient approximation to the Jacobian-vector @@ -1402,9 +1412,12 @@ finite-difference approximation, via a call to :c:func:`IDASetIncrementFactor`. linear solver interface has been initialized through a call to :c:func:`IDASetLinearSolver`. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsSetIncrementFactor``. + 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. Additionally, when using the internal difference quotient, the user may also @@ -1484,9 +1497,12 @@ 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`. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsSetPreconditioner``. + 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. Also, as described in :numref:`IDA.Mathematics.ivp_sol`, the IDALS interface @@ -1522,9 +1538,12 @@ 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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsSetEpsLin``. + 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. .. c:function:: int IDASetLSNormFactor(void * ida_mem, sunrealtype nrmfac) @@ -2801,10 +2820,13 @@ 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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated functions ``IDADlsGetWorkspace`` and - ``IDASpilsGetWorkspace``. + 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. .. c:function:: int IDAGetNumJacEvals(void * ida_mem, long int * njevals) @@ -2820,9 +2842,12 @@ 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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``IDADlsGetNumJacEvals``. + 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. .. c:function:: int IDAGetNumLinResEvals(void * ida_mem, long int * nrevalsLS) @@ -2844,10 +2869,13 @@ 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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated functions ``IDADlsGetNumRhsEvals`` and - ``IDASpilsGetNumRhsEvals``. + 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. .. c:function:: int IDAGetNumLinIters(void * ida_mem, long int * nliters) @@ -2863,9 +2891,12 @@ 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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsGetNumLinIters``. + 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. .. c:function:: int IDAGetNumLinConvFails(void * ida_mem, long int * nlcfails) @@ -2881,9 +2912,12 @@ 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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsGetNumConvFails``. + 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. .. c:function:: int IDAGetNumPrecEvals(void * ida_mem, long int * npevals) @@ -2899,9 +2933,12 @@ 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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsGetNumPrecEvals``. + 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. .. c:function:: int IDAGetNumPrecSolves(void * ida_mem, long int * npsolves) @@ -2917,9 +2954,12 @@ 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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsGetNumPrecSolves``. + 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. .. c:function:: int IDAGetNumJTSetupEvals(void * ida_mem, long int * njtsetup) @@ -2935,9 +2975,12 @@ 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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsGetNumJTSetupEvals``. + 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. .. c:function:: int IDAGetNumJtimesEvals(void * ida_mem, long int * njvevals) @@ -2953,9 +2996,12 @@ 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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsGetNumJtimesEvals``. + 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. .. c:function:: int IDAGetLastLinFlag(void * ida_mem, long int * lsflag) @@ -2993,10 +3039,13 @@ 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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated functions ``IDADlsGetLastFlag`` and - ``IDASpilsGetLastFlag``. + 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. .. c:function:: char* IDAGetLinReturnFlagName(long int lsflag) @@ -3011,10 +3060,13 @@ The following optional outputs are available from the IDALS modules: :math:`1 \leq \mathtt{lsflag} \leq N` (LU factorization failed), this function returns "NONE". - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated functions ``IDADlsGetReturnFlagName`` and - ``IDASpilsGetReturnFlagName``. + 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. .. _IDA.Usage.CC.reinit: @@ -3349,9 +3401,12 @@ 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`. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated type ``IDADlsJacFn``. + 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. .. _IDA.Usage.CC.user_fct_sim.jtimesFn: @@ -3406,9 +3461,13 @@ 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``. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated type ``IDASpilsJacTimesVecFn``. + 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. .. _IDA.Usage.CC.user_fct_sim.jtsetupFn: @@ -3458,9 +3517,13 @@ follows: :numref:`IDA.Usage.CC.optional_output.optout_main`. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated type ``IDASpilsJacTimesSetupFn``. + 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. diff --git a/doc/ida/guide/source/conf.py b/doc/ida/guide/source/conf.py index a92a878cf5..847aabc2da 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/sundials_vars.py'))) -from sundials_vars import * +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'))) # -- General configuration ---------------------------------------------------- diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index 771da6ec5b..a67642229c 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 X.Y.Z ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/idas/guide/source/Usage/ADJ.rst b/doc/idas/guide/source/Usage/ADJ.rst index 60c76147d7..0d89e5b895 100644 --- a/doc/idas/guide/source/Usage/ADJ.rst +++ b/doc/idas/guide/source/Usage/ADJ.rst @@ -690,10 +690,8 @@ function. documentation of the particular ``SUNMatrix`` type in Chapter :numref:`SUNMatrix` for further information). - .. versionadded:: 3.0.0 - - Replaces the deprecated functions ``IDADlsSetLinearSolverB`` and - ``IDASpilsSetLinearSolverB``. + The previous routines ``IDADlsSetLinearSolverB`` and + ``IDASpilsSetLinearSolverB`` are now deprecated. .. _IDAS.Usage.ADJ.user_callable.nonlin_solv_init_b: @@ -750,7 +748,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 ``IDASetIdB`` was previously called +of :math:`yB`. They require that the :c:func:`IDASetIdB` was previously called to specify the differential and algebraic components. Both functions require forward solutions at the final time ``tB0``. @@ -992,9 +990,11 @@ 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. - .. versionadded:: 3.0.0 - - Replaces the deprecated function ``IDADlsSetJacFnB``. + **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. .. c:function:: int IDASetJacFnBS(void * ida_mem, int which, IDALsJacFnBS jacBS) @@ -1015,9 +1015,8 @@ 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. - .. versionadded:: 3.0.0 - - Replaces the deprecated function ``IDADlsSetJacFnBS``. + **Notes:** + The previous routine, ``IDADlsSetJacFnBS``, is now deprecated. The function :c:func:`IDASetLinearSolutionScalingB` can be used to enable or @@ -1074,9 +1073,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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsSetJacTimesB``. + The previous routine, ``IDASpilsSetJacTimesB``, is now deprecated. .. c:function:: int IDASetJacTimesBS(void * ida_mem, int which, \ @@ -1099,9 +1098,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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsSetJacTimesBS``. + The previous routine, ``IDASpilsSetJacTimesBS``, is now deprecated. When using the default difference-quotient approximation to the Jacobian-vector @@ -1132,9 +1131,7 @@ setting increments for the finite-difference approximation, via a call to **Notes:** The default value is :math:`1.0`. - .. versionadded:: 3.0.0 - - Replaces the deprecated function ``IDASpilsSetIncrementFactorB``. + The previous routine ``IDASpilsSetIncrementFactorB`` is now a deprecated. Additionally, When using the internal difference quotient for the backward @@ -1206,9 +1203,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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsSetPreconditionerB``. + The previous routine ``IDASpilsSetPreconditionerB`` is now deprecated. .. c:function:: int IDASetPreconditionerBS(void * ida_mem, int which, IDALsPrecSetupFnBS psetupBS, IDALsPrecSolveFnBS psolveBS) @@ -1234,9 +1231,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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsSetPreconditionerBS``. + The previous routine ``IDASpilsSetPreconditionerBS`` is now deprecated. .. c:function:: int IDASetEpsLinB(void * ida_mem, int which, sunrealtype eplifacB) @@ -1265,9 +1262,9 @@ These may be accomplished through calling the following functions: Passing a value ``eplifacB`` :math:`= 0.0` also indicates using the default value. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsSetEpsLinB``. + The previous routine ``IDASpilsSetEpsLinB`` is now deprecated. .. c:function:: int IDASetLSNormFactorB(void * ida_mem, int which, sunrealtype nrmfac) @@ -1367,8 +1364,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:struct:`IDAadjCheckPointRec`. The user - must allocate space for the array ``ckpnt``. + ``ncheck+1`` records of type :c:func:`IDAadjCheckPointRec`. The user must + allocate space for the array ``ckpnt``. **Arguments:** * ``ida_mem`` -- pointer to the IDAS memory block created by :c:func:`IDACreate`. @@ -1377,37 +1374,22 @@ any case, it must be within the last checkpoint interval used by **Return value:** * ``void`` - 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`` - - .. 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 + **Notes:** + The members of each record ``ckpnt[i]`` are: - The end time of the checkpoint interval + - ``ckpnt[i].my_addr`` (``void *``) address of current checkpoint in ``ida_mem->ida_adj_mem`` - .. c:member:: long int nstep + - ``ckpnt[i].next_addr`` (``void *``) address of next checkpoint - The step counter at ``t0`` + - ``ckpnt[i].t0`` (``sunrealtype``) start of checkpoint interval - .. c:member:: int order + - ``ckpnt[i].t1`` (``sunrealtype``) end of checkpoint interval - The method order at ``t0`` + - ``ckpnt[i].nstep`` (``long int``) step counter at ckeckpoint ``t0`` - .. c:member:: sunrealtype step + - ``ckpnt[i].order`` (``int``) method order at checkpoint ``t0`` - The step size at ``t0`` + - ``ckpnt[i].step`` (``sunrealtype``) step size at checkpoint ``t0`` .. _IDAS.Usage.ADJ.user_callable.optional_ouput_b.iccalcB: @@ -1633,7 +1615,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data, same as passed to :c:func:`IDASetUserDataB` . **Return value:** An ``IDAResFnB`` should return 0 if successful, a positive value if a recoverable @@ -1682,7 +1664,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data, same as passed to :c:func:`IDASetUserDataB` . **Return value:** An ``IDAResFnBS`` should return 0 if successful, a positive value if a @@ -1729,7 +1711,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data, same as passed to :c:func:`IDASetUserDataB` . **Return value:** An ``IDAQuadRhsFnB`` should return 0 if successful, a positive value if a @@ -1781,7 +1763,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data, same as passed to :c:func:`IDASetUserDataB` . **Return value:** An ``IDAQuadRhsFnBS`` should return 0 if successful, a positive value if a @@ -1835,7 +1817,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data — the parameter passed to :c:func:`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:** @@ -1868,9 +1850,11 @@ as follows: integration (:c:func:`IDASolveB` returns ``IDA_LSETUP_FAIL`` and IDALS sets ``last_flag`` to ``IDALS_JACFUNC_UNRECVR``). - .. versionadded:: 3.0.0 - - Replaces the deprecated type ``IDADlsJacFnB``. + 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. .. 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); @@ -1890,7 +1874,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data — the parameter passed to :c:func:`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:** @@ -1924,9 +1908,11 @@ as follows: integration (:c:func:`IDASolveB` returns ``IDA_LSETUP_FAIL`` and IDALS sets ``last_flag`` to ``IDALS_JACFUNC_UNRECVR``). - .. versionadded:: 3.0.0 - - Replaces the deprecated type ``IDADlsJacFnBS``. + 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. .. _IDAS.Usage.ADJ.user_supplied.jactimesvec_b: @@ -1955,9 +1941,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to :c:func:`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:** @@ -1976,9 +1962,13 @@ 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`. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated type ``IDASpilsJacTimesVecFnB``. + 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. .. 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) @@ -1997,9 +1987,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to :c:func:`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:** @@ -2016,9 +2006,13 @@ these products. equivalent to those passed to a function of type ``IDALsJacTimesVecFn`` (see :numref:`IDAS.Usage.SIM.user_supplied.jtimesFn`). - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated type ``IDASpilsJacTimesVecFnBS``. + 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. .. _IDAS.Usage.ADJ.user_supplied.jactimesvecsetup_b: @@ -2044,7 +2038,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to :c:func:`IDASetUserDataB` . **Return value:** The value returned by the Jacobian-vector setup function @@ -2066,9 +2060,13 @@ function of type :c:type:`IDALsJacTimesSetupFnB` or The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated type ``IDASpilsJacTimesSetupFnB``. + 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. .. 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) @@ -2085,7 +2083,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to :c:func:`IDASetUserDataB` . **Return value:** The value returned by the Jacobian-vector setup function should be if @@ -2107,9 +2105,13 @@ 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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated type ``IDASpilsJacTimesSetupFnBS``. + 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. .. _IDAS.Usage.ADJ.user_supplied.psolve_b: @@ -2138,7 +2140,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to the function :c:func:`IDASetUserDataB` . **Return value:** The return value of a preconditioner solve function for the backward @@ -2146,9 +2148,10 @@ following two forms: which case the step will be retried), or negative for an unrecoverable error (in which case the integration is halted). - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated type ``IDASpilsPrecSolveFnB``. + The previous function type ``IDASpilsPrecSolveFnB`` is identical to + ``IDALsPrecSolveFnB``, and is deprecated. .. 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) @@ -2170,7 +2173,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to the function :c:func:`IDASetUserDataB` . **Return value:** The return value of a preconditioner solve function for the backward @@ -2178,9 +2181,10 @@ following two forms: which case the step will be retried), or negative for an unrecoverable error (in which case the integration is halted). - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated type ``IDASpilsPrecSolveFnBS``. + The previous function type ``IDASpilsPrecSolveFnBS`` is identical to + ``IDALsPrecSolveFnBS``, and is deprecated. .. _IDAS.Usage.ADJ.user_supplied.psetup_b: @@ -2205,7 +2209,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to the function :c:func:`IDASetUserDataB` . **Return value:** The return value of a preconditioner setup function for the backward @@ -2213,9 +2217,10 @@ 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). - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated type ``IDASpilsPrecSetupFnB``. + The previous function type ``IDASpilsPrecSetupFnB`` is identical to + ``IDALsPrecSetupFnB``, and is deprecated. .. 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) @@ -2234,7 +2239,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to the function :c:func:`IDASetUserDataB` . **Return value:** The return value of a preconditioner setup function for the backward @@ -2242,9 +2247,10 @@ 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). - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated type ``IDASpilsPrecSetupFnBS``. + The previous function type ``IDASpilsPrecSetupFnBS`` is identical to + ``IDALsPrecSetupFnBS``, and is deprecated. Using the band-block-diagonal preconditioner for backward problems @@ -2353,7 +2359,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to :c:func:`IDASetUserDataB` . **Return value:** An ``IDABBDLocalFnB`` should return 0 if successful, a positive value if a @@ -2388,7 +2394,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 ``IDASetUserDataB``. + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to :c:func:`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 981291a4aa..69f3e29842 100644 --- a/doc/idas/guide/source/Usage/SIM.rst +++ b/doc/idas/guide/source/Usage/SIM.rst @@ -586,9 +586,13 @@ pertinent to their choice of linear solver. the documentation of the particular ``SUNMatrix`` in Chapter :numref:`SUNMatrix` for further information). - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDADlsSetLinearSolver``. + 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. .. _IDAS.Usage.SIM.user_callable.nonlin_solv_init: @@ -1267,9 +1271,12 @@ 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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDADlsSetJacFn``. + 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. When using a matrix-based linear solver the matrix information will be updated @@ -1374,9 +1381,12 @@ without using global data in the program. solver interface has been initialized through a call to :c:func:`IDASetLinearSolver`. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsSetJacTimes``. + 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. When using the default difference-quotient approximation to the Jacobian-vector @@ -1414,9 +1424,12 @@ finite-difference approximation, via a call to :c:func:`IDASetIncrementFactor`. linear solver interface has been initialized through a call to :c:func:`IDASetLinearSolver`. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsSetIncrementFactor``. + 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. Additionally, when using the internal difference quotient, the user may also @@ -1496,9 +1509,12 @@ 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`. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsSetPreconditioner``. + 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. Also, as described in :numref:`IDAS.Mathematics.ivp_sol`, the IDALS interface @@ -1534,9 +1550,12 @@ 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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsSetEpsLin``. + 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. .. c:function:: int IDASetLSNormFactor(void * ida_mem, sunrealtype nrmfac) @@ -2830,10 +2849,13 @@ 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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated functions ``IDADlsGetWorkspace`` and - ``IDASpilsGetWorkspace``. + 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. .. c:function:: int IDAGetNumJacEvals(void * ida_mem, long int * njevals) @@ -2849,9 +2871,12 @@ 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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDADlsGetNumJacEvals``. + 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. .. c:function:: int IDAGetNumLinResEvals(void * ida_mem, long int * nrevalsLS) @@ -2873,10 +2898,9 @@ 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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated functions ``IDADlsGetNumRhsEvals`` and - ``IDASpilsGetNumRhsEvals``. + The previous routines :c:func:`IDADlsGetNumRhsEvals` and :c:func:`IDASpilsGetNumRhsEvals` are now deprecated. .. c:function:: int IDAGetNumLinIters(void * ida_mem, long int * nliters) @@ -2893,9 +2917,12 @@ 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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsGetNumLinIters``. + 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. .. c:function:: int IDAGetNumLinConvFails(void * ida_mem, long int * nlcfails) @@ -2911,9 +2938,12 @@ 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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsGetNumConvFails``. + 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. .. c:function:: int IDAGetNumPrecEvals(void * ida_mem, long int * npevals) @@ -2929,9 +2959,12 @@ 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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsGetNumPrecEvals``. + 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. .. c:function:: int IDAGetNumPrecSolves(void * ida_mem, long int * npsolves) @@ -2947,9 +2980,12 @@ 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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsGetNumPrecSolves``. + 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. .. c:function:: int IDAGetNumJTSetupEvals(void * ida_mem, long int * njtsetup) @@ -2965,9 +3001,12 @@ 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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsGetNumJTSetupEvals``. + 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. .. c:function:: int IDAGetNumJtimesEvals(void * ida_mem, long int * njvevals) @@ -2983,9 +3022,12 @@ 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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated function ``IDASpilsGetNumJtimesEvals``. + 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. .. c:function:: int IDAGetLastLinFlag(void * ida_mem, long int * lsflag) @@ -3023,10 +3065,13 @@ 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. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated functions ``IDADlsGetLastFlag`` and - ``IDASpilsGetLastFlag``. + 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. .. c:function:: char* IDAGetLinReturnFlagName(long int lsflag) @@ -3041,10 +3086,13 @@ The following optional outputs are available from the IDALS modules: :math:`1 \leq \mathtt{lsflag} \leq N` (LU factorization failed), this function returns "NONE". - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated functions ``IDADlsGetReturnFlagName`` and - ``IDASpilsGetReturnFlagName``. + 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. .. _IDAS.Usage.SIM.user_callable.reinit: @@ -3389,9 +3437,12 @@ 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`. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated type ``IDADlsJacFn``. + 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. .. _IDAS.Usage.SIM.user_supplied.jtimesFn: @@ -3446,9 +3497,13 @@ 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``. - .. versionadded:: 3.0.0 + .. warning:: - Replaces the deprecated type ``IDASpilsJacTimesVecFn``. + 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. .. _IDAS.Usage.SIM.user_supplied.jtsetupFn: @@ -3498,9 +3553,14 @@ 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``. - .. versionadded:: 3.0.0 + .. 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. - 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 8613adcf6a..701f4d9e22 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/sundials_vars.py'))) -from sundials_vars import * +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'))) # -- General configuration ---------------------------------------------------- diff --git a/doc/install_guide/source/conf.py b/doc/install_guide/source/conf.py index 34d91a697c..211d28657c 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/sundials_vars.py'))) -from sundials_vars import * +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'))) # -- General configuration ---------------------------------------------------- diff --git a/doc/kinsol/guide/Makefile b/doc/kinsol/guide/Makefile index 8b6275ab8c..d0c3cbf102 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 ?= -W --keep-going +SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build SOURCEDIR = source BUILDDIR = build diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index 5dd8e82594..6961e9da38 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 X.Y.Z ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/kinsol/guide/source/Usage/index.rst b/doc/kinsol/guide/source/Usage/index.rst index 17d89da5c3..1079ea0b25 100644 --- a/doc/kinsol/guide/source/Usage/index.rst +++ b/doc/kinsol/guide/source/Usage/index.rst @@ -373,10 +373,12 @@ pertinent to their choice of linear solver. size (see the documentation of the particular ``SUNMatrix`` type in Chapter :numref:`SUNMatrix` for further information). - .. versionadded:: 4.0.0 - - Replaces the deprecated functions ``KINDlsSetLinearSolver`` and - ``KINSpilsSetLinearSolver``. + 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. .. _KINSOL.Usage.CC.kin: @@ -1144,9 +1146,12 @@ 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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``KINDlsSetJacFn``. + 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. When using matrix-free linear solver modules, the KINLS linear solver @@ -1185,11 +1190,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`. - - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``KINSpilsSetJacTimesVecFn``. + :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. When using the internal difference quotient the user may optionally supply an @@ -1265,9 +1270,12 @@ 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`. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``KINSpilsSetPreconditioner``. + 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. .. _KINSOL.Usage.CC.optional_output: @@ -1556,10 +1564,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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``KINDlsGetWorkspace`` and - ``KINSpilsGetWorkspace``. + The previous routines :c:func:`KINDlsGetWorkspace` and :c:func:`KINSpilsGetWorkspace` + are now deprecated. .. c:function:: int KINGetNumJacEvals(void * kin_mem, long int * njevals) @@ -1576,9 +1584,10 @@ 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. - .. versionadded:: 4.0.0 + .. warning:: + + The previous routine :c:func:`KINDlsGetNumJacEvals` is now deprecated, - Replaces the deprecated function ``KINDlsGetNumJacEvals``. .. c:function:: int KINGetNumLinFuncEvals(void * kin_mem, long int * nrevalsLS) @@ -1600,10 +1609,9 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated functions ``KINDlsGetNumRhsEvals`` and - ``KINSpilsGetNumRhsEvals``. + .. warning:: + The previous routines :c:func:`KINDlsGetNumRhsEvals` and + :c:func:`KINSpilsGetNumRhsEvals` are now deprecated. .. c:function:: int KINGetNumLinIters(void * kin_mem, long int * nliters) @@ -1620,9 +1628,8 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``KINSpilsGetNumLinIters``. + .. warning:: + The previous routine :c:func:`KINSpilsGetNumLinIters` is now deprecated. .. c:function:: int KINGetNumLinConvFails(void * kin_mem, long int * nlcfails) @@ -1639,9 +1646,8 @@ 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. - .. versionadded:: 4.0.0 - - Replaces the deprecated function ``KINSpilsGetNumConvFails``. + .. warning:: + The previous routine :c:func:`KINSpilsGetNumConvFails` is now deprecated. .. c:function:: int KINGetNumPrecEvals(void * kin_mem, long int * npevals) @@ -1658,9 +1664,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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``KINSpilsGetNumPrecEvals``. + The previous routine :c:func:`KINSpilsGetNumPrecEvals` is now deprecated. .. c:function:: int KINGetNumPrecSolves(void * kin_mem, long int * npsolves) @@ -1677,9 +1683,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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``KINSpilsGetNumPrecSolves``. + The previous routine :c:func:`KINSpilsGetNumPrecSolves` is now deprecated. .. c:function:: int KINGetNumJtimesEvals(void * kin_mem, long int * njvevals) @@ -1696,9 +1702,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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated function ``KINSpilsGetNumJtimesEvals``. + The previous routine :c:func:`KINSpilsGetNumJtimesEvals` is now deprecated. .. c:function:: int KINGetLastLinFlag(void * kin_mem, long int * lsflag) @@ -1740,10 +1746,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. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated functions ``KINDlsGetLastFlag`` and - ``KINSpilsGetLastFlag``. + The previous routines :c:func:`KINDlsGetLastFlag` and :c:func:`KINSpilsGetLastFlag` + are now deprecated. .. c:function:: char* KINGetLinReturnFlagName(long int lsflag) @@ -1759,10 +1765,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". - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated functions ``KINDlsGetReturnFlagName`` and - ``KINSpilsGetReturnFlagName``. + The previous routines :c:func:`KINDlsGetReturnFlagName` and + :c:func:`KINSpilsGetReturnFlagName` are now deprecated. .. _KINSOL.Usage.CC.user_fct_sim: @@ -1925,9 +1931,12 @@ 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`. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated type ``KINDlsJacFn``. + 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. .. _KINSOL.Usage.CC.user_fct_sim.jtimesFn: @@ -1974,9 +1983,13 @@ 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``. - .. versionadded:: 4.0.0 + .. warning:: - Replaces the deprecated type ``KINSpilsJacTimesVecFn``. + 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. .. _KINSOL.Usage.CC.user_fct_sim.psolveFn: diff --git a/doc/kinsol/guide/source/conf.py b/doc/kinsol/guide/source/conf.py index c8cef7c6ac..366c1af7d6 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/sundials_vars.py'))) -from sundials_vars import * +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'))) # -- General configuration ---------------------------------------------------- @@ -34,11 +34,6 @@ 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/Changelog.rst b/doc/shared/Changelog.rst index 4fa304b8ac..136e910f4a 100644 --- a/doc/shared/Changelog.rst +++ b/doc/shared/Changelog.rst @@ -21,7 +21,7 @@ Changelog .. SED_REPLACEMENT_KEY -Changes to SUNDIALS in release 7.1.0 +Changes to SUNDIALS in release X.Y.Z ==================================== .. include:: RecentChanges_link.rst diff --git a/doc/shared/History.rst b/doc/shared/History.rst index b5c79886e3..cfdee0c931 100644 --- a/doc/shared/History.rst +++ b/doc/shared/History.rst @@ -21,8 +21,6 @@ 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/RecentChanges.rst b/doc/shared/RecentChanges.rst index adc2691e7b..7d204c8189 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -1,63 +1,7 @@ -**Major Features** +**New 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``. +Added CMake infrastructure that enables externally maintained addons/plugins +to be *optionally* built with SUNDIALS. See :ref:`Contributing` for details. **Bug Fixes** @@ -65,69 +9,23 @@ 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>`_. +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 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 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. -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** +Added support for Kokkos Kernels v4. -Numerous ARKODE stepper-specific functions are now deprecated in favor of -ARKODE-wide functions. +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>`_. -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. +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>`_. -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/figs/arkode/backward_euler_dirk_stab_region.png b/doc/shared/figs/arkode/backward_euler_dirk_stab_region.png deleted file mode 100644 index 388c85f0e0906ea013c5c301dd0859869780779a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 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 deleted file mode 100644 index c3f7e7b937833c5e42272dcf65d72d646a9625a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/doc/shared/figs/arkode/forward_euler_erk_stab_region.png b/doc/shared/figs/arkode/forward_euler_erk_stab_region.png deleted file mode 100644 index e5bedb74c797b355b85f91b455a4bdfeb9b62596..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/doc/shared/figs/arkode/implicit_midpoint_dirk_stab_region.png b/doc/shared/figs/arkode/implicit_midpoint_dirk_stab_region.png deleted file mode 100644 index 94695afff9a9db17201070f762d74a76ddddf80e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/doc/shared/figs/arkode/implicit_trapezoidal_dirk_stab_region.png b/doc/shared/figs/arkode/implicit_trapezoidal_dirk_stab_region.png deleted file mode 100644 index da400133124299d48e9a792a4f063546015c828a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/doc/shared/figs/arkode/ralston_euler_erk_stab_region.png b/doc/shared/figs/arkode/ralston_euler_erk_stab_region.png deleted file mode 100644 index e05a95f3c5d99bc527f72ba62e9024949a24968a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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^ diff --git a/doc/shared/nvectors/NVector_CUDA.rst b/doc/shared/nvectors/NVector_CUDA.rst index df27c93672..5fbdca2733 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 ``SUNCudaThreadDirectExecPolicy`` and - ``SUNCudaBlockReduceAtomicExecPolicy``. Any custom execution policy + the vector is setup to use the :cpp:func:`SUNCudaThreadDirectExecPolicy` and + :cpp:func:`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,6 +288,7 @@ 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``). @@ -299,23 +300,27 @@ 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: -.. cpp:class:: sundials::cuda::ExecPolicy - - .. 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 +.. code-block:: c++ - .. cpp:function:: virtual bool atomic() const + 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:: 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 c4d5eb7054..8c197fd7b6 100644 --- a/doc/shared/nvectors/NVector_Description.rst +++ b/doc/shared/nvectors/NVector_Description.rst @@ -17,266 +17,101 @@ Description of the NVECTOR Modules ================================== -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: +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 .. c:type:: struct _generic_N_Vector *N_Vector -.. c:struct:: _generic_N_Vector - - The structure defining the SUNDIALS vector class. - - .. c:member:: void *content - - Pointer to vector-specific member data. - - .. 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) +and the generic structure is defined as - The function implementing :c:func:`N_VWL2Norm` - - .. c:member:: sunrealtype (*nvl1norm)(N_Vector) - - 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*) +.. code-block:: c - The function implementing :c:func:`N_VBufUnpack` + struct _generic_N_Vector { + void *content; + struct _generic_N_Vector_Ops *ops; + }; - .. c:member:: void (*nvprint)(N_Vector) +Here, the ``_generic_N_Vector_Op`` structure is essentially a list of +function pointers to the various actual vector operations, and is +defined as - The function implementing :c:func:`N_VPrint` +.. code-block:: c - .. c:member:: void (*nvprintfile)(N_Vector, FILE*) + 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_VPrintFile` The generic NVECTOR module defines and implements the vector operations acting on a ``N_Vector``. These routines are nothing but @@ -494,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(SUNContext sunctx) +.. c:function:: N_Vector N_VNewEmpty() This allocates a new generic ``N_Vector`` object and initializes its content pointer and the function pointers in the operations structure to ``NULL``. @@ -524,13 +359,11 @@ to be set, and that all operations are copied when cloning a vector. **Return value:** Returns a :c:type:`SUNErrCode`. - -.. 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. +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. .. _NVectors.Description.vectorIDs: diff --git a/doc/shared/nvectors/NVector_HIP.rst b/doc/shared/nvectors/NVector_HIP.rst index f722e9cfac..5a2cac0d2a 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. ``N_VDestroy_Hip``). The module NVECTOR_HIP provides the +(e.g. :c:func:`N_VDestroy_Hip`). The module NVECTOR_HIP provides the following additional user-callable routines: @@ -271,6 +271,7 @@ 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``). @@ -282,23 +283,28 @@ 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: -.. cpp:class:: sundials::hip::ExecPolicy - - .. 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 +.. code-block:: c++ - .. cpp:function:: ExecPolicy* clone_new_stream(hipStream_t stream) const + 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:: 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 1879a7c130..b9a47f7539 100644 --- a/doc/shared/nvectors/NVector_Kokkos.rst +++ b/doc/shared/nvectors/NVector_Kokkos.rst @@ -102,13 +102,6 @@ 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 fdaeaf31c9..6008e50994 100644 --- a/doc/shared/nvectors/NVector_MPIManyVector.rst +++ b/doc/shared/nvectors/NVector_MPIManyVector.rst @@ -302,11 +302,12 @@ 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``. 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. + 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. * 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 88905edd50..66e7c11fbf 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 - 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. + :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. * 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 cded89fd73..639a286ea5 100644 --- a/doc/shared/nvectors/NVector_ManyVector.rst +++ b/doc/shared/nvectors/NVector_ManyVector.rst @@ -240,11 +240,13 @@ them to the ManyVector in :c:func:`N_VNew_ManyVector`. **Notes** -* :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. +* :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. * 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 4f84694770..1275654279 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 function :c:func:`N_VDestroy_OpenMP()` will not attempt to free the pointer data for any ``N_Vector`` with *own_data* set to ``SUNFALSE``. In such a case, it is the user's responsibility to deallocate the data pointer. diff --git a/doc/shared/nvectors/NVector_OpenMPDEV.rst b/doc/shared/nvectors/NVector_OpenMPDEV.rst index 9dabeba2d7..9bca572c6f 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 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. + *own_data* to ``SUNFALSE``. The function :c:func:`N_VDestroy_OpenMPDEV()` + will not attempt to free the pointer data for any ``N_Vector`` with *own_data* + set to ``SUNFALSE``. In such a case, it is the user's responsibility to + deallocate the data pointers. * To maximize efficiency, vector operations in the NVECTOR_OPENMPDEV implementation that have more than one ``N_Vector`` argument do not diff --git a/doc/shared/nvectors/NVector_Operations.rst b/doc/shared/nvectors/NVector_Operations.rst index e184b829de..e9321ad9cd 100644 --- a/doc/shared/nvectors/NVector_Operations.rst +++ b/doc/shared/nvectors/NVector_Operations.rst @@ -1034,34 +1034,3 @@ 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 f7284ae7f8..8b723fbfe6 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 implementation of :c:func:`N_VDestroy` + field *own_data* to ``SUNFALSE``. The routine :c:func:`N_VDestroy_Petsc()` will not attempt to free the pointer ``pvec`` for any ``N_Vector`` with *own_data* set to ``SUNFALSE``. In such a case, it is the user's responsibility to deallocate the ``pvec`` pointer. diff --git a/doc/shared/nvectors/NVector_ParHyp.rst b/doc/shared/nvectors/NVector_ParHyp.rst index 815469e938..cd662bae5a 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 implementation of :c:func:`N_VDestroy` + *own_parvector* to ``SUNFALSE``. The function :c:func:`N_VDestroy_ParHyp()` will not attempt to delete an underlying HYPRE vector for any ``N_Vector`` - with *own_parvector* set to ``SUNFALSE``. In such a case, it is the user's - responsibility to delete the underlying vector. + 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 f0b185a584..38a3a55a5c 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 implementation of :c:func:`N_VDestroy` will + *own_data* to ``SUNFALSE``. The routine :c:func:`N_VDestroy_Parallel()` will not attempt to free the pointer data for any ``N_Vector`` with *own_data* set to ``SUNFALSE``. In such a case, it is the user's responsibility to deallocate the data pointer. diff --git a/doc/shared/nvectors/NVector_Pthreads.rst b/doc/shared/nvectors/NVector_Pthreads.rst index 39478ce7ab..fa637e5c5f 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 implementation of :c:func:`N_VDestroy` will + *own_data* to ``SUNFALSE``. The function :c:func:`N_VDestroy_Pthreads()` will not attempt to free the pointer data for any ``N_Vector`` with *own_data* set to ``SUNFALSE``. In such a case, it is the user's responsibility to deallocate the data pointer. diff --git a/doc/shared/nvectors/NVector_SYCL.rst b/doc/shared/nvectors/NVector_SYCL.rst index 3b1cfeeb68..ea3b221e85 100644 --- a/doc/shared/nvectors/NVector_SYCL.rst +++ b/doc/shared/nvectors/NVector_SYCL.rst @@ -309,6 +309,7 @@ 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 @@ -321,15 +322,16 @@ class is defined as where the ``sundials::sycl::ExecPolicy`` class is defined in the header file ``sundials_sycl_policies.hpp``, as follows: -.. cpp:class:: sundials::sycl::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 +.. code-block:: c++ - .. cpp:function:: virtual ~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() {} + }; 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 e822908156..80f99703e9 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` and :c:func:`N_VMake_Serial` set the field - *own_data* to ``SUNFALSE``. The implementation of :c:func:`N_VDestroy` will +* :c:func:`N_VNewEmpty_Serial`, :c:func:`N_VMake_Serial` set the field + *own_data* to ``SUNFALSE``. The function :c:func:`N_VDestroy_Serial()` will not attempt to free the pointer data for any ``N_Vector`` with *own_data* set to ``SUNFALSE``. In such a case, it is the user's responsibility to deallocate the data pointer. diff --git a/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst b/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst index 91e94abbf0..c5c02ceb44 100644 --- a/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst +++ b/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst @@ -34,74 +34,40 @@ 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 :c:type:`SUNAdaptController` class is modeled after SUNDIALS' other object-oriented +The base ``SUNAdaptController`` class is modeled after SUNDIALS' other object-oriented classes, in that this class contains a pointer to an implementation-specific *content*, an *ops* structure with generic controller operations, and a -:c:type:`SUNContext` object. - -A :c:type:`SUNAdaptController` is a pointer to the -:c:struct:`_generic_SUNAdaptController` structure: +:c:type:`SUNContext` object. Specifically, the type ``SUNAdaptController`` is defined +as: .. c:type:: struct _generic_SUNAdaptController *SUNAdaptController -.. c:struct:: _generic_SUNAdaptController - - .. c:member:: void* content - - Pointer to the controller-specific member data - - .. c:member:: SUNAdaptController_Ops ops; - - 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); +and the base class structure is defined as - The function implementing :c:func:`SUNAdaptController_EstimateStep` +.. code-block:: C - .. c:member:: SUNErrCode (*reset)(SUNAdaptController C) + struct _generic_SUNAdaptController { + void* content; + generic_SUNAdaptController_Ops* ops; + SUNContext sunctx; + }; - The function implementing :c:func:`SUNAdaptController_Reset` +Here, ``_generic_SUNAdaptController_Ops`` is the pointer to a structure containing +function pointers to the various controller operations, and is defined as - .. 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) +.. code-block:: c - The function implementing :c:func:`SUNAdaptController_Space` + 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); + }; .. _SUNAdaptController.Description.controllerTypes: @@ -157,23 +123,6 @@ 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/doc/shared/sundials.bib b/doc/shared/sundials.bib index afa6de0c0d..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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +title = {{Example Programs for KINSOL v7.0.0}}, institution = {LLNL}, number = {UCRL-SM-208114}, year = 2024 @@ -1795,15 +1795,6 @@ @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}, @@ -1952,42 +1943,6 @@ @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/doc/shared/sundials/Fortran.rst b/doc/shared/sundials/Fortran.rst index 97a5b80ba8..39f7fe9937 100644 --- a/doc/shared/sundials/Fortran.rst +++ b/doc/shared/sundials/Fortran.rst @@ -81,11 +81,24 @@ 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`. -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`. +.. 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`. 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 @@ -162,13 +175,8 @@ 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. - -.. versionchanged:: 7.1.0 - - The Fortran interfaces can now be built with 32-bit ``sunindextype`` in - addition to 64-bit ``sunindextype``. - + builds where the ``sunrealtype`` is double-precision the ``sunindextype`` size + is 64-bits. .. _SUNDIALS.Fortran.DataTypes.Table: .. table:: C/Fortran-2003 Equivalent Types @@ -429,9 +437,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 ``FN_VGetVecAtIndexVectorArray`` wrapping -:c:func:`N_VGetVecAtIndexVectorArray`. The example below demonstrates accessing -a vector in a vector array. +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: C code: @@ -557,7 +565,8 @@ Important notes on portability ------------------------------ The SUNDIALS Fortran 2003 interface *should* be compatible with any compiler -supporting the Fortran 2003 ISO standard. +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+. 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/GPU.rst b/doc/shared/sundials/GPU.rst index 8607643adf..ec32d74e2e 100644 --- a/doc/shared/sundials/GPU.rst +++ b/doc/shared/sundials/GPU.rst @@ -16,13 +16,27 @@ Features for GPU Accelerated Computing ============================================= -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. +.. 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. .. _SUNDIALS.GPU.Model: diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index d666fc7b29..8c2ed50c2e 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-7.1.0.tar.gz``, where ``SOLVER`` is one of: ``sundials``, ``cvode``, -``cvodes``, ``arkode``, ``ida``, ``idas``, or ``kinsol``, and ``7.1.0`` +``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, by running .. code-block:: bash - % tar -zxf SOLVER-7.1.0.tar.gz + % tar -zxf SOLVER-X.Y.Z.tar.gz -This will extract source files under a directory ``SOLVER-7.1.0``. +This will extract source files under a directory ``SOLVER-X.Y.Z``. 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-7.1.0`` created above; i.e. the + ``SOLVERDIR`` is the directory ``SOLVER-X.Y.Z`` created above; i.e. the directory containing the SUNDIALS sources. ``BUILDDIR`` is the (temporary) directory under which SUNDIALS is built. @@ -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.18.0 or higher and a working +The SUNDIALS build process requires CMake version 3.12.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 @@ -294,8 +294,8 @@ default configuration: .. _Installation.CMake.Options: -Configuration options ---------------------- +Configuration options (Unix/Linux) +----------------------------------- A complete list of all available options for a CMake-based SUNDIALS configuration is provide below. Note that the default values shown @@ -590,11 +590,6 @@ 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, @@ -670,14 +665,10 @@ 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. + Options currenty supported are REF (the Ginkgo reference executor), OMP, CUDA, HIP, and DPC++. Default: "REF;OMP" - .. versionchanged: 7.1.0 - - The ``DPCPP`` option was changed to ``SYCL`` to align with Ginkgo's naming convention. - .. cmakeoption:: ENABLE_KOKKOS Enable the Kokkos based vector. @@ -1489,13 +1480,13 @@ SUNDIALS has been tested with MAGMA version v2.6.1 and v2.6.2. .. _Installation.CMake.ExternalLibraries.OneMKL: -Building with oneMKL for SYCL -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Building with oneMKL +^^^^^^^^^^^^^^^^^^^^^^^^^^^ The Intel `oneAPI Math Kernel Library (oneMKL) <https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html>`_ -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 +includes CPU and DPC++ interfaces for LAPACK dense linear algebra routines. The +SUNDIALS oneMKL interface targets the 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 @@ -1709,7 +1700,7 @@ header files. without any notice and relying on them may break your code. -Using SUNDIALS in your project +Using SUNDIALS in your prpject ------------------------------ After building and installing SUNDIALS, using SUNDIALS in your application involves @@ -1790,7 +1781,7 @@ configuration file to build against SUNDIALS in their own CMake project. .. note:: - .. versionchanged:: 7.1.0 + .. 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 diff --git a/doc/shared/sundials/Logging.rst b/doc/shared/sundials/Logging.rst index 8ce0b31774..e98d56e583 100644 --- a/doc/shared/sundials/Logging.rst +++ b/doc/shared/sundials/Logging.rst @@ -82,9 +82,7 @@ Logger API The central piece of the Logger API is the :c:type:`SUNLogger` type: -.. c:type:: SUNLogger - - An opaque pointer containing logging information. +.. c:type:: struct SUNLogger_* SUNLogger 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 2f8f458235..b787b5d485 100644 --- a/doc/shared/sundials/Profiling.rst +++ b/doc/shared/sundials/Profiling.rst @@ -89,10 +89,9 @@ 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:: SUNProfiler - - An opaque pointer containing profiling information. +.. c:type:: struct SUNProfiler_ *SUNProfiler 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 18b1bf050d..9bcd204bd9 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. -.. c:type:: SUNContext +The :c:type:`SUNContext` class/type is defined in the header file +``sundials/sundials_context.h`` as - An opaque pointer used by SUNDIALS objects for error handling, logging, - profiling, etc. +.. c:type:: struct _SUNContext *SUNContext 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 59cf1b29ba..027e9cffe8 100644 --- a/doc/shared/sundials/Types.rst +++ b/doc/shared/sundials/Types.rst @@ -125,15 +125,7 @@ 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: :c:macro:`SUNFALSE` or :c:macro:`SUNTRUE`. - -.. c:macro:: SUNFALSE - - False (``0``) - -.. c:macro:: SUNTRUE - - True (``1``) +only the two values ``SUNFALSE`` (``0``) and ``SUNTRUE`` (``1``). Output formatting type ---------------------- @@ -161,13 +153,9 @@ 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. - -.. 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. + can support MPI and non-MPI builds. + \ No newline at end of file diff --git a/doc/shared/sundials_vars.py b/doc/shared/sundials_vars.py deleted file mode 100644 index dca40a56f2..0000000000 --- a/doc/shared/sundials_vars.py +++ /dev/null @@ -1,128 +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 = '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 -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 6650b88d20..3f6436d249 100644 --- a/doc/shared/sunlinsol/SUNLinSol_API.rst +++ b/doc/shared/sunlinsol/SUNLinSol_API.rst @@ -44,52 +44,42 @@ 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 - An identifier indicating the type of linear solver. - - .. note:: - - See :numref:`SUNLinSol.Intended` for more information on - intended use cases corresponding to the linear solver type. - - .. c:enumerator:: SUNLINEARSOLVER_DIRECT - - The linear solver requires a matrix, and computes an "exact" solution to - the linear system defined by that matrix. - - .. c:enumerator:: SUNLINEARSOLVER_ITERATIVE - - 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. - - .. c:enumerator:: SUNLINEARSOLVER_MATRIX_ITERATIVE - - 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 type identifier for the linear solver *LS*. -.. c:function:: SUNLinearSolver_Type SUNLinSolGetType(SUNLinearSolver LS) + **Return value:** - Returns the :c:enum:`SUNLinearSolver_Type` type identifier for the linear - solver. + * ``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. **Usage:** @@ -97,6 +87,12 @@ set up the linear solver object to utilize an updated matrix :math:`A` type = SUNLinSolGetType(LS); + .. note:: + + See :numref:`SUNLinSol.Intended` for more information on + intended use cases corresponding to the linear solver type. + + .. c:function:: SUNLinearSolver_ID SUNLinSolGetID(SUNLinearSolver LS) Returns a non-negative linear solver identifier (of type ``int``) @@ -571,96 +567,51 @@ provide additional information to the user in case of a linear solver failure. The generic SUNLinearSolver module ----------------------------------------- -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: +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 .. c:type:: struct _generic_SUNLinearSolver *SUNLinearSolver -.. c:struct:: _generic_SUNLinearSolver - - The structure defining the SUNDIALS linear solver class. - - .. c:member:: void *content - - Pointer to the linear solver-specific member data - - .. 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 +and the generic structure is defined as -.. c:type:: struct _generic_SUNLinearSolver_Ops *SUNLinearSolver_Ops - -.. c:struct:: _generic_SUNLinearSolver_Ops - - 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*) +.. code-block:: c - The function implementing :c:func:`SUNLinSolSpace` + struct _generic_SUNLinearSolver { + void *content; + struct _generic_SUNLinearSolver_Ops *ops; + }; - .. c:member:: N_Vector (*resid)(SUNLinearSolver) +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 - The function implementing :c:func:`SUNLinSolResid` +.. code-block:: c - .. c:member:: SUNErrCode (*free)(SUNLinearSolver) + 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 function implementing :c:func:`SUNLinSolFree` The generic SUNLinSol class defines and implements the linear solver operations defined in :numref:`SUNLinSol.CoreFn` -- :numref:`SUNLinSol.GetFn`. @@ -814,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(SUNContext sunctx) +.. c:function:: SUNLinearSolver SUNLinSolNewEmpty() This function allocates a new generic ``SUNLinearSolver`` object and initializes its content pointer and the function pointers in the operations @@ -852,12 +803,11 @@ Additionally, a ``SUNLinearSolver`` implementation *may* do the following: -.. 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. +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 34fd25c82d..1b290d627a 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 ``sundials::ginkgo::DefaultStop`` class provided +stopping criteria object. Importantly, the :cpp:type:`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 :cpp:type:`sundials::ginkgo::LinearSolver`. Doing so may result in a double free. + from a ``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> \ - sundials::ginkgo::LinearSolver : public sundials::ConvertibleTo<SUNLinearSolver> + LinearSolver : public ConvertibleTo<SUNLinearSolver> .. cpp:function:: LinearSolver() = default; diff --git a/doc/shared/sunlinsol/SUNLinSol_KLU.rst b/doc/shared/sunlinsol/SUNLinSol_KLU.rst index ff3a9e2712..95ee6eaa43 100644 --- a/doc/shared/sunlinsol/SUNLinSol_KLU.rst +++ b/doc/shared/sunlinsol/SUNLinSol_KLU.rst @@ -120,15 +120,10 @@ user-callable routines: This function returns a pointer to the KLU symbolic factorization stored in the SUNLinSol_KLU ``content`` structure. - .. 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 + 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:function:: sun_klu_numeric* SUNLinSol_KLUGetNumeric(SUNLinearSolver S) @@ -136,15 +131,10 @@ user-callable routines: This function returns a pointer to the KLU numeric factorization stored in the SUNLinSol_KLU ``content`` structure. - .. 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 + 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:function:: sun_klu_common* SUNLinSol_KLUGetCommon(SUNLinearSolver S) @@ -152,15 +142,10 @@ user-callable routines: This function returns a pointer to the KLU common structure stored in the SUNLinSol_KLU ``content`` structure. - .. 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 + 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``. .. _SUNLinSol.KLU.Description: diff --git a/doc/shared/sunlinsol/SUNLinSol_PCG.rst b/doc/shared/sunlinsol/SUNLinSol_PCG.rst index 80d7dd65ef..2d92a464ef 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 - ``SUNLinSolSolve_PCG``. + :c:func:`SUNLinSolSolve_PCG`. * ``SUNLinSolSetup_PCG`` diff --git a/doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst b/doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst index 57f5e792e7..0075fd9df3 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 - ``SUNLinSolSolve_SPBCGS``. + :c:func:`SUNLinSolSolve_SPBCGS`. * ``SUNLinSolSetup_SPBCGS`` diff --git a/doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst b/doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst index 293e6b9418..c978fdc91c 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 - ``SUNLinSolSolve_SPFGMR``. + :c:func:`SUNLinSolSolve_SPFGMR`. * ``SUNLinSolSetup_SPFGMR`` diff --git a/doc/shared/sunlinsol/SUNLinSol_SPGMR.rst b/doc/shared/sunlinsol/SUNLinSol_SPGMR.rst index 2f78bc29f3..90ce60fb44 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 - ``SUNLinSolSolve_SPGMR``. + :c:func:`SUNLinSolSolve_SPGMR`. * ``SUNLinSolSetup_SPGMR`` diff --git a/doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst b/doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst index 168ba7fd5c..566e5e239c 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 - ``SUNLinSolSolve_SPTFQMR``. + :c:func:`SUNLinSolSolve_SPTFQMR`. * ``SUNLinSolSetup_SPTFQMR`` diff --git a/doc/shared/sunmatrix/SUNMatrix_Description.rst b/doc/shared/sunmatrix/SUNMatrix_Description.rst index 11f69ab896..b74555c31d 100644 --- a/doc/shared/sunmatrix/SUNMatrix_Description.rst +++ b/doc/shared/sunmatrix/SUNMatrix_Description.rst @@ -34,74 +34,37 @@ 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. - -A :c:type:`SUNMatrix` is a pointer to the :c:struct:`_generic_SUNMatrix` -structure: +The type ``SUNMatrix`` is defined as: .. c:type:: struct _generic_SUNMatrix *SUNMatrix -.. c:struct:: _generic_SUNMatrix - - The structure defining the SUNDIALS matrix class. - - .. c:member:: void *content - - Pointer to matrix-specific member data - - .. 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` +and the generic structure is defined as - .. c:member:: void (*destroy)(SUNMatrix) - - The function implementing :c:func:`SUNMatDestroy` - - .. 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` +.. code-block:: c - .. c:member:: SUNErrCode (*matvec)(SUNMatrix, N_Vector, N_Vector) + struct _generic_SUNMatrix { + void *content; + struct _generic_SUNMatrix_Ops *ops; + }; - The function implementing :c:func:`SUNMatMatvec` +Here, the ``_generic_SUNMatrix_Ops`` structure is essentially a list of +function pointers to the various actual matrix operations, and is +defined as - .. c:member:: SUNErrCode (*space)(SUNMatrix, long int*, long int*) +.. code-block:: c - The function implementing :c:func:`SUNMatSpace` + 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*); + }; The generic SUNMATRIX module defines and implements the matrix @@ -155,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(SUNContext sunctx) +.. c:function:: SUNMatrix SUNMatNewEmpty() This function allocates a new generic ``SUNMatrix`` object and initializes its content pointer and the function pointers in the operations structure to ``NULL``. @@ -187,13 +150,11 @@ set and all operations are copied when cloning a matrix. * *A* -- the SUNMatrix object to free -.. 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. +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 899782dcbf..2a5c9e4cf0 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 ExecutionSpace::memory_space> + class MemorySpace = typename ExecSpace::memory_space> class DenseMatrix : public sundials::impl::BaseMatrix, public sundials::ConvertibleTo<SUNMatrix> @@ -108,18 +108,10 @@ In this section we list the public API of the ``sundials::kokkos::DenseMatrix`` class. .. cpp:class:: template<class ExeccutionSpace = Kokkos::DefaultExecutionSpace, \ - class MemorySpace = typename ExecutionSpace::memory_space> \ + class MemorySpace = typename ExecSpace::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. @@ -142,7 +134,7 @@ class. :param rows: number of matrix rows :param cols: number of matrix columns - :param ex: an execuation space + :param exec_space: a `ExecSpace` instance :param sunctx: the SUNDIALS simulation context object (:c:type:`SUNContext`) .. cpp:function:: DenseMatrix(size_type blocks, size_type block_rows, \ @@ -166,7 +158,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 exec_space: a `ExecSpace` instance :param sunctx: the SUNDIALS simulation context object (:c:type:`SUNContext`) .. cpp:function:: DenseMatrix(DenseMatrix&& that_matrix) noexcept @@ -241,7 +233,7 @@ class. Explicit conversion to a :c:type:`SUNMatrix`. .. cpp:function:: template<class ExecutionSpace = Kokkos::DefaultExecutionSpace, \ - class MemorySpace = typename ExecutionSpace::memory_space> \ + class MemorySpace = typename ExecSpace::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 89ce2505e8..2f623ed184 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, sunindextype NNZ) +.. c:function:: SUNErrCode SUNSparseMatrix_Reallocate(SUNMatrix A) 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 3499367c7b..40c9de73c6 100644 --- a/doc/shared/sunmemory/SUNMemory_Description.rst +++ b/doc/shared/sunmemory/SUNMemory_Description.rst @@ -22,25 +22,20 @@ This API consists of three new SUNDIALS types: :c:type:`SUNMemoryType`, .. c:type:: struct SUNMemory_ *SUNMemory - The ``SUNMemory`` type is a pointer the structure + 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 - .. c:struct:: SUNMemory_ + .. code-block:: c - .. c:member:: void* ptr; + struct SUNMemory_ + { + void* ptr; + SUNMemoryType type; + sunbooleantype own; + size_t bytes; + }; - 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) @@ -53,7 +48,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. @@ -64,40 +59,31 @@ This API consists of three new SUNDIALS types: :c:type:`SUNMemoryType`, The ``SUNMemoryType`` type is an enumeration that defines the supported memory types: - .. c:enumerator:: SUNMEMTYPE_HOST - - Pageable memory accessible on the host + .. code-block:: c - .. 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 + 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:type:: struct SUNMemoryHelper_ *SUNMemoryHelper - The ``SUNMemoryHelper`` type is a pointer to the structure - - .. c:struct:: SUNMemoryHelper_ - - .. c:member:: void* content; - - Pointer to the implementation-specific member data + 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 - .. c:member:: SUNMemoryHelper_Ops ops; + .. code-block:: c - A virtual method table of member functions - - .. c:member:: SUNContext sunctx; - - The SUNDIALS simulation context + struct SUNMemoryHelper_ + { + void* content; + SUNMemoryHelper_Ops ops; + SUNContext sunctx; + }; .. c:type:: struct SUNMemoryHelper_Ops_ *SUNMemoryHelper_Ops @@ -106,35 +92,26 @@ 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 - .. 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` + .. 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); + }; .. _SUNMemory.Description.Required: diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst index d169c83001..6a21325a19 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst @@ -41,19 +41,6 @@ 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) @@ -63,8 +50,15 @@ initialization (:c:func:`SUNNonlinSolInitialize`), setup * *NLS* -- a SUNNonlinSol object. **Return value:** - The :c:enum:`SUNNonlinearSolver_Type` type identifier for the nonlinear - solver. + 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`. + .. c:function:: SUNErrCode SUNNonlinSolInitialize(SUNNonlinearSolver NLS) @@ -506,90 +500,43 @@ 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. - -A :c:type:`SUNNonlinearSolver` is a pointer to the -:c:struct:`_generic_SUNNonlinearSolver` structure: +field. The type ``SUNNonlinearSolver`` is defined as follows: .. c:type:: struct _generic_SUNNonlinearSolver *SUNNonlinearSolver -.. c:struct:: _generic_SUNNonlinearSolver - - The structure defining the SUNDIALS nonlinear solver class. - - .. c:member:: void* content - - Pointer to nonlinear solver-specific member data - - .. 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) +and the generic structure is defined as - 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*) +.. code-block:: c - The function implementing :c:func:`SUNNonlinSolGetCurIter` + struct _generic_SUNNonlinearSolver { + void *content; + struct _generic_SUNNonlinearSolver_Ops *ops; + }; - .. c:member:: int (*getnumconvfails)(SUNNonlinearSolver, long int*) +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 - The function implementing :c:func:`SUNNonlinSolGetNumConvFails` +.. code-block:: c + 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 @@ -641,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(SUNContext sunctx) +.. c:function:: SUNNonlinearSolver SUNNonlinSolNewEmpty() This function allocates a new generic ``SUNNonlinearSolver`` object and initializes its content pointer and the function pointers in the operations diff --git a/src/sundials/fmod_int64/CMakeLists.txt b/doc/shared/versions.py similarity index 50% rename from src/sundials/fmod_int64/CMakeLists.txt rename to doc/shared/versions.py index 957328e8ff..1845394297 100644 --- a/src/sundials/fmod_int64/CMakeLists.txt +++ b/doc/shared/versions.py @@ -1,6 +1,4 @@ -# --------------------------------------------------------------- -# Programmer(s): Cody J. Balos @ LLNL -# --------------------------------------------------------------- +# ---------------------------------------------------------------- # SUNDIALS Copyright Start # Copyright (c) 2002-2024, Lawrence Livermore National Security # and Southern Methodist University. @@ -10,16 +8,13 @@ # # 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} -) +# ---------------------------------------------------------------- +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/sundials/biblio.bib b/doc/sundials/biblio.bib index b0470d62e6..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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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.1.0}}, +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 721acd879d..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.1.0} +\newcommand{\sunrelease}{v7.0.0} -\newcommand{\cvrelease}{v7.1.0} +\newcommand{\cvrelease}{v7.0.0} \newcommand{\cvucrlug}{UCRL-SM-208108} \newcommand{\cvucrlex}{UCRL-SM-208110} -\newcommand{\cvsrelease}{v7.1.0} +\newcommand{\cvsrelease}{v7.0.0} \newcommand{\cvsucrlug}{UCRL-SM-208111} \newcommand{\cvsucrlex}{UCRL-SM-208115} -\newcommand{\idarelease}{v7.1.0} +\newcommand{\idarelease}{v7.0.0} \newcommand{\idaucrlug}{UCRL-SM-208112} \newcommand{\idaucrlex}{UCRL-SM-208113} -\newcommand{\idasrelease}{v6.1.0} +\newcommand{\idasrelease}{v6.0.0} \newcommand{\idasucrlug}{UCRL-SM-234051} \newcommand{\idasucrlex}{LLNL-TR-437091} -\newcommand{\kinrelease}{v7.1.0} +\newcommand{\kinrelease}{v7.0.0} \newcommand{\kinucrlug}{UCRL-SM-208116} \newcommand{\kinucrlex}{UCRL-SM-208114} -\newcommand{\arkrelease}{v6.1.0} +\newcommand{\arkrelease}{v6.0.0} \newcommand{\arkucrlug}{LLNL-SM-668082} \newcommand{\arkucrlex}{????-??-??????} diff --git a/doc/superbuild/source/conf.py b/doc/superbuild/source/conf.py index b5c8189bac..ff7f57d7e8 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/sundials_vars.py'))) -from sundials_vars import * +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'))) # -- General configuration ---------------------------------------------------- diff --git a/doc/superbuild/source/developers/getting_started/Checklist.rst b/doc/superbuild/source/developers/getting_started/Checklist.rst index 3b9366fd95..c39432f85c 100644 --- a/doc/superbuild/source/developers/getting_started/Checklist.rst +++ b/doc/superbuild/source/developers/getting_started/Checklist.rst @@ -27,11 +27,10 @@ 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. -#. 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 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. #. Configure your build with a minimal set of configuration options enabled (serial). Run ``make``, ``make test``, ``make install``, and @@ -53,7 +52,8 @@ 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. + * Update the documentation to include descriptions of your work. Ensure that + the documentation also compiles (``make ug`` in the relevant directory). * 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/index.rst b/doc/superbuild/source/developers/index.rst index b0737c8792..f88f57bb12 100644 --- a/doc/superbuild/source/developers/index.rst +++ b/doc/superbuild/source/developers/index.rst @@ -34,7 +34,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/releases/Checklist.rst b/doc/superbuild/source/developers/releases/Checklist.rst index 37709c60e6..c9b5e1675c 100644 --- a/doc/superbuild/source/developers/releases/Checklist.rst +++ b/doc/superbuild/source/developers/releases/Checklist.rst @@ -73,7 +73,6 @@ 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 473409d987..7c7b84e0ae 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. +class functions (see :ref:`Style.Classes` for class naming conventions). C++ function names ------------------ @@ -176,17 +176,13 @@ 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 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>`_. + formatted with `clang-format <https://clang.llvm.org/docs/ClangFormat.html>`_. See :ref:`Style.Formatting` for details. #. Spaces not tabs. @@ -342,35 +338,6 @@ not adhere to all of these 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 - - [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: @@ -378,26 +345,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>`_. The +``.clang-format`` files in the root of the project define our configurations +for the tools respectively. To apply clang-format you can run: .. code-block:: shell ./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: @@ -453,4 +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. - 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/doc/superbuild/source/index.rst b/doc/superbuild/source/index.rst index 1d9fde63a7..a69c0c8ed7 100644 --- a/doc/superbuild/source/index.rst +++ b/doc/superbuild/source/index.rst @@ -183,12 +183,12 @@ SUNDIALS License and Notices :maxdepth: 1 :hidden: - contributing/index.rst developers/index.rst + contributing/index.rst .. toctree:: :caption: REFERENCES :maxdepth: 1 :hidden: - References + References \ No newline at end of file diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 55b1e52db4..bb9df6250f 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) @@ -31,19 +31,7 @@ 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() - -# 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") @@ -101,9 +89,9 @@ if(EXAMPLES_INSTALL) endif() -# =================================================================== +#---------------------------------------- # Add specific examples -# =================================================================== +#---------------------------------------- # Add ARKode examples if(BUILD_ARKODE) 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..a1f583cbd7 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 = ARKodeSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } + retval = ARKStepSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKStepSetOrder", 1)) { return 1; } /* Attach user data */ - retval = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData*", 1)) { return 1; } + retval = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKStepSetUserData*", 1)) { return 1; } /* Specify tolerances */ - retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = ARKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } /* Increase the max number of steps allowed between outputs */ - retval = ARKodeSetMaxNumSteps(arkode_mem, 100000); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } + retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); + if (check_retval(&retval, "ARKStepSetMaxNumSteps", 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 = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1)) { return 1; } + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 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 = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } /* Attach preconditioner */ - retval = ARKodeSetPreconditioner(arkode_mem, NULL, PSolve); - if (check_retval(&retval, "ARKodeSetPreconditioner", 1)) { return 1; } + retval = ARKStepSetPreconditioner(arkode_mem, NULL, PSolve); + if (check_retval(&retval, "ARKStepSetPreconditioner", 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 = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1)) { return 1; } + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKStepEvolve", 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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKodeGetNumStepAttempts", 1); + retval = ARKStepGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKStepGetNumSteps", 1); + retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKStepGetNumStepAttempts", 1); retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 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); + 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); if (uopt->global) { - retval = ARKodeGetNumLinIters(arkode_mem, &nli); - check_retval(&retval, "ARKodeGetNumLinIters", 1); - retval = ARKodeGetNumPrecSolves(arkode_mem, &npsol); - check_retval(&retval, "ARKodeGetNumPrecSolves", 1); + retval = ARKStepGetNumLinIters(arkode_mem, &nli); + check_retval(&retval, "ARKStepGetNumLinIters", 1); + retval = ARKStepGetNumPrecSolves(arkode_mem, &npsol); + check_retval(&retval, "ARKStepGetNumPrecSolves", 1); } /* Print final statistics */ @@ -366,7 +366,7 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, } /* Clean up */ - ARKodeFree(&arkode_mem); + ARKStepFree(&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 = ARKodeSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } + retval = ERKStepSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ERKStepSetOrder", 1)) { return 1; } /* Attach user data */ - retval = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = ERKStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ERKStepSetUserData", 1)) { return 1; } /* Specify tolerances */ - retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = ERKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ERKStepSStolerances", 1)) { return 1; } /* Increase the max number of steps allowed between outputs */ - retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } + retval = ERKStepSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ERKStepSetMaxNumSteps", 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = ERKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ERKStepEvolve", 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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKodeGetNumStepAttempts", 1); + retval = ERKStepGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ERKStepGetNumSteps", 1); + retval = ERKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ERKStepGetNumStepAttempts", 1); retval = ERKStepGetNumRhsEvals(arkode_mem, &nfe); check_retval(&retval, "ERKStepGetNumRhsEvals", 1); - retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ARKodeGetNumErrTestFails", 1); + retval = ERKStepGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ERKStepGetNumErrTestFails", 1); /* Print final statistics */ if (udata->myid == 0) @@ -456,7 +456,7 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata, } /* Clean up */ - ARKodeFree(&arkode_mem); + ERKStepFree(&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 = ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, - &gamma, &sdata, &user_data); - if (check_retval((void*)&retval, "ARKodeGetNonlinearSystemData", 1)) + retval = ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, + &gamma, &sdata, &user_data); + if (check_retval((void*)&retval, "ARKStepGetNonlinearSystemData", 1)) { return (-1); } @@ -956,9 +956,9 @@ int TaskLocalLSolve(N_Vector delta, void* arkode_mem) double tcur, gamma; void* user_data = NULL; - retval = ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, - &gamma, &sdata, &user_data); - if (check_retval((void*)&retval, "ARKodeGetNonlinearSystemData", 1)) + retval = ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, + &gamma, &sdata, &user_data); + if (check_retval((void*)&retval, "ARKStepGetNonlinearSystemData", 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 63108a9bd2..d70b4d680c 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp @@ -611,8 +611,16 @@ int main(int argc, char* argv[]) udata.evolve.start(); // Evolve - flag = ARKodeEvolve(arkode_mem, tout, u, &t, stepmode); - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + 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; } + } // Stop timer udata.evolve.stop(); @@ -670,14 +678,14 @@ int main(int argc, char* argv[]) switch (udata.integrator) { - case (0): ARKodeFree(&arkode_mem); break; + case (0): ARKStepFree(&arkode_mem); break; case (1): { void* inner_arkode_mem = NULL; MRIStepInnerStepper_GetContent(stepper, &inner_arkode_mem); - ARKodeFree(&inner_arkode_mem); + ARKStepFree(&inner_arkode_mem); MRIStepInnerStepper_Free(&stepper); - ARKodeFree(&arkode_mem); + MRIStepFree(&arkode_mem); break; } case (2): @@ -690,7 +698,7 @@ int main(int argc, char* argv[]) delete content; MRIStepInnerStepper_Free(&stepper); SUNNonlinSolFree(NLS); - ARKodeFree(&arkode_mem); + MRIStepFree(&arkode_mem); break; } default: cerr << "Invalid integrator option" << endl; break; @@ -920,51 +928,51 @@ static int SetupARK(SUNContext ctx, UserData* udata, N_Vector u, if (check_flag((void*)*arkode_mem, "ARKStepCreate", 0)) { return 1; } // Specify tolerances - flag = ARKodeSStolerances(*arkode_mem, udata->rtol_imex, udata->atol_imex); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(*arkode_mem, udata->rtol_imex, udata->atol_imex); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } // Attach user data - flag = ARKodeSetUserData(*arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(*arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } if (udata->diffusion) { // Attach linear solver - flag = ARKodeSetLinearSolver(*arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(*arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } if (udata->prec) { // Attach preconditioner - flag = ARKodeSetPreconditioner(*arkode_mem, NULL, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } + flag = ARKStepSetPreconditioner(*arkode_mem, NULL, PSolve); + if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKodeSetLSetupFrequency(*arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } + flag = ARKStepSetLSetupFrequency(*arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKodeSetEpsLin(*arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + flag = ARKStepSetEpsLin(*arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = ARKodeSetLinear(*arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(*arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } } } // Select method order - flag = ARKodeSetOrder(*arkode_mem, udata->order_imex); - if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } + flag = ARKStepSetOrder(*arkode_mem, udata->order_imex); + if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } // Set fixed step size or adaptivity method if (udata->h_imex > ZERO) { - flag = ARKodeSetFixedStep(*arkode_mem, udata->h_imex); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = ARKStepSetFixedStep(*arkode_mem, udata->h_imex); + if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } } else { @@ -977,17 +985,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 = ARKodeSetAdaptController(*arkode_mem, *Ctrl); - if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } + flag = ARKStepSetAdaptController(*arkode_mem, *Ctrl); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) { return 1; } } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(*arkode_mem, udata->maxsteps); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKStepSetMaxNumSteps(*arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKodeSetStopTime(*arkode_mem, udata->tf); - if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = ARKStepSetStopTime(*arkode_mem, udata->tf); + if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } return 0; } @@ -1007,22 +1015,23 @@ static int SetupMRI(SUNContext ctx, UserData* udata, N_Vector y, if (check_flag((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } // Specify tolerances - flag = ARKodeSStolerances(inner_arkode_mem, udata->rtol_fast, udata->atol_fast); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(inner_arkode_mem, udata->rtol_fast, + udata->atol_fast); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } // Attach user data - flag = ARKodeSetUserData(inner_arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(inner_arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } // Select method order - flag = ARKodeSetOrder(inner_arkode_mem, udata->order_fast); - if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } + flag = ARKStepSetOrder(inner_arkode_mem, udata->order_fast); + if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } // Set fixed step size or adaptivity method if (udata->h_fast > ZERO) { - flag = ARKodeSetFixedStep(inner_arkode_mem, udata->h_fast); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = ARKStepSetFixedStep(inner_arkode_mem, udata->h_fast); + if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } } else { @@ -1035,13 +1044,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 = ARKodeSetAdaptController(inner_arkode_mem, *Ctrl); - if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } + flag = ARKStepSetAdaptController(inner_arkode_mem, *Ctrl); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) { return 1; } } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(inner_arkode_mem, udata->maxsteps); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKStepSetMaxNumSteps(inner_arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } // Wrap ARKODE as an MRIStepInnerStepper flag = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, stepper); @@ -1066,50 +1075,50 @@ static int SetupMRI(SUNContext ctx, UserData* udata, N_Vector y, MRIStepCoupling_Free(C); // Set the slow step size - flag = ARKodeSetFixedStep(*arkode_mem, udata->h_slow); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = MRIStepSetFixedStep(*arkode_mem, udata->h_slow); + if (check_flag(&flag, "MRIStepSetFixedStep", 1)) { return 1; } // Specify tolerances - flag = ARKodeSStolerances(*arkode_mem, udata->rtol_slow, udata->atol_slow); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = MRIStepSStolerances(*arkode_mem, udata->rtol_slow, udata->atol_slow); + if (check_flag(&flag, "MRIStepSStolerances", 1)) { return 1; } // Attach user data - flag = ARKodeSetUserData(*arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = MRIStepSetUserData(*arkode_mem, (void*)udata); + if (check_flag(&flag, "MRIStepSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(*arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = MRIStepSetLinearSolver(*arkode_mem, LS, NULL); + if (check_flag(&flag, "MRIStepSetLinearSolver", 1)) { return 1; } if (udata->prec) { // Attach preconditioner - flag = ARKodeSetPreconditioner(*arkode_mem, NULL, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } + flag = MRIStepSetPreconditioner(*arkode_mem, NULL, PSolve); + if (check_flag(&flag, "MRIStepSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKodeSetLSetupFrequency(*arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } + flag = MRIStepSetLSetupFrequency(*arkode_mem, udata->msbp); + if (check_flag(&flag, "MRIStepSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKodeSetEpsLin(*arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + flag = MRIStepSetEpsLin(*arkode_mem, udata->epslin); + if (check_flag(&flag, "MRIStepSetEpsLin", 1)) { return 1; } // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = ARKodeSetLinear(*arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = MRIStepSetLinear(*arkode_mem, 0); + if (check_flag(&flag, "MRIStepSetLinear", 1)) { return 1; } } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(*arkode_mem, udata->maxsteps); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = MRIStepSetMaxNumSteps(*arkode_mem, udata->maxsteps); + if (check_flag(&flag, "MRIStepSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKodeSetStopTime(*arkode_mem, udata->tf); - if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = MRIStepSetStopTime(*arkode_mem, udata->tf); + if (check_flag(&flag, "MRIStepSetStopTime", 1)) { return 1; } return 0; } @@ -1210,50 +1219,50 @@ static int SetupMRICVODE(SUNContext ctx, UserData* udata, N_Vector y, MRIStepCoupling_Free(C); // Set the slow step size - flag = ARKodeSetFixedStep(*arkode_mem, udata->h_slow); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = MRIStepSetFixedStep(*arkode_mem, udata->h_slow); + if (check_flag(&flag, "MRIStepSetFixedStep", 1)) { return 1; } // Specify tolerances - flag = ARKodeSStolerances(*arkode_mem, udata->rtol_slow, udata->atol_slow); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = MRIStepSStolerances(*arkode_mem, udata->rtol_slow, udata->atol_slow); + if (check_flag(&flag, "MRIStepSStolerances", 1)) { return 1; } // Attach user data - flag = ARKodeSetUserData(*arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = MRIStepSetUserData(*arkode_mem, (void*)udata); + if (check_flag(&flag, "MRIStepSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(*arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = MRIStepSetLinearSolver(*arkode_mem, LS, NULL); + if (check_flag(&flag, "MRIStepSetLinearSolver", 1)) { return 1; } if (udata->prec) { // Attach preconditioner - flag = ARKodeSetPreconditioner(*arkode_mem, NULL, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } + flag = MRIStepSetPreconditioner(*arkode_mem, NULL, PSolve); + if (check_flag(&flag, "MRIStepSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKodeSetLSetupFrequency(*arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } + flag = MRIStepSetLSetupFrequency(*arkode_mem, udata->msbp); + if (check_flag(&flag, "MRIStepSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKodeSetEpsLin(*arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + flag = MRIStepSetEpsLin(*arkode_mem, udata->epslin); + if (check_flag(&flag, "MRIStepSetEpsLin", 1)) { return 1; } // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = ARKodeSetLinear(*arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = MRIStepSetLinear(*arkode_mem, 0); + if (check_flag(&flag, "MRIStepSetLinear", 1)) { return 1; } } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(*arkode_mem, udata->maxsteps); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = MRIStepSetMaxNumSteps(*arkode_mem, udata->maxsteps); + if (check_flag(&flag, "MRIStepSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKodeSetStopTime(*arkode_mem, udata->tf); - if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = MRIStepSetStopTime(*arkode_mem, udata->tf); + if (check_flag(&flag, "MRIStepSetStopTime", 1)) { return 1; } return 0; } @@ -2594,31 +2603,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 = 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } if (udata->diffusion) { - 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; } + 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; } } cout << fixed; @@ -2654,10 +2663,10 @@ static int OutputStatsIMEX(void* arkode_mem, UserData* udata) if (udata->prec) { long int npe, nps; - 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; } + 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; } cout << " Preconditioner setups = " << npe << endl; cout << " Preconditioner solves = " << nps << endl; @@ -2676,24 +2685,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 = ARKodeGetNumSteps(arkode_mem, &nsts); - if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } + flag = MRIStepGetNumSteps(arkode_mem, &nsts); + if (check_flag(&flag, "MRIStepGetNumSteps", 1)) { return -1; } flag = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); if (check_flag(&flag, "MRIStepGetNumRhsEvals", 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; } + 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; } cout << fixed; cout << setprecision(6); @@ -2722,10 +2731,10 @@ static int OutputStatsMRI(void* arkode_mem, MRIStepInnerStepper stepper, if (udata->prec) { long int npe, nps; - 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; } + 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; } cout << " Preconditioner setups = " << npe << endl; cout << " Preconditioner solves = " << nps << endl; @@ -2738,12 +2747,12 @@ static int OutputStatsMRI(void* arkode_mem, MRIStepInnerStepper stepper, long int nstf, nstf_a, netff, nffe, nffi; - 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 = 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 = ARKStepGetNumRhsEvals(inner_arkode_mem, &nffe, &nffi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } @@ -2764,24 +2773,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 = ARKodeGetNumSteps(arkode_mem, &nsts); - if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } + flag = MRIStepGetNumSteps(arkode_mem, &nsts); + if (check_flag(&flag, "MRIStepGetNumSteps", 1)) { return -1; } flag = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); if (check_flag(&flag, "MRIStepGetNumRhsEvals", 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; } + 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; } cout << fixed; cout << setprecision(6); @@ -2810,10 +2819,10 @@ static int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper stepper, if (udata->prec) { long int npe, nps; - 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; } + 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; } 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 566a7a4b41..5c1a264c8f 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 ARKODE settings. Use the flag --help for more information. + * and ARKStep settings. Use the flag --help for more information. * ---------------------------------------------------------------------------*/ #include <cmath> @@ -382,7 +382,7 @@ int main(int argc, char* argv[]) } // -------------- - // Setup ARKODE + // Setup ARKStep // -------------- // 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 = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } // Attach user data - flag = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } if (udata->prec) { // Attach preconditioner - flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } + flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKodeSetLSetupFrequency(arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } + flag = ARKStepSetLSetupFrequency(arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKodeSetEpsLin(arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + flag = ARKStepSetEpsLin(arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKStepSetEpsLin", 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; } + flag = ARKStepSetOrder(arkode_mem, udata->order); + if (check_flag(&flag, "ARKStepSetOrder", 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 = ARKodeSetFixedStep(arkode_mem, udata->hfixed); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = ARKStepSetFixedStep(arkode_mem, udata->hfixed); + if (check_flag(&flag, "ARKStepSetFixedStep", 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 = ARKodeSetAdaptController(arkode_mem, C); - if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) { return 1; } } // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(arkode_mem, udata->maxsteps); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKStepSetMaxNumSteps(arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKodeSetStopTime(arkode_mem, udata->tf); - if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = ARKStepSetStopTime(arkode_mem, udata->tf); + if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } // ----------------------- // Loop over output times @@ -499,8 +499,8 @@ int main(int argc, char* argv[]) t1 = MPI_Wtime(); // Evolve in time - flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } // Stop timer t2 = MPI_Wtime(); @@ -560,10 +560,10 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKodeFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKStepFree(&arkode_mem); // Free integrator memory + SUNLinSolFree(LS); // Free linear solver + N_VDestroy(u); // Free vectors + FreeUserData(udata); // Free user data delete udata; (void)SUNAdaptController_Destroy(C); // Free timestep adaptivity controller SUNContext_Free(&ctx); // Free context @@ -1720,8 +1720,8 @@ static int OpenOutput(UserData* udata) static int WriteOutput(sunrealtype t, N_Vector u, UserData* udata) { int flag; - sunrealtype max = ZERO; - bool outproc = (udata->myid_c == 0); + sunrealtype max; + bool outproc = (udata->myid_c == 0); if (udata->output > 0) { @@ -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 = 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 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; } + 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; } 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 = 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; } + 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; } 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 d5cb124652..7b2031e540 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 ARKODE settings. Use the flag --help + * to change the problem parameters and ARKStep 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 ARKODE + // Setup ARKStep // -------------- // Create integrator @@ -447,38 +447,60 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } // Specify tolerances - flag = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } // Attach user data - flag = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(arkode_mem, LS, A); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, A); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } // Specify the Jacobian evaluation function - flag = ARKodeSetJacFn(arkode_mem, Jac); - if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } + flag = ARKStepSetJacFn(arkode_mem, Jac); + if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } // Set linear solver setup frequency (update linear system matrix) - flag = ARKodeSetLSetupFrequency(arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } + flag = ARKStepSetLSetupFrequency(arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } // Set linear solver tolerance factor - flag = ARKodeSetEpsLin(arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + flag = ARKStepSetEpsLin(arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } - // Use an ARKode provided table - flag = ARKodeSetOrder(arkode_mem, udata->order); - if (check_flag(&flag, "ARKodeSetOrder", 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; } + } + 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); + } // 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; } + flag = ARKStepSetFixedStep(arkode_mem, udata->hfixed); + if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } } else { @@ -491,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 = ARKodeSetAdaptController(arkode_mem, C); - if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) { return 1; } } // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(arkode_mem, udata->maxsteps); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKStepSetMaxNumSteps(arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKodeSetStopTime(arkode_mem, udata->tf); - if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = ARKStepSetStopTime(arkode_mem, udata->tf); + if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } // ----------------------- // Loop over output times @@ -531,8 +553,8 @@ int main(int argc, char* argv[]) t1 = MPI_Wtime(); // Evolve in time - flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } // Stop timer t2 = MPI_Wtime(); @@ -592,11 +614,11 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - 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 + 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 delete udata; (void)SUNAdaptController_Destroy(C); // Free time adaptivity controller SUNContext_Free(&ctx); // Free context @@ -1998,8 +2020,8 @@ static int OpenOutput(UserData* udata) static int WriteOutput(sunrealtype t, N_Vector u, UserData* udata) { int flag; - sunrealtype max = ZERO; - bool outproc = (udata->myid_c == 0); + sunrealtype max; + bool outproc = (udata->myid_c == 0); if (udata->output > 0) { @@ -2098,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 = 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 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; } + 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; } 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 2582758ef7..eeb61d0af4 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 ARKODE settings. Use the flag --help + * to change the problem parameters and ARKStep settings. Use the flag --help * for more information. * ---------------------------------------------------------------------------*/ @@ -412,7 +412,7 @@ int main(int argc, char* argv[]) } // -------------- - // Setup ARKODE + // Setup ARKStep // -------------- // 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 = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } // Attach user data - flag = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } if (udata->matvec) { // Attach Jacobian-vector product function - flag = ARKodeSetJacTimes(arkode_mem, NULL, JTimes); - if (check_flag(&flag, "ARKodeSetJacTimes", 1)) { return 1; } + flag = ARKStepSetJacTimes(arkode_mem, NULL, JTimes); + if (check_flag(&flag, "ARKStepSetJacTimes", 1)) { return 1; } } if (udata->prec) { // Attach preconditioner - flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } + flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKodeSetLSetupFrequency(arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } + flag = ARKStepSetLSetupFrequency(arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKodeSetEpsLin(arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + flag = ARKStepSetEpsLin(arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKStepSetEpsLin", 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; } + flag = ARKStepSetOrder(arkode_mem, udata->order); + if (check_flag(&flag, "ARKStepSetOrder", 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 = ARKodeSetFixedStep(arkode_mem, udata->hfixed); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = ARKStepSetFixedStep(arkode_mem, udata->hfixed); + if (check_flag(&flag, "ARKStepSetFixedStep", 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 = ARKodeSetAdaptController(arkode_mem, C); - if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) { return 1; } } // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(arkode_mem, udata->maxsteps); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKStepSetMaxNumSteps(arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKodeSetStopTime(arkode_mem, udata->tf); - if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = ARKStepSetStopTime(arkode_mem, udata->tf); + if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } // ----------------------- // Loop over output times @@ -536,8 +536,8 @@ int main(int argc, char* argv[]) t1 = MPI_Wtime(); // Evolve in time - flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } // Stop timer t2 = MPI_Wtime(); @@ -597,10 +597,10 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKodeFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKStepFree(&arkode_mem); // Free integrator memory + SUNLinSolFree(LS); // Free linear solver + N_VDestroy(u); // Free vectors + FreeUserData(udata); // Free user data delete udata; (void)SUNAdaptController_Destroy(C); // Free timestep adaptivity controller SUNContext_Free(&ctx); // Free context @@ -2534,8 +2534,8 @@ static int OpenOutput(UserData* udata) static int WriteOutput(sunrealtype t, N_Vector u, UserData* udata) { int flag; - sunrealtype max = ZERO; - bool outproc = (udata->myid_c == 0); + sunrealtype max; + bool outproc = (udata->myid_c == 0); if (udata->output > 0) { @@ -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 = 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 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; } + 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; } 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 = 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; } + 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; } 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 8410570911..b36045a68d 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 ARKODE settings. Use the flag --help for + * change the problem parameters and ARKStep settings. Use the flag --help for * more information. * ---------------------------------------------------------------------------*/ @@ -391,7 +391,7 @@ int main(int argc, char* argv[]) } // ---------------------------------------------- - // Setup ARKODE integrator and set options + // Setup ARKStep integrator and set options // ---------------------------------------------- // Create integrator @@ -407,37 +407,37 @@ int main(int argc, char* argv[]) } // Specify tolerances - flag = ARKodeSStolerances(arkode_mem, udata.rtol, udata.atol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkode_mem, udata.rtol, udata.atol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } if (udata.prectype != SUN_PREC_NONE) { // Attach preconditioner - flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } + flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } // Set max steps between linear solver (preconditioner) setup calls - flag = ARKodeSetLSetupFrequency(arkode_mem, udata.msbp); - if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } + flag = ARKStepSetLSetupFrequency(arkode_mem, udata.msbp); + if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKodeSetEpsLin(arkode_mem, udata.epslin); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + flag = ARKStepSetEpsLin(arkode_mem, udata.epslin); + if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } // Use an ARKode provided table - flag = ARKodeSetOrder(arkode_mem, udata.order); - if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } + flag = ARKStepSetOrder(arkode_mem, udata.order); + if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } // Set fixed step size or adaptivity method if (udata.hf > ZERO) { - flag = ARKodeSetFixedStep(arkode_mem, udata.hf); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = ARKStepSetFixedStep(arkode_mem, udata.hf); + if (check_flag(&flag, "ARKStepSetFixedStep", 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 = ARKodeSetAdaptController(arkode_mem, C); - if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) { return 1; } } // Specify linearly implicit non-time-dependent RHS if (udata.linear) { - flag = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } } // Attach user data - flag = ARKodeSetUserData(arkode_mem, &udata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(arkode_mem, &udata); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(arkode_mem, udata.maxsteps); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKStepSetMaxNumSteps(arkode_mem, udata.maxsteps); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKodeSetStopTime(arkode_mem, udata.tf); - if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = ARKStepSetStopTime(arkode_mem, udata.tf); + if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } // ----------------------- // Loop over output times @@ -494,8 +494,8 @@ int main(int argc, char* argv[]) t1 = MPI_Wtime(); // Evolve in time - flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } // Stop timer t2 = MPI_Wtime(); @@ -539,7 +539,7 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKodeFree(&arkode_mem); // Free integrator memory + ARKStepFree(&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 = 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 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; } + 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; } 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 = 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; } + 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; } 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 1f90ddcc7a..9cd4b0eab9 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 ARKODE settings. Use the flag + * available to change the problem parameters and ARKStep 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 = ARKodeSStolerances(inner_arkode_mem, udata.rtol, udata.atol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(inner_arkode_mem, udata.rtol, udata.atol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(inner_arkode_mem, LSf, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(inner_arkode_mem, LSf, NULL); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } // Set linear solver tolerance factor - flag = ARKodeSetEpsLin(inner_arkode_mem, udata.epslin); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + flag = ARKStepSetEpsLin(inner_arkode_mem, udata.epslin); + if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } // Use an ARKode provided table - flag = ARKodeSetOrder(inner_arkode_mem, udata.forder); - if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } + flag = ARKStepSetOrder(inner_arkode_mem, udata.forder); + if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } // Set fixed step size or adaptivity method if (udata.hf > ZERO) { - flag = ARKodeSetFixedStep(inner_arkode_mem, udata.hf); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = ARKStepSetFixedStep(inner_arkode_mem, udata.hf); + if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } } else { @@ -447,17 +447,17 @@ int main(int argc, char* argv[]) Ctrl = SUNAdaptController_ImExGus(sunctx); break; } - flag = ARKodeSetAdaptController(inner_arkode_mem, Ctrl); - if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } + flag = ARKStepSetAdaptController(inner_arkode_mem, Ctrl); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) { return 1; } } // Attach user data - flag = ARKodeSetUserData(inner_arkode_mem, &udata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(inner_arkode_mem, &udata); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(inner_arkode_mem, udata.maxsteps); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKStepSetMaxNumSteps(inner_arkode_mem, udata.maxsteps); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 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 = ARKodeSStolerances(arkode_mem, udata.rtol, udata.atol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = MRIStepSStolerances(arkode_mem, udata.rtol, udata.atol); + if (check_flag(&flag, "MRIStepSStolerances", 1)) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = MRIStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "MRIStepSetLinearSolver", 1)) { return 1; } if (udata.prectype != SUN_PREC_NONE) { // Attach preconditioner - flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } + flag = MRIStepSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "MRIStepSetPreconditioner", 1)) { return 1; } // Set max steps between linear solver (preconditioner) setup calls - flag = ARKodeSetLSetupFrequency(arkode_mem, udata.msbp); - if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } + flag = MRIStepSetLSetupFrequency(arkode_mem, udata.msbp); + if (check_flag(&flag, "MRIStepSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKodeSetEpsLin(arkode_mem, udata.epslin); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + flag = MRIStepSetEpsLin(arkode_mem, udata.epslin); + if (check_flag(&flag, "MRIStepSetEpsLin", 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 = ARKodeSetFixedStep(arkode_mem, udata.hs); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = MRIStepSetFixedStep(arkode_mem, udata.hs); + if (check_flag(&flag, "MRIStepSetFixedStep", 1)) { return 1; } // Specify linearly implicit non-time-dependent RHS if (udata.linear) { - flag = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = MRIStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "MRIStepSetLinear", 1)) { return 1; } } // Attach user data - flag = ARKodeSetUserData(arkode_mem, &udata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = MRIStepSetUserData(arkode_mem, &udata); + if (check_flag(&flag, "MRIStepSetUserData", 1)) { return 1; } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(arkode_mem, udata.maxsteps); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = MRIStepSetMaxNumSteps(arkode_mem, udata.maxsteps); + if (check_flag(&flag, "MRIStepSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKodeSetStopTime(arkode_mem, udata.tf); - if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = MRIStepSetStopTime(arkode_mem, udata.tf); + if (check_flag(&flag, "MRIStepSetStopTime", 1)) { return 1; } // ----------------------- // Loop over output times @@ -556,8 +556,8 @@ int main(int argc, char* argv[]) t1 = MPI_Wtime(); // Evolve in time - flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = MRIStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "MRIStepEvolve", 1)) { break; } // Stop timer t2 = MPI_Wtime(); @@ -605,8 +605,8 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKodeFree(&arkode_mem); // Free slow integrator memory - ARKodeFree(&inner_arkode_mem); // Free fast integrator memory + MRIStepFree(&arkode_mem); // Free slow integrator memory + ARKStepFree(&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 = 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 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; } + 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; } 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 = 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; } + 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; } 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 = ARKodeGetNumSteps(arkode_mem, &nst); - if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } + flag = MRIStepGetNumSteps(arkode_mem, &nst); + if (check_flag(&flag, "MRIStepGetNumSteps", 1)) { return -1; } flag = MRIStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "MRIStepGetNumRhsEvals", 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; } + 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; } 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 = 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; } + 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; } 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 9afe3e1ac3..fc403e7404 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 // -------------------- - // ARKODE memory structure + // ERKStep, ARKStep, or MRIStep memory structure void* arkode_mem = nullptr; // Matrix and linear solver for DIRK, IMEX, or MRI slow integrators @@ -234,16 +234,55 @@ int main(int argc, char* argv[]) for (int iout = 0; iout < uopts.nout; iout++) { // Evolve - if (uopts.output == 3) + switch (uopts.integrator) { - // Stop at output time (do not interpolate output) - flag = ARKodeSetStopTime(arkode_mem, tout); - if (check_flag(flag, "ARKodeSetStopTime")) { return 1; } + 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; } - - // Advance in time - flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_flag(flag, "ARKodeEvolve")) { break; } + if (check_flag(flag, "Evolve")) { break; } // Output solution flag = WriteOutput(t, y, udata, uopts); @@ -282,15 +321,15 @@ int main(int argc, char* argv[]) switch (uopts.integrator) { - case (0): ARKodeFree(&arkode_mem); break; - case (1): ARKodeFree(&arkode_mem); break; + case (0): ERKStepFree(&arkode_mem); break; + case (1): ARKStepFree(&arkode_mem); break; case (2): { void* inner_arkode_mem = nullptr; MRIStepInnerStepper_GetContent(fast_mem, &inner_arkode_mem); - ARKodeFree(&inner_arkode_mem); + ARKStepFree(&inner_arkode_mem); MRIStepInnerStepper_Free(&fast_mem); - ARKodeFree(&arkode_mem); + MRIStepFree(&arkode_mem); break; } case (3): @@ -301,7 +340,7 @@ int main(int argc, char* argv[]) CVodeFree(&(content->cvode_mem)); delete content; MRIStepInnerStepper_Free(&fast_mem); - ARKodeFree(&arkode_mem); + MRIStepFree(&arkode_mem); break; } } @@ -352,22 +391,22 @@ int SetupERK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, if (check_ptr(arkode_mem, "ERKStepCreate")) { return 1; } // Specify tolerances - int flag = ARKodeSStolerances(*arkode_mem, uopts.rtol, uopts.atol); - if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + int flag = ERKStepSStolerances(*arkode_mem, uopts.rtol, uopts.atol); + if (check_flag(flag, "ERKStepSStolerances")) { return 1; } // Attach user data - flag = ARKodeSetUserData(*arkode_mem, &udata); - if (check_flag(flag, "ARKodeSetUserData")) { return 1; } + flag = ERKStepSetUserData(*arkode_mem, &udata); + if (check_flag(flag, "ERKStepSetUserData")) { return 1; } // Select method order - flag = ARKodeSetOrder(*arkode_mem, uopts.order); - if (check_flag(flag, "ARKodeSetOrder")) { return 1; } + flag = ERKStepSetOrder(*arkode_mem, uopts.order); + if (check_flag(flag, "ERKStepSetOrder")) { 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; } + flag = ERKStepSetFixedStep(*arkode_mem, uopts.fixed_h); + if (check_flag(flag, "ERKStepSetFixedStep")) { return 1; } } else if (uopts.controller >= 0) { @@ -380,17 +419,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 = ARKodeSetAdaptController(*arkode_mem, *C); - if (check_flag(flag, "ARKodeSetAdaptController")) { return 1; } + flag = ERKStepSetAdaptController(*arkode_mem, *C); + if (check_flag(flag, "ERKStepSetAdaptController")) { return 1; } } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(*arkode_mem, uopts.maxsteps); - if (check_flag(flag, "ARKodeSetMaxNumSteps")) { return 1; } + flag = ERKStepSetMaxNumSteps(*arkode_mem, uopts.maxsteps); + if (check_flag(flag, "ERKStepSetMaxNumSteps")) { return 1; } // Set stopping time - flag = ARKodeSetStopTime(*arkode_mem, udata.tf); - if (check_flag(flag, "ARKodeSetStopTime")) { return 1; } + flag = ERKStepSetStopTime(*arkode_mem, udata.tf); + if (check_flag(flag, "ERKStepSetStopTime")) { return 1; } return 0; } @@ -544,12 +583,12 @@ int SetupARK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, if (check_ptr(arkode_mem, "ARKStepCreate")) { return 1; } // Specify tolerances - int flag = ARKodeSStolerances(*arkode_mem, uopts.rtol, uopts.atol); - if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + int flag = ARKStepSStolerances(*arkode_mem, uopts.rtol, uopts.atol); + if (check_flag(flag, "ARKStepSStolerances")) { return 1; } // Attach user data - flag = ARKodeSetUserData(*arkode_mem, &udata); - if (check_flag(flag, "ARKodeSetUserData")) { return 1; } + flag = ARKStepSetUserData(*arkode_mem, &udata); + if (check_flag(flag, "ARKStepSetUserData")) { return 1; } // If implicit, setup solvers if (fi_RHS) @@ -563,26 +602,26 @@ int SetupARK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, if (check_ptr(*LS, "SUNLinSol_Band")) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(*arkode_mem, *LS, *A); - if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } + flag = ARKStepSetLinearSolver(*arkode_mem, *LS, *A); + if (check_flag(flag, "ARKStepSetLinearSolver")) { return 1; } // Attach Jacobian function - flag = ARKodeSetJacFn(*arkode_mem, Ji_RHS); - if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } + flag = ARKStepSetJacFn(*arkode_mem, Ji_RHS); + if (check_flag(flag, "ARKStepSetJacFn")) { return 1; } // Set the predictor method - flag = ARKodeSetPredictorMethod(*arkode_mem, uopts.predictor); - if (check_flag(flag, "ARKodeSetPredictorMethod")) { return 1; } + flag = ARKStepSetPredictorMethod(*arkode_mem, uopts.predictor); + if (check_flag(flag, "ARKStepSetPredictorMethod")) { return 1; } // Set linear solver setup frequency - flag = ARKodeSetLSetupFrequency(*arkode_mem, uopts.ls_setup_freq); - if (check_flag(flag, "ARKodeSetLSetupFrequency")) { return 1; } + flag = ARKStepSetLSetupFrequency(*arkode_mem, uopts.ls_setup_freq); + if (check_flag(flag, "ARKStepSetLSetupFrequency")) { return 1; } if (uopts.linear) { // Specify linearly implicit non-time-dependent RHS - flag = ARKodeSetLinear(*arkode_mem, SUNFALSE); - if (check_flag(flag, "ARKodeSetLinear")) { return 1; } + flag = ARKStepSetLinear(*arkode_mem, SUNFALSE); + if (check_flag(flag, "ARKStepSetLinear")) { return 1; } } } @@ -614,15 +653,15 @@ int SetupARK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, else { // Select default method of a given order - flag = ARKodeSetOrder(*arkode_mem, uopts.order); - if (check_flag(flag, "ARKodeSetOrder")) { return 1; } + flag = ARKStepSetOrder(*arkode_mem, uopts.order); + if (check_flag(flag, "ARKStepSetOrder")) { 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; } + flag = ARKStepSetFixedStep(*arkode_mem, uopts.fixed_h); + if (check_flag(flag, "ARKStepSetFixedStep")) { return 1; } } else if (uopts.controller >= 0) { @@ -635,17 +674,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 = ARKodeSetAdaptController(*arkode_mem, *C); - if (check_flag(flag, "ARKodeSetAdaptController")) { return 1; } + flag = ARKStepSetAdaptController(*arkode_mem, *C); + if (check_flag(flag, "ARKStepSetAdaptController")) { return 1; } } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(*arkode_mem, uopts.maxsteps); - if (check_flag(flag, "ARKodeSetMaxNumSteps")) { return 1; } + flag = ARKStepSetMaxNumSteps(*arkode_mem, uopts.maxsteps); + if (check_flag(flag, "ARKStepSetMaxNumSteps")) { return 1; } // Set stopping time - flag = ARKodeSetStopTime(*arkode_mem, udata.tf); - if (check_flag(flag, "ARKodeSetStopTime")) { return 1; } + flag = ARKStepSetStopTime(*arkode_mem, udata.tf); + if (check_flag(flag, "ARKStepSetStopTime")) { return 1; } return 0; } @@ -717,13 +756,13 @@ int SetupMRIARK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, if (check_ptr(arkode_mem, "ARKStepCreate")) { return 1; } // Specify tolerances - int flag = ARKodeSStolerances(fast_arkode_mem, uopts.rtol_fast, - uopts.atol_fast); - if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + int flag = ARKStepSStolerances(fast_arkode_mem, uopts.rtol_fast, + uopts.atol_fast); + if (check_flag(flag, "ARKStepSStolerances")) { return 1; } // Attach user data - flag = ARKodeSetUserData(fast_arkode_mem, &udata); - if (check_flag(flag, "ARKodeSetUserData")) { return 1; } + flag = ARKStepSetUserData(fast_arkode_mem, &udata); + if (check_flag(flag, "ARKStepSetUserData")) { return 1; } // If implicit, setup solvers if (ffi_RHS) @@ -737,31 +776,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 = ARKodeSetLinearSolver(fast_arkode_mem, *LS_fast, *A_fast); - if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } + flag = ARKStepSetLinearSolver(fast_arkode_mem, *LS_fast, *A_fast); + if (check_flag(flag, "ARKStepSetLinearSolver")) { return 1; } // Attach Jacobian function - flag = ARKodeSetJacFn(fast_arkode_mem, Jfi_RHS); - if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } + flag = ARKStepSetJacFn(fast_arkode_mem, Jfi_RHS); + if (check_flag(flag, "ARKStepSetJacFn")) { return 1; } // Set the predictor method - flag = ARKodeSetPredictorMethod(fast_arkode_mem, uopts.predictor_fast); - if (check_flag(flag, "ARKodeSetPredictorMethod")) { return 1; } + flag = ARKStepSetPredictorMethod(fast_arkode_mem, uopts.predictor_fast); + if (check_flag(flag, "ARKStepSetPredictorMethod")) { return 1; } // Set linear solver setup frequency - flag = ARKodeSetLSetupFrequency(fast_arkode_mem, uopts.ls_setup_freq_fast); - if (check_flag(flag, "ARKodeSetLSetupFrequency")) { return 1; } + flag = ARKStepSetLSetupFrequency(fast_arkode_mem, uopts.ls_setup_freq_fast); + if (check_flag(flag, "ARKStepSetLSetupFrequency")) { return 1; } } // Select method order - flag = ARKodeSetOrder(fast_arkode_mem, uopts.order_fast); - if (check_flag(flag, "ARKodeSetOrder")) { return 1; } + flag = ARKStepSetOrder(fast_arkode_mem, uopts.order_fast); + if (check_flag(flag, "ARKStepSetOrder")) { return 1; } // Set fixed step size or adaptivity method if (uopts.fixed_h_fast > ZERO) { - flag = ARKodeSetFixedStep(fast_arkode_mem, uopts.fixed_h_fast); - if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + flag = ARKStepSetFixedStep(fast_arkode_mem, uopts.fixed_h_fast); + if (check_flag(flag, "ARKStepSetFixedStep")) { return 1; } } else if (uopts.controller_fast >= 0) { @@ -774,13 +813,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 = ARKodeSetAdaptController(fast_arkode_mem, *C); - if (check_flag(flag, "ARKodeSetAdaptController")) { return 1; } + flag = ARKStepSetAdaptController(fast_arkode_mem, *C); + if (check_flag(flag, "ARKStepSetAdaptController")) { return 1; } } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(fast_arkode_mem, uopts.maxsteps); - if (check_flag(flag, "ARKodeSetMaxNumSteps")) { return 1; } + flag = ARKStepSetMaxNumSteps(fast_arkode_mem, uopts.maxsteps); + if (check_flag(flag, "ARKStepSetMaxNumSteps")) { return 1; } // Wrap ARKODE as an MRIStepInnerStepper flag = ARKStepCreateMRIStepInnerStepper(fast_arkode_mem, fast_mem); @@ -795,16 +834,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 = ARKodeSetFixedStep(*arkode_mem, uopts.fixed_h); - if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + flag = MRIStepSetFixedStep(*arkode_mem, uopts.fixed_h); + if (check_flag(flag, "MRIStepSetFixedStep")) { return 1; } // Specify tolerances - flag = ARKodeSStolerances(*arkode_mem, uopts.rtol, uopts.atol); - if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + flag = MRIStepSStolerances(*arkode_mem, uopts.rtol, uopts.atol); + if (check_flag(flag, "MRIStepSStolerances")) { return 1; } // Attach user data - flag = ARKodeSetUserData(*arkode_mem, &udata); - if (check_flag(flag, "ARKodeSetUserData")) { return 1; } + flag = MRIStepSetUserData(*arkode_mem, &udata); + if (check_flag(flag, "MRIStepSetUserData")) { return 1; } // If implicit, setup solvers if (fsi_RHS) @@ -818,40 +857,40 @@ int SetupMRIARK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, if (check_ptr(*LS, "SUNLinSol_Band")) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(*arkode_mem, *LS, *A); - if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } + flag = MRIStepSetLinearSolver(*arkode_mem, *LS, *A); + if (check_flag(flag, "MRIStepSetLinearSolver")) { return 1; } // Attach Jacobian function - flag = ARKodeSetJacFn(*arkode_mem, Jsi_RHS); - if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } + flag = MRIStepSetJacFn(*arkode_mem, Jsi_RHS); + if (check_flag(flag, "MRIStepSetJacFn")) { return 1; } // Set linear solver setup frequency - flag = ARKodeSetLSetupFrequency(*arkode_mem, uopts.ls_setup_freq); - if (check_flag(flag, "ARKodeSetLSetupFrequency")) { return 1; } + flag = MRIStepSetLSetupFrequency(*arkode_mem, uopts.ls_setup_freq); + if (check_flag(flag, "MRIStepSetLSetupFrequency")) { return 1; } // Set the predictor method - flag = ARKodeSetPredictorMethod(*arkode_mem, uopts.predictor); - if (check_flag(flag, "ARKodeSetPredictorMethod")) { return 1; } + flag = MRIStepSetPredictorMethod(*arkode_mem, uopts.predictor); + if (check_flag(flag, "MRIStepSetPredictorMethod")) { return 1; } if (uopts.linear) { // Specify linearly implicit non-time-dependent RHS - flag = ARKodeSetLinear(*arkode_mem, SUNFALSE); - if (check_flag(flag, "ARKodeSetLinear")) { return 1; } + flag = MRIStepSetLinear(*arkode_mem, SUNFALSE); + if (check_flag(flag, "MRIStepSetLinear")) { return 1; } } } // Select method order - flag = ARKodeSetOrder(*arkode_mem, uopts.order); - if (check_flag(flag, "ARKodeSetOrder")) { return 1; } + flag = MRIStepSetOrder(*arkode_mem, uopts.order); + if (check_flag(flag, "MRIStepSetOrder")) { return 1; } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(*arkode_mem, uopts.maxsteps); - if (check_flag(flag, "ARKodeSetMaxNumSteps")) { return 1; } + flag = MRIStepSetMaxNumSteps(*arkode_mem, uopts.maxsteps); + if (check_flag(flag, "MRIStepSetMaxNumSteps")) { return 1; } // Set stopping time - flag = ARKodeSetStopTime(*arkode_mem, udata.tf); - if (check_flag(flag, "ARKodeSetStopTime")) { return 1; } + flag = MRIStepSetStopTime(*arkode_mem, udata.tf); + if (check_flag(flag, "MRIStepSetStopTime")) { return 1; } return 0; } @@ -986,16 +1025,16 @@ int SetupMRICVODE(SUNContext ctx, UserData& udata, UserOptions& uopts, if (check_ptr(*arkode_mem, "MRIStepCreate")) { return 1; } // Set the slow step size - flag = ARKodeSetFixedStep(*arkode_mem, uopts.fixed_h); - if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + flag = MRIStepSetFixedStep(*arkode_mem, uopts.fixed_h); + if (check_flag(flag, "MRIStepSetFixedStep")) { return 1; } // Specify tolerances - flag = ARKodeSStolerances(*arkode_mem, uopts.rtol, uopts.atol); - if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + flag = MRIStepSStolerances(*arkode_mem, uopts.rtol, uopts.atol); + if (check_flag(flag, "MRIStepSStolerances")) { return 1; } // Attach user data - flag = ARKodeSetUserData(*arkode_mem, &udata); - if (check_flag(flag, "ARKodeSetUserData")) { return 1; } + flag = MRIStepSetUserData(*arkode_mem, &udata); + if (check_flag(flag, "MRIStepSetUserData")) { return 1; } // If implicit, setup solvers if (fsi_RHS) @@ -1009,40 +1048,40 @@ int SetupMRICVODE(SUNContext ctx, UserData& udata, UserOptions& uopts, if (check_ptr(*LS, "SUNLinSol_Band")) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(*arkode_mem, *LS, *A); - if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } + flag = MRIStepSetLinearSolver(*arkode_mem, *LS, *A); + if (check_flag(flag, "MRIStepSetLinearSolver")) { return 1; } // Attach Jacobian function - flag = ARKodeSetJacFn(*arkode_mem, Jsi_RHS); - if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } + flag = MRIStepSetJacFn(*arkode_mem, Jsi_RHS); + if (check_flag(flag, "MRIStepSetJacFn")) { return 1; } // Set linear solver setup frequency - flag = ARKodeSetLSetupFrequency(*arkode_mem, uopts.ls_setup_freq); - if (check_flag(flag, "ARKodeSetLSetupFrequency")) { return 1; } + flag = MRIStepSetLSetupFrequency(*arkode_mem, uopts.ls_setup_freq); + if (check_flag(flag, "MRIStepSetLSetupFrequency")) { return 1; } // Set the predictor method - flag = ARKodeSetPredictorMethod(*arkode_mem, uopts.predictor); - if (check_flag(flag, "ARKodeSetPredictorMethod")) { return 1; } + flag = MRIStepSetPredictorMethod(*arkode_mem, uopts.predictor); + if (check_flag(flag, "MRIStepSetPredictorMethod")) { return 1; } if (uopts.linear) { // Specify linearly implicit non-time-dependent RHS - flag = ARKodeSetLinear(*arkode_mem, SUNFALSE); - if (check_flag(flag, "ARKodeSetLinear")) { return 1; } + flag = MRIStepSetLinear(*arkode_mem, SUNFALSE); + if (check_flag(flag, "MRIStepSetLinear")) { return 1; } } } // Select method order - flag = ARKodeSetOrder(*arkode_mem, uopts.order); - if (check_flag(flag, "ARKodeSetOrder")) { return 1; } + flag = MRIStepSetOrder(*arkode_mem, uopts.order); + if (check_flag(flag, "MRIStepSetOrder")) { return 1; } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(*arkode_mem, uopts.maxsteps); - if (check_flag(flag, "ARKodeSetMaxNumSteps")) { return 1; } + flag = MRIStepSetMaxNumSteps(*arkode_mem, uopts.maxsteps); + if (check_flag(flag, "MRIStepSetMaxNumSteps")) { return 1; } // Set stopping time - flag = ARKodeSetStopTime(*arkode_mem, udata.tf); - if (check_flag(flag, "ARKodeSetStopTime")) { return 1; } + flag = MRIStepSetStopTime(*arkode_mem, udata.tf); + if (check_flag(flag, "MRIStepSetStopTime")) { 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 bdf4102903..293cf06d48 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 -static int check_flag(int flag, const string funcname) +int check_flag(int flag, const string funcname) { if (flag < 0) { @@ -277,7 +277,7 @@ static int check_flag(int flag, const string funcname) } // Check if a function returned a NULL pointer -static int check_ptr(void* ptr, const string funcname) +int check_ptr(void* ptr, const string funcname) { if (ptr) { return 0; } cerr << "ERROR: " << funcname << " returned NULL" << endl; @@ -285,18 +285,18 @@ static int check_ptr(void* ptr, const string funcname) } // Print ERK integrator statistics -static int OutputStatsERK(void* arkode_mem, UserData& udata) +int OutputStatsERK(void* arkode_mem, UserData& udata) { int flag; // Get integrator and solver stats long int nst, nst_a, netf, nfe; - 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 = 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 = ERKStepGetNumRhsEvals(arkode_mem, &nfe); if (check_flag(flag, "ERKStepGetNumRhsEvals")) { return -1; } @@ -309,18 +309,18 @@ static int OutputStatsERK(void* arkode_mem, UserData& udata) } // Print ARK integrator statistics -static int OutputStatsARK(void* arkode_mem, UserData& udata) +int OutputStatsARK(void* arkode_mem, UserData& udata) { int flag; // Get integrator and solver stats long int nst, nst_a, netf, nfe, nfi; - 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(flag, "ARKStepGetNumRhsEvals")) { return -1; } @@ -334,16 +334,16 @@ static int OutputStatsARK(void* arkode_mem, UserData& udata) if (udata.splitting) { long int nni, ncfn; - flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(flag, "ARKodeGetNumNonlinSolvIters")) { return -1; } - flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(flag, "ARKodeGetNumNonlinSolvConvFails")) { return -1; } + flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(flag, "ARKStepGetNumNonlinSolvIters")) { return -1; } + flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(flag, "ARKStepGetNumNonlinSolvConvFails")) { return -1; } long int nsetups, nje; - flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(flag, "ARKodeGetNumLinSolvSetups")) { return -1; } - flag = ARKodeGetNumJacEvals(arkode_mem, &nje); - if (check_flag(flag, "ARKodeGetNumJacEvals")) { return -1; } + flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(flag, "ARKStepGetNumLinSolvSetups")) { return -1; } + flag = ARKStepGetNumJacEvals(arkode_mem, &nje); + if (check_flag(flag, "ARKStepGetNumJacEvals")) { return -1; } cout << " NLS iters = " << nni << endl; cout << " NLS fails = " << ncfn << endl; @@ -362,15 +362,15 @@ static int OutputStatsARK(void* arkode_mem, UserData& udata) } // Print MRI integrator statistics -static int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, - UserData& udata) +int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, + UserData& udata) { int flag; // Get slow integrator and solver stats long int nst, nst_a, netf, nfe, nfi; - flag = ARKodeGetNumSteps(arkode_mem, &nst); - if (check_flag(flag, "ARKodeGetNumSteps")) { return -1; } + flag = MRIStepGetNumSteps(arkode_mem, &nst); + if (check_flag(flag, "MRIStepGetNumSteps")) { return -1; } flag = MRIStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(flag, "MRIStepGetNumRhsEvals")) { return -1; } @@ -383,16 +383,16 @@ static int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, if (udata.diffusion) { long int nni, ncfn; - flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(flag, "ARKodeGetNumNonlinSolvIters")) { return -1; } - flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(flag, "ARKodeGetNumNonlinSolvConvFails")) { return -1; } + flag = MRIStepGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(flag, "MRIStepGetNumNonlinSolvIters")) { return -1; } + flag = MRIStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(flag, "MRIStepGetNumNonlinSolvConvFails")) { return -1; } long int nsetups, nje; - flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(flag, "ARKodeGetNumLinSolvSetups")) { return -1; } - flag = ARKodeGetNumJacEvals(arkode_mem, &nje); - if (check_flag(flag, "ARKodeGetNumJacEvals")) { return -1; } + flag = MRIStepGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(flag, "MRIStepGetNumLinSolvSetups")) { return -1; } + flag = MRIStepGetNumJacEvals(arkode_mem, &nje); + if (check_flag(flag, "MRIStepGetNumJacEvals")) { return -1; } cout << " NLS iters = " << nni << endl; cout << " NLS fails = " << ncfn << endl; @@ -413,12 +413,12 @@ static int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, MRIStepInnerStepper_GetContent(fast_mem, &fast_arkode_mem); // Get fast integrator and solver stats - 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 = 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 = ARKStepGetNumRhsEvals(fast_arkode_mem, &nfe, &nfi); if (check_flag(flag, "ARKStepGetNumRhsEvals")) { return -1; } @@ -433,16 +433,16 @@ static int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, if (udata.splitting) { long int nni, ncfn; - 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; } + 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; } long int nsetups, nje; - 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; } + 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; } cout << " NLS iters = " << nni << endl; cout << " NLS fails = " << ncfn << endl; @@ -461,7 +461,7 @@ static int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, } // Save current stats -static int UpdateCVodeStats(CVodeInnerStepperContent* content) +int UpdateCVodeStats(CVodeInnerStepperContent* content) { int flag; long int nst, netf, nfe, nni, nncf, nsetups, nje; @@ -498,29 +498,29 @@ static int UpdateCVodeStats(CVodeInnerStepperContent* content) } // Print MRI integrator statistics -static int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper fast_mem, - UserData& udata) +int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper fast_mem, + UserData& udata) { int flag; // Get slow integrator and solver stats long int nsts, nfse, nfsi; - flag = ARKodeGetNumSteps(arkode_mem, &nsts); - if (check_flag(flag, "ARKodeGetNumSteps")) { return -1; } + flag = MRIStepGetNumSteps(arkode_mem, &nsts); + if (check_flag(flag, "MRIStepGetNumSteps")) { return -1; } flag = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); if (check_flag(flag, "MRIStepGetNumRhsEvals")) { return -1; } long int nni, ncfn; - flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(flag, "ARKodeGetNumNonlinSolvIters")) { return -1; } - flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(flag, "ARKodeGetNumNonlinSolvConvFails")) { return -1; } + flag = MRIStepGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(flag, "MRIStepGetNumNonlinSolvIters")) { return -1; } + flag = MRIStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(flag, "MRIStepGetNumNonlinSolvConvFails")) { return -1; } long int nsetups, nje; - flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(flag, "ARKodeGetNumLinSolvSetups")) { return -1; } - flag = ARKodeGetNumJacEvals(arkode_mem, &nje); - if (check_flag(flag, "ARKodeGetNumJacEvals")) { return -1; } + flag = MRIStepGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(flag, "MRIStepGetNumLinSolvSetups")) { return -1; } + flag = MRIStepGetNumJacEvals(arkode_mem, &nje); + if (check_flag(flag, "MRIStepGetNumJacEvals")) { return -1; } cout << fixed << setprecision(6); cout << endl << "Slow Integrator:" << endl; @@ -570,7 +570,7 @@ static int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper fast_mem, } // Print command line options -static void InputHelp() +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, } } -static int ReadInputs(vector<string>& args, UserData& udata, UserOptions& uopts, - SUNContext ctx) +int ReadInputs(vector<string>& args, UserData& udata, UserOptions& uopts, + SUNContext ctx) { if (find(args.begin(), args.end(), "--help") != args.end()) { @@ -785,7 +785,7 @@ static int ReadInputs(vector<string>& args, UserData& udata, UserOptions& uopts, } // Print user data -static int PrintSetup(UserData& udata, UserOptions& uopts) +int PrintSetup(UserData& udata, UserOptions& uopts) { cout << endl; cout << "Problem parameters and options:" << endl; @@ -1147,7 +1147,7 @@ static int PrintSetup(UserData& udata, UserOptions& uopts) } // Initialize output -static int OpenOutput(UserData& udata, UserOptions& uopts) +int OpenOutput(UserData& udata, UserOptions& uopts) { // Header for status output if (uopts.output) @@ -1183,8 +1183,7 @@ static int OpenOutput(UserData& udata, UserOptions& uopts) } // Write output -static int WriteOutput(sunrealtype t, N_Vector y, UserData& udata, - UserOptions& uopts) +int WriteOutput(sunrealtype t, N_Vector y, UserData& udata, UserOptions& uopts) { if (uopts.output) { @@ -1213,7 +1212,7 @@ static int WriteOutput(sunrealtype t, N_Vector y, UserData& udata, } // Finalize output -static int CloseOutput(UserOptions& uopts) +int CloseOutput(UserOptions& uopts) { // Footer for status output if (uopts.output) diff --git a/examples/arkode/CXX_serial/ark_analytic_sys.cpp b/examples/arkode/CXX_serial/ark_analytic_sys.cpp index 6ce667770c..ffcad8e516 100644 --- a/examples/arkode/CXX_serial/ark_analytic_sys.cpp +++ b/examples/arkode/CXX_serial/ark_analytic_sys.cpp @@ -162,7 +162,6 @@ 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; } @@ -174,27 +173,22 @@ int main() if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } // Set routines - 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; } + 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; } // Linear solver interface - 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; } + 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; } // Specify linearly implicit RHS, with non-time-dependent Jacobian - 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; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } // Open output stream for results, output comment line FILE* UFID = fopen("solution.txt", "w"); @@ -204,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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then prints results. Stops when the final time has been reached */ sunrealtype t = T0; sunrealtype tout = T0 + dTout; @@ -212,8 +206,8 @@ int main() cout << " --------------------------------------\n"; while (Tf - t > 1.0e-15) { - flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); // call integrator - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); // call integrator + if (check_flag(&flag, "ARKStepEvolve", 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)); @@ -235,24 +229,24 @@ int main() // Print some final statistics long int nst, nst_a, nfe, nfi, nsetups, nje, nfeLS, nni, ncfn, netf; - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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); + 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); cout << "\nFinal Solver Statistics:\n"; cout << " Internal solver steps = " << nst << " (attempted = " << nst_a @@ -268,10 +262,10 @@ int main() cout << " Total number of error test failures = " << netf << "\n\n"; // Clean up and return with successful completion - ARKodeFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - SUNMatDestroy(A); // Free A matrix - N_VDestroy(y); // Free y vector + ARKStepFree(&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_analytic_sys.out b/examples/arkode/CXX_serial/ark_analytic_sys.out index 92c5378f2e..5ac8dbdf0d 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 = 348 + Total RHS evals: Fe = 0, Fi = 693 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_heat2D.cpp b/examples/arkode/CXX_serial/ark_heat2D.cpp index bf18a6fbb0..414bbff076 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 ARKODE settings. Use the flag --help for more information. + * and ARKStep settings. Use the flag --help for more information. * ---------------------------------------------------------------------------*/ #include <chrono> @@ -290,7 +290,7 @@ int main(int argc, char* argv[]) } // -------------- - // Setup ARKODE + // Setup ARKStep // -------------- // 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 = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } // Attach user data - flag = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } if (udata->prec) { // Attach preconditioner - flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } + flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKodeSetLSetupFrequency(arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } + flag = ARKStepSetLSetupFrequency(arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKodeSetEpsLin(arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + flag = ARKStepSetEpsLin(arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKStepSetEpsLin", 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; } + flag = ARKStepSetOrder(arkode_mem, udata->order); + if (check_flag(&flag, "ARKStepSetOrder", 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 = ARKodeSetFixedStep(arkode_mem, udata->hfixed); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = ARKStepSetFixedStep(arkode_mem, udata->hfixed); + if (check_flag(&flag, "ARKStepSetFixedStep", 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 = ARKodeSetAdaptController(arkode_mem, C); - if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) { return 1; } } // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } } // Set max steps between outputs - flag = ARKodeSetMaxNumSteps(arkode_mem, udata->maxsteps); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKStepSetMaxNumSteps(arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKodeSetStopTime(arkode_mem, udata->tf); - if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = ARKStepSetStopTime(arkode_mem, udata->tf); + if (check_flag(&flag, "ARKStepSetStopTime", 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 = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } // Stop timer t2 = chrono::steady_clock::now(); @@ -465,10 +465,10 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKodeFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKStepFree(&arkode_mem); // Free integrator memory + SUNLinSolFree(LS); // Free linear solver + N_VDestroy(u); // Free vectors + FreeUserData(udata); // Free user data delete udata; (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 = 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 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; } + 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; } 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 = 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; } + 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; } 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 ff1d6daa05..6a32290cca 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 ARKODE memory structure + void* arkode_mem = NULL; // empty ARKStep 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 = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1)) { return (1); } + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 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 = 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; } + 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; } } else { // Fixed-point NLS = SUNNonlinSol_FixedPoint(y, 4, ctx); if (check_retval((void*)NLS, "SUNNonlinSol_FixedPoint", 0)) { return 1; } - retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1)) { return (1); } + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1)) { return (1); } } } // Set maximum stepsize for ERK run if (rk_type == 2) { - retval = ARKodeSetMaxStep(arkode_mem, ONE / SUNRabs(udata.G)); - if (check_retval(&retval, "ARKodeSetMaxStep", 1)) { return (1); } + retval = ARKStepSetMaxStep(arkode_mem, ONE / SUNRabs(udata.G)); + if (check_retval(&retval, "ARKStepSetMaxStep", 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 = 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); } + 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); } // Set desired solver order - retval = ARKodeSetOrder(arkode_mem, order); - if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } + retval = ARKStepSetOrder(arkode_mem, order); + if (check_retval(&retval, "ARKStepSetOrder", 1)) { return 1; } - retval = ARKodeSetDeduceImplicitRhs(arkode_mem, deduce); - if (check_retval(&retval, "ARKodeSetDeduceImplicitRhs", 1)) { return 1; } + retval = ARKStepSetDeduceImplicitRhs(arkode_mem, deduce); + if (check_retval(&retval, "ARKStepSetDeduceImplicitRhs", 1)) { return 1; } // Set the user data pointer - retval = ARKodeSetUserData(arkode_mem, (void*)&udata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = ARKStepSetUserData(arkode_mem, (void*)&udata); + if (check_retval(&retval, "ARKStepSetUserData", 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 - 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 + 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 return 0; } @@ -509,10 +509,10 @@ static int adaptive_run(void* arkode_mem, N_Vector y, sunrealtype T0, int retval; // Set tolerances - 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 = 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; } // 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 ARKodeEvolve to perform integration, + // Main time-stepping loop: calls ARKStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKStepEvolve", 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 = 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_retval(&retval, "ARKStepGetNumRhsEvals", 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; } + 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; } if (rk_type < 2) { - 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; } + 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; } if (nls_type == 0) { - retval = ARKodeGetNumJacEvals(arkode_mem, &nje); - if (check_retval(&retval, "ARKodeGetNumJacEvals", 1)) { return 1; } + retval = ARKStepGetNumJacEvals(arkode_mem, &nje); + if (check_retval(&retval, "ARKStepGetNumJacEvals", 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 = 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); } + 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); } if (rk_type < 2) { - 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; } + 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; } } // 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 ARKODE for this run + // Reset ARKStep for this run retval = Ytrue(T0, y); if (check_retval(&retval, "Ytrue", 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; } + 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; } // 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKStepEvolve", 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 57c23ccc99..776dc831d8 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 = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + flag = ARKStepSStolerances(arkode_mem, reltol, abstol); + if (check_flag(flag, "ARKStepSStolerances")) { return 1; } if (relax) { // Enable relaxation methods - flag = ARKodeSetRelaxFn(arkode_mem, Eng, JacEng); - if (check_flag(flag, "ARKodeSetRelaxFn")) { return 1; } + flag = ARKStepSetRelaxFn(arkode_mem, Eng, JacEng); + if (check_flag(flag, "ARKStepSetRelaxFn")) { 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 = ARKodeSetLinearSolver(arkode_mem, LS, A); - if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, A); + if (check_flag(flag, "ARKStepSetLinearSolver")) { return 1; } // Set Jacobian routine - flag = ARKodeSetJacFn(arkode_mem, Jac); - if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } + flag = ARKStepSetJacFn(arkode_mem, Jac); + if (check_flag(flag, "ARKStepSetJacFn")) { return 1; } if (fixed_h > SUN_RCONST(0.0)) { @@ -206,15 +206,12 @@ int main(int argc, char* argv[]) if (fixed_h > SUN_RCONST(0.0)) { - flag = ARKodeSetFixedStep(arkode_mem, fixed_h); - if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + flag = ARKStepSetFixedStep(arkode_mem, fixed_h); + if (check_flag(flag, "ARKStepSetFixedStep")) { return 1; } } - 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; } + flag = ARKStepSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if (check_flag(flag, "ARKStepSetNonlinConvCoef")) { return 1; } /* --------------- * * Advance in Time * @@ -251,8 +248,8 @@ int main(int argc, char* argv[]) while (t < tf) { // Evolve in time - flag = ARKodeEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); - if (check_flag(flag, "ARKodeEvolve")) { break; } + flag = ARKStepEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); + if (check_flag(flag, "ARKStepEvolve")) { break; } // Output solution and errors sunrealtype eng; @@ -263,8 +260,8 @@ int main(int argc, char* argv[]) /* Output to the screen periodically */ long int nst; - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ARKodeGetNumSteps"); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ARKStepGetNumSteps"); if (nst % 1000 == 0) { @@ -291,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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ARKodeGetNumSteps"); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ARKStepGetNumSteps"); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(flag, "ARKodeGetNumStepAttempts"); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(flag, "ARKStepGetNumStepAttempts"); - flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); - check_flag(flag, "ARKodeGetNumErrTestFails"); + flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); + check_flag(flag, "ARKStepGetNumErrTestFails"); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(flag, "ARKStepGetNumRhsEvals"); @@ -314,20 +311,20 @@ int main(int argc, char* argv[]) { long int nsetups, nje, nfeLS, nni, ncfn; - flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(flag, "ARKodeGetNumNonlinSolvIters"); + flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(flag, "ARKStepGetNumNonlinSolvIters"); - flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(flag, "ARKodeGetNumNonlinSolvConvFails"); + flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(flag, "ARKStepGetNumNonlinSolvConvFails"); - flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(flag, "ARKodeGetNumLinSolvSetups"); + flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(flag, "ARKStepGetNumLinSolvSetups"); - flag = ARKodeGetNumJacEvals(arkode_mem, &nje); - check_flag(flag, "ARKodeGetNumJacEvals"); + flag = ARKStepGetNumJacEvals(arkode_mem, &nje); + check_flag(flag, "ARKStepGetNumJacEvals"); - flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(flag, "ARKodeGetNumLinRhsEvals"); + flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(flag, "ARKStepGetNumLinRhsEvals"); std::cout << " Total number of Newton iterations = " << nni << "\n"; std::cout << " Total number of linear solver convergence failures = " << ncfn @@ -342,23 +339,23 @@ int main(int argc, char* argv[]) { long int nre, nrje, nrf, nrbf, nrnlsi, nrnlsf; - flag = ARKodeGetNumRelaxFnEvals(arkode_mem, &nre); - check_flag(flag, "ARKodeGetNumRelaxFnEvals"); + flag = ARKStepGetNumRelaxFnEvals(arkode_mem, &nre); + check_flag(flag, "ARKStepGetNumRelaxFnEvals"); - flag = ARKodeGetNumRelaxJacEvals(arkode_mem, &nrje); - check_flag(flag, "ARKodeGetNumRelaxJacEvals"); + flag = ARKStepGetNumRelaxJacEvals(arkode_mem, &nrje); + check_flag(flag, "ARKStepGetNumRelaxJacEvals"); - flag = ARKodeGetNumRelaxFails(arkode_mem, &nrf); - check_flag(flag, "ARKodeGetNumRelaxFails"); + flag = ARKStepGetNumRelaxFails(arkode_mem, &nrf); + check_flag(flag, "ARKStepGetNumRelaxFails"); - flag = ARKodeGetNumRelaxBoundFails(arkode_mem, &nrbf); - check_flag(flag, "ARKodeGetNumRelaxBoundFails"); + flag = ARKStepGetNumRelaxBoundFails(arkode_mem, &nrbf); + check_flag(flag, "ARKStepGetNumRelaxBoundFails"); - flag = ARKodeGetNumRelaxSolveFails(arkode_mem, &nrnlsf); - check_flag(flag, "ARKodeGetNumRelaxSolveFails"); + flag = ARKStepGetNumRelaxSolveFails(arkode_mem, &nrnlsf); + check_flag(flag, "ARKStepGetNumRelaxSolveFails"); - flag = ARKodeGetNumRelaxSolveIters(arkode_mem, &nrnlsi); - check_flag(flag, "ARKodeGetNumRelaxSolveIters"); + flag = ARKStepGetNumRelaxSolveIters(arkode_mem, &nrnlsi); + check_flag(flag, "ARKStepGetNumRelaxSolveIters"); std::cout << " Total Relaxation Fn evals = " << nre << "\n"; std::cout << " Total Relaxation Jac evals = " << nrje << "\n"; @@ -373,8 +370,8 @@ int main(int argc, char* argv[]) * Clean up * * -------- */ - // Free ARKODE integrator and SUNDIALS objects - ARKodeFree(&arkode_mem); + // Free ARKStep integrator and SUNDIALS objects + ARKStepFree(&arkode_mem); SUNLinSolFree(LS); SUNMatDestroy(A); N_VDestroy(y); diff --git a/examples/arkode/CXX_serial/ark_pendulum.out b/examples/arkode/CXX_serial/ark_pendulum.out index d2ff98a75c..94c4259cfd 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 = 35561 + Total RHS evals: Fe = 0, Fi = 52696 Total number of Newton iterations = 27018 Total number of linear solver convergence failures = 11 Total linear solver setups = 471 diff --git a/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp b/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp index 25b366c677..67d2b9db30 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 = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) + retval = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKStepSetUserData", 1)) { MPI_Abort(grid.comm, 1); } /* Specify tolerances */ - retval = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) + retval = ARKStepSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKStepSStolerances", 1)) { MPI_Abort(grid.comm, 1); } /* Specify residual tolerance */ - retval = ARKodeResStolerance(arkode_mem, abstol); - if (check_retval(&retval, "ARKodeResStolerance", 1)) + retval = ARKStepResStolerance(arkode_mem, abstol); + if (check_retval(&retval, "ARKStepResStolerance", 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 ARKODE */ - retval = ARKodeSetLinearSolver(arkode_mem, LS, A); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) + /* Attach the matrix, linear solver, and Jacobian construction routine to ARKStep */ + retval = ARKStepSetLinearSolver(arkode_mem, LS, A); + if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { MPI_Abort(grid.comm, 1); } /* Supply Jac routine */ - retval = ARKodeSetJacFn(arkode_mem, Jac); - if (check_retval(&retval, "ARKodeSetJacFn", 1)) { MPI_Abort(grid.comm, 1); } + retval = ARKStepSetJacFn(arkode_mem, Jac); + if (check_retval(&retval, "ARKStepSetJacFn", 1)) { MPI_Abort(grid.comm, 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)) + /* 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)) { MPI_Abort(grid.comm, 1); } /* Supply M routine */ - retval = ARKodeSetMassFn(arkode_mem, MassMatrix); - if (check_retval(&retval, "ARKodeSetMassFn", 1)) { MPI_Abort(grid.comm, 1); } + retval = ARKStepSetMassFn(arkode_mem, MassMatrix); + if (check_retval(&retval, "ARKStepSetMassFn", 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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = Tf / Nt; @@ -536,8 +536,9 @@ int main(int argc, char* argv[]) printf(" ----------------------------------------------\n"); for (iout = 0; iout < Nt; iout++) { - retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = ARKStepEvolve(arkode_mem, tout, y, &t, + ARK_NORMAL); /* call integrator */ + if (check_retval(&retval, "ARKStepEvolve", 1)) { break; } u = N_VWL2Norm(y, umask); /* access/print solution statistics */ u = sqrt(u * u / N); v = N_VWL2Norm(y, vmask); @@ -571,28 +572,28 @@ int main(int argc, char* argv[]) fclose(WFID); /* Print some final statistics */ - retval = ARKodeGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKodeGetNumStepAttempts", 1); + retval = ARKStepGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKStepGetNumSteps", 1); + retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKStepGetNumStepAttempts", 1); retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 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); + 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); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -612,8 +613,8 @@ int main(int argc, char* argv[]) N_VDestroy(umask); N_VDestroy(vmask); N_VDestroy(wmask); - ARKodeFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solvers */ + ARKStepFree(&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 3d11f6a539..e1a02fed2f 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 ARKODE + // Setup ARKStep // -------------- // 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 = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } // Attach user data - flag = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } if (udata->matvec) { // Attach Jacobian-vector product function - flag = ARKodeSetJacTimes(arkode_mem, NULL, JTimes); - if (check_flag(&flag, "ARKodeSetJacTimes", 1)) { return 1; } + flag = ARKStepSetJacTimes(arkode_mem, NULL, JTimes); + if (check_flag(&flag, "ARKStepSetJacTimes", 1)) { return 1; } } if (udata->prec) { // Attach preconditioner - flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } + flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKodeSetLSetupFrequency(arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } + flag = ARKStepSetLSetupFrequency(arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKodeSetEpsLin(arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + flag = ARKStepSetEpsLin(arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKStepSetEpsLin", 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; } + flag = ARKStepSetOrder(arkode_mem, udata->order); + if (check_flag(&flag, "ARKStepSetOrder", 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 = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 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 = ARKodeSetAdaptController(arkode_mem, C); - if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) { return 1; } // Set the step size reduction factor limit (1 / refinement factor limit) - flag = ARKodeSetMinReduction(arkode_mem, ONE / udata->x_rfactor_limit); - if (check_flag(&flag, "ARKodeSetMinReduction", 1)) { return 1; } + flag = ARKStepSetMinReduction(arkode_mem, ONE / udata->x_rfactor_limit); + if (check_flag(&flag, "ARKStepSetMinReduction", 1)) { return 1; } // Set the failed solve step size reduction factor (1 / refinement factor) - flag = ARKodeSetMaxCFailGrowth(arkode_mem, ONE / udata->x_rfactor_fail); - if (check_flag(&flag, "ARKodeSetMaxCFailGrowth", 1)) { return 1; } + flag = ARKStepSetMaxCFailGrowth(arkode_mem, ONE / udata->x_rfactor_fail); + if (check_flag(&flag, "ARKStepSetMaxCFailGrowth", 1)) { return 1; } } // ------------------------ @@ -701,10 +701,10 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKodeFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKStepFree(&arkode_mem); // Free integrator memory + SUNLinSolFree(LS); // Free linear solver + N_VDestroy(u); // Free vectors + FreeUserData(udata); // Free user data delete udata; braid_Destroy(core); // Free braid memory ARKBraid_Free(&app); // Free interface memory @@ -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 = 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 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; } + 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; } // 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 = 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; } + 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; } 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 686862ea5a..0fb944fdfa 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 ARKODE + // Setup ARKStep // -------------- // 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 = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } // Attach user data - flag = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } if (udata->prec) { // Attach preconditioner - flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } + flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKodeSetLSetupFrequency(arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } + flag = ARKStepSetLSetupFrequency(arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKodeSetEpsLin(arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + flag = ARKStepSetEpsLin(arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKStepSetEpsLin", 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; } + flag = ARKStepSetOrder(arkode_mem, udata->order); + if (check_flag(&flag, "ARKStepSetOrder", 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 = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 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 = ARKodeSetAdaptController(arkode_mem, C); - if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) { return 1; } // Set the step size reduction factor limit (1 / refinement factor limit) - flag = ARKodeSetMinReduction(arkode_mem, ONE / udata->x_rfactor_limit); - if (check_flag(&flag, "ARKodeSetMinReduction", 1)) { return 1; } + flag = ARKStepSetMinReduction(arkode_mem, ONE / udata->x_rfactor_limit); + if (check_flag(&flag, "ARKStepSetMinReduction", 1)) { return 1; } // Set the failed solve step size reduction factor (1 / refinement factor) - flag = ARKodeSetMaxCFailGrowth(arkode_mem, ONE / udata->x_rfactor_fail); - if (check_flag(&flag, "ARKodeSetMaxCFailGrowth", 1)) { return 1; } + flag = ARKStepSetMaxCFailGrowth(arkode_mem, ONE / udata->x_rfactor_fail); + if (check_flag(&flag, "ARKStepSetMaxCFailGrowth", 1)) { return 1; } } // ------------------------ @@ -648,10 +648,10 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKodeFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKStepFree(&arkode_mem); // Free integrator memory + SUNLinSolFree(LS); // Free linear solver + N_VDestroy(u); // Free vectors + FreeUserData(udata); // Free user data delete udata; braid_Destroy(core); // Free braid memory ARKBraid_Free(&app); // Free interface memory @@ -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 = 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 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; } + 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; } // 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 = 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; } + 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; } 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 3ca94f8fcf..cfddfbbdd7 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 ARKODE settings. Use the flag --help for more information. + * and ARKStep settings. Use the flag --help for more information. * ---------------------------------------------------------------------------*/ #include <chrono> @@ -340,7 +340,7 @@ int main(int argc, char* argv[]) } // -------------- - // Setup ARKODE + // Setup ARKStep // -------------- // 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 = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } // Attach user data - flag = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } if (udata->prec) { // Attach preconditioner - flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } + flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKodeSetLSetupFrequency(arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } + flag = ARKStepSetLSetupFrequency(arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKodeSetEpsLin(arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + flag = ARKStepSetEpsLin(arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKStepSetEpsLin", 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; } + flag = ARKStepSetOrder(arkode_mem, udata->order); + if (check_flag(&flag, "ARKStepSetOrder", 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 = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 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 = ARKodeSetAdaptController(arkode_mem, C); - if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) { return 1; } // Set the step size reduction factor limit (1 / refinement factor limit) - flag = ARKodeSetMinReduction(arkode_mem, ONE / udata->x_rfactor_limit); - if (check_flag(&flag, "ARKodeSetMinReduction", 1)) { return 1; } + flag = ARKStepSetMinReduction(arkode_mem, ONE / udata->x_rfactor_limit); + if (check_flag(&flag, "ARKStepSetMinReduction", 1)) { return 1; } // Set the failed solve step size reduction factor (1 / refinement factor) - flag = ARKodeSetMaxCFailGrowth(arkode_mem, ONE / udata->x_rfactor_fail); - if (check_flag(&flag, "ARKodeSetMaxCFailGrowth", 1)) { return 1; } + flag = ARKStepSetMaxCFailGrowth(arkode_mem, ONE / udata->x_rfactor_fail); + if (check_flag(&flag, "ARKStepSetMaxCFailGrowth", 1)) { return 1; } } // ------------------------ @@ -586,10 +586,10 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKodeFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKStepFree(&arkode_mem); // Free integrator memory + SUNLinSolFree(LS); // Free linear solver + N_VDestroy(u); // Free vectors + FreeUserData(udata); // Free user data delete udata; braid_Destroy(core); // Free braid memory ARKBraid_Free(&app); // Free interface memory @@ -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 = 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 = 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 = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 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; } + 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; } // 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 = 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; } + 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; } 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 dca37e62d8..ff80e737d2 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 = 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; } + 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; } /* 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 = 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; } + 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; } /* 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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } /* print solution statistics */ unorm = N_VDotProd(u, u); @@ -288,28 +288,28 @@ int main(void) fclose(WFID); /* Print some final statistics */ - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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); + 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); 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 */ - ARKodeFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNContext_Free(&ctx); /* Free context */ + free(userdata); /* Free user data */ + ARKStepFree(&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 9fa052cc15..8a57f87c5f 100644 --- a/examples/arkode/C_openmp/ark_brusselator1D_omp.c +++ b/examples/arkode/C_openmp/ark_brusselator1D_omp.c @@ -225,7 +225,6 @@ 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; } @@ -237,23 +236,18 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - 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; } + 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; } /* Linear solver specification */ - 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; } + 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; } /* output spatial mesh to disk */ FID = fopen("bruss_mesh.txt", "w"); @@ -275,7 +269,7 @@ int main(int argc, char* argv[]) fprintf(VFID, "\n"); fprintf(WFID, "\n"); - /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = (Tf - T0) / Nt; @@ -284,8 +278,8 @@ int main(int argc, char* argv[]) printf(" ----------------------------------------------\n"); for (iout = 0; iout < Nt; iout++) { - flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } u = N_VWL2Norm(y, umask); /* access/print solution statistics */ u = sqrt(u * u / N); v = N_VWL2Norm(y, vmask); @@ -319,24 +313,24 @@ int main(int argc, char* argv[]) fclose(WFID); /* Print some final statistics */ - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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); + 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); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -350,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 */ - ARKodeFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNMatDestroy(A); /* Free matrix */ - N_VDestroy(y); /* Free vectors */ + 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 */ N_VDestroy(umask); N_VDestroy(vmask); N_VDestroy(wmask); diff --git a/examples/arkode/C_openmp/ark_brusselator1D_omp.out b/examples/arkode/C_openmp/ark_brusselator1D_omp.out index 81af310e01..9d254eaac0 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 = 1186 + Total RHS evals: Fe = 0, Fi = 1694 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_openmp/ark_heat1D_omp.c b/examples/arkode/C_openmp/ark_heat1D_omp.c index 4fc8eb998b..e59b1f03d0 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 ARKODE memory structure */ + void* arkode_mem = NULL; /* empty ARKStep 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 = 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; } + 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; } /* 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 = 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; } + 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; } /* Specify linearly implicit RHS, with non-time-dependent Jacobian */ - flag = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStep 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKStepEvolve", 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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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); + 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); 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 */ - ARKodeFree(&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 */ + ARKStepFree(&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 1f847e9dfe..83d89bfc0f 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 = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ERKStepSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ERKStepSStolerances", 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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ERKStep 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ERKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ERKStep", 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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ERKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ERKStepGetNumSteps", 1); + flag = ERKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ERKStepGetNumStepAttempts", 1); flag = ERKStepGetNumRhsEvals(arkode_mem, &nfe); check_flag(&flag, "ERKStepGetNumRhsEvals", 1); - flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKodeGetNumErrTestFails", 1); + flag = ERKStepGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ERKStepGetNumErrTestFails", 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 */ - ARKodeFree(&arkode_mem); /* Free integrator memory */ - SUNContext_Free(&ctx); /* Free context */ + N_VDestroy(y); /* Free y vector */ + ERKStepFree(&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 7d12f225f8..ec98fbcd5a 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 = 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; } + 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; } /* Specify I-controller with default parameters */ C = SUNAdaptController_I(ctx); if (check_flag((void*)C, "SUNAdaptController_I", 0)) { return 1; } - flag = ARKodeSetAdaptController(arkode_mem, C); - if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } + flag = ARKStepSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKStepSetAdaptController", 1)) { return 1; } /* Specify linearly implicit RHS, with time-dependent Jacobian */ - flag = ARKodeSetLinear(arkode_mem, 1); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 1); + if (check_flag(&flag, "ARKStepSetLinear", 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 = 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; } + 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; } - /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve 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 = 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; } + 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; } /* call integrator */ - flag = ARKodeEvolve(arkode_mem, Tf, y, &t, ARK_ONE_STEP); - if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } + flag = ARKStepEvolve(arkode_mem, Tf, y, &t, ARK_ONE_STEP); + if (check_flag(&flag, "ARKStepEvolve", 1)) { return 1; } /* "get" routines */ - 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; } + 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; } /* print current solution stats */ iout++; @@ -307,18 +307,18 @@ int main(void) y = y2; y2 = yt; - /* 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; } + /* 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; } - /* destroy and re-allocate linear solver memory; reattach to ARKODE interface */ + /* destroy and re-allocate linear solver memory; reattach to ARKStep interface */ SUNLinSolFree(LS); LS = SUNLinSol_PCG(y, 0, (int)N, ctx); if (check_flag((void*)LS, "SUNLinSol_PCG", 0)) { 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; } + 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; } } 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); - ARKodeFree(&arkode_mem); /* Free integrator memory */ + ARKStepFree(&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 82e13c66a7..f85ec24efb 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 ARKODE memory structure */ + void* arkode_mem = NULL; /* empty ARKStep 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 = 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; } + 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; } /* 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 = 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; } + 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; } /* Specify linearly implicit RHS, with non-time-dependent Jacobian */ - flag = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKStep", 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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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); + 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); 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 */ - ARKodeFree(&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 */ + ARKStepFree(&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 73825d1221..ab26d152eb 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 = ARKodeSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } + retval = ARKStepSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKStepSetOrder", 1)) { return 1; } /* Attach user data */ - retval = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKStepSetUserData", 1)) { return 1; } /* Specify tolerances */ - retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = ARKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } /* Increase the max number of steps allowed between outputs */ - retval = ARKodeSetMaxNumSteps(arkode_mem, 100000); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } + retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); + if (check_retval(&retval, "ARKStepSetMaxNumSteps", 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 = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1)) { return 1; } + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 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 = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } /* Attach preconditioner */ - retval = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_retval(&retval, "ARKodeSetPreconditioner", 1)) { return 1; } + retval = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_retval(&retval, "ARKStepSetPreconditioner", 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 = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1)) { return 1; } + retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKStepSetNonlinearSolver", 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKStepEvolve", 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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKodeGetNumStepAttempts", 1); + retval = ARKStepGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKStepGetNumSteps", 1); + retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKStepGetNumStepAttempts", 1); retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 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); + 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); if (uopt->global) { - 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); + 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); } /* Print final statistics */ @@ -494,7 +494,7 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, SUNContext c } /* Clean up */ - ARKodeFree(&arkode_mem); + ARKStepFree(&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 = ARKodeSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } + retval = ERKStepSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ERKStepSetOrder", 1)) { return 1; } /* Attach user data */ - retval = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = ERKStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ERKStepSetUserData", 1)) { return 1; } /* Specify tolerances */ - retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = ERKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ERKStepSStolerances", 1)) { return 1; } /* Increase the max number of steps allowed between outputs */ - retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } + retval = ERKStepSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ERKStepSetMaxNumSteps", 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = ERKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ERKStepEvolve", 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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKodeGetNumStepAttempts", 1); + retval = ERKStepGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ERKStepGetNumSteps", 1); + retval = ERKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ERKStepGetNumStepAttempts", 1); retval = ERKStepGetNumRhsEvals(arkode_mem, &nfe); check_retval(&retval, "ERKStepGetNumRhsEvals", 1); - retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ARKodeGetNumErrTestFails", 1); + retval = ERKStepGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ERKStepGetNumErrTestFails", 1); /* Print final statistics */ if (udata->myid == 0) @@ -584,7 +584,7 @@ int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, } /* Clean up */ - ARKodeFree(&arkode_mem); + ERKStepFree(&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 = ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, - &gamma, &sdata, &user_data); - if (check_retval((void*)&retval, "ARKodeGetNonlinearSystemData", 1)) + retval = ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, + &gamma, &sdata, &user_data); + if (check_retval((void*)&retval, "ARKStepGetNonlinearSystemData", 1)) { return (-1); } @@ -948,9 +948,9 @@ int TaskLocalLSolve(N_Vector delta, void* arkode_mem) double tcur, gamma; void* user_data = NULL; - retval = ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, - &gamma, &sdata, &user_data); - if (check_retval((void*)&retval, "ARKodeGetNonlinearSystemData", 1)) + retval = ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, + &gamma, &sdata, &user_data); + if (check_retval((void*)&retval, "ARKStepGetNonlinearSystemData", 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 97802077ee..46eeb4b865 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 = ARKodeSetUserData(arkode_mem, data); - if (check_flag(&flag, "ARKodeSetUserData", 1, my_pe)) { MPI_Abort(comm, 1); } + flag = ARKStepSetUserData(arkode_mem, data); + if (check_flag(&flag, "ARKStepSetUserData", 1, my_pe)) { MPI_Abort(comm, 1); } - /* Call ARKodeSetMaxNumSteps to increase default */ - flag = ARKodeSetMaxNumSteps(arkode_mem, 10000); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1, my_pe)) { return (1); } + /* Call ARKStepSetMaxNumSteps to increase default */ + flag = ARKStepSetMaxNumSteps(arkode_mem, 10000); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1, my_pe)) { return (1); } - /* Call ARKodeSStolerances to specify the scalar relative tolerance + /* Call ARKStepSStolerances to specify the scalar relative tolerance and scalar absolute tolerances */ - flag = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKodeSStolerances", 1, my_pe)) { return (1); } + flag = ARKStepSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKStepSStolerances", 1, my_pe)) { return (1); } - /* Attach SPGMR solver structure to ARKODE interface */ - flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1, my_pe)) + /* Attach SPGMR solver structure to ARKStep interface */ + flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKStepSetLinearSolver", 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 = ARKodeSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); - if (check_flag(&flag, "ARKodeSetNonlinConvCoef", 1, my_pe)) + flag = ARKStepSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if (check_flag(&flag, "ARKStepSetNonlinConvCoef", 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 ARKodeEvolve, print results, test for error */ + /* In loop over output points, call ARKStepEvolve, print results, test for error */ for (iout = 1, tout = TWOHR; iout <= NOUT; iout++, tout += TWOHR) { - flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKodeEvolve", 1, my_pe)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKStepEvolve", 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); - ARKodeFree(&arkode_mem); + ARKStepFree(&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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1, my_pe); - flag = ARKodeGetLastStep(arkode_mem, &hu); - check_flag(&flag, "ARKodeGetLastStep", 1, my_pe); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1, my_pe); + flag = ARKStepGetLastStep(arkode_mem, &hu); + check_flag(&flag, "ARKStepGetLastStep", 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 = ARKodeGetWorkSpace(arkode_mem, &lenrw, &leniw); - check_flag(&flag, "ARKodeGetWorkSpace", 1, 0); - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1, 0); + flag = ARKStepGetWorkSpace(arkode_mem, &lenrw, &leniw); + check_flag(&flag, "ARKStepGetWorkSpace", 1, 0); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1, 0); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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); + 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); 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 6ec12802af..df7478fcae 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 = 279 +lenrw = 3902 leniw = 267 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 = 284 +lenrw = 3902 leniw = 272 lenrwls = 2455 leniwls = 126 nst = 7427 nfe = 0 nfe = 78794 nfels = 111450 diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_p.c b/examples/arkode/C_parallel/ark_diurnal_kry_p.c index b7b08ab4c3..3fc249d26b 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 = ARKodeSetUserData(arkode_mem, data); - if (check_flag(&flag, "ARKodeSetUserData", 1, my_pe)) { MPI_Abort(comm, 1); } + flag = ARKStepSetUserData(arkode_mem, data); + if (check_flag(&flag, "ARKStepSetUserData", 1, my_pe)) { MPI_Abort(comm, 1); } - /* Call ARKodeSetMaxNumSteps to increase default */ - flag = ARKodeSetMaxNumSteps(arkode_mem, 10000); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1, my_pe)) { return (1); } + /* Call ARKStepSetMaxNumSteps to increase default */ + flag = ARKStepSetMaxNumSteps(arkode_mem, 10000); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1, my_pe)) { return (1); } - /* Call ARKodeSStolerances to specify the scalar relative tolerance + /* Call ARKStepSStolerances to specify the scalar relative tolerance and scalar absolute tolerances */ - flag = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKodeSStolerances", 1, my_pe)) { return (1); } + flag = ARKStepSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKStepSStolerances", 1, my_pe)) { return (1); } - /* Attach SPGMR solver structure to ARKODE interface */ - flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1, my_pe)) + /* Attach SPGMR solver structure to ARKStep interface */ + flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKStepSetLinearSolver", 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 = ARKodeSetPreconditioner(arkode_mem, Precond, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1, my_pe)) + flag = ARKStepSetPreconditioner(arkode_mem, Precond, PSolve); + if (check_flag(&flag, "ARKStepSetPreconditioner", 1, my_pe)) { MPI_Abort(comm, 1); } /* Tighten nonlinear solver tolerance */ - flag = ARKodeSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); - if (check_flag(&flag, "ARKodeSetNonlinConvCoef", 1, my_pe)) + flag = ARKStepSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if (check_flag(&flag, "ARKStepSetNonlinConvCoef", 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 ARKodeEvolve, print results, test for error */ + /* In loop over output points, call ARKStepEvolve, print results, test for error */ for (iout = 1, tout = TWOHR; iout <= NOUT; iout++, tout += TWOHR) { - flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKodeEvolve", 1, my_pe)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKStepEvolve", 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); - ARKodeFree(&arkode_mem); + ARKStepFree(&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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1, my_pe); - flag = ARKodeGetLastStep(arkode_mem, &hu); - check_flag(&flag, "ARKodeGetLastStep", 1, my_pe); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1, my_pe); + flag = ARKStepGetLastStep(arkode_mem, &hu); + check_flag(&flag, "ARKStepGetLastStep", 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 = ARKodeGetWorkSpace(arkode_mem, &lenrw, &leniw); - check_flag(&flag, "ARKodeGetWorkSpace", 1, 0); - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1, 0); + flag = ARKStepGetWorkSpace(arkode_mem, &lenrw, &leniw); + check_flag(&flag, "ARKStepGetWorkSpace", 1, 0); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1, 0); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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); + 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); 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 b2a0ee2812..a2db3d9006 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 = 255 +lenrw = 3302 leniw = 243 lenrwls = 2455 leniwls = 126 nst = 7447 nfe = 0 nfi = 79041 nfels = 108536 @@ -60,3 +60,4 @@ 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 ab5090e86f..0f1585c26b 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 = ARKodeSetUserData(arkode_mem, data); - if (check_flag(&flag, "ARKodeSetUserData", 1, my_pe)) { MPI_Abort(comm, 1); } + flag = ARKStepSetUserData(arkode_mem, data); + if (check_flag(&flag, "ARKStepSetUserData", 1, my_pe)) { MPI_Abort(comm, 1); } - /* Call ARKodeSetMaxNumSteps to increase default */ - flag = ARKodeSetMaxNumSteps(arkode_mem, 10000); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1, my_pe)) { return (1); } + /* Call ARKStepSetMaxNumSteps to increase default */ + flag = ARKStepSetMaxNumSteps(arkode_mem, 10000); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1, my_pe)) { return (1); } - /* Call ARKodeSStolerances to specify the scalar relative tolerance + /* Call ARKStepSStolerances to specify the scalar relative tolerance and scalar absolute tolerances */ - flag = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKodeSStolerances", 1, my_pe)) { return (1); } + flag = ARKStepSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKStepSStolerances", 1, my_pe)) { return (1); } - /* Attach SPGMR solver structure to ARKODE interface */ - flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1, my_pe)) + /* Attach SPGMR solver structure to ARKStep interface */ + flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKStepSetLinearSolver", 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 = ARKodeSetPreconditioner(arkode_mem, Precond, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1, my_pe)) + flag = ARKStepSetPreconditioner(arkode_mem, Precond, PSolve); + if (check_flag(&flag, "ARKStepSetPreconditioner", 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 ARKodeEvolve, print results, test for error */ + /* In loop over output points, call ARKStepEvolve, print results, test for error */ for (iout = 1, tout = TWOHR; iout <= NOUT; iout++, tout += TWOHR) { - flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKodeEvolve", 1, my_pe)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKStepEvolve", 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); - ARKodeFree(&arkode_mem); + ARKStepFree(&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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1, my_pe); - flag = ARKodeGetLastStep(arkode_mem, &hu); - check_flag(&flag, "ARKodeGetLastStep", 1, my_pe); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1, my_pe); + flag = ARKStepGetLastStep(arkode_mem, &hu); + check_flag(&flag, "ARKStepGetLastStep", 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 = ARKodeGetWorkSpace(arkode_mem, &lenrw, &leniw); - check_flag(&flag, "ARKodeGetWorkSpace", 1, 0); - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1, 0); + flag = ARKStepGetWorkSpace(arkode_mem, &lenrw, &leniw); + check_flag(&flag, "ARKStepGetWorkSpace", 1, 0); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1, 0); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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); + 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); 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 a6c5f580fa..ffb0e71104 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 = 255 +lenrw = 3302 leniw = 243 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 0c0bf03fba..47373cb11f 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 ARKODE */ +/* User-supplied Functions called by ARKStep */ 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 ARKODE time stepper + Create ARKStep time stepper - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* Call ARKStepCreate to initialize the ARK timestepper module and @@ -225,28 +225,28 @@ int main(int argc, char** argv) CHKERRQ(ierr); /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Set ARKODE options + Set ARKStep options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - ierr = ARKodeSStolerances(arkode_mem, rtol, atol); - if (check_retval(&ierr, "ARKodeSStolerances", 1)) { return 1; } + ierr = ARKStepSStolerances(arkode_mem, rtol, atol); + if (check_retval(&ierr, "ARKStepSStolerances", 1)) { return 1; } - ierr = ARKodeSetOrder(arkode_mem, 3); - if (check_retval(&ierr, "ARKodeSetOrder", 1)) { return 1; } + ierr = ARKStepSetOrder(arkode_mem, 3); + if (check_retval(&ierr, "ARKStepSetOrder", 1)) { return 1; } - ierr = ARKodeSetUserData(arkode_mem, (void*)&user); - if (check_retval(&ierr, "ARKodeSetUserData", 1)) { return 1; } + ierr = ARKStepSetUserData(arkode_mem, (void*)&user); + if (check_retval(&ierr, "ARKStepSetUserData", 1)) { return 1; } - ierr = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&ierr, "ARKodeSetNonlinearSolver", 1)) { return 1; } + ierr = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&ierr, "ARKStepSetNonlinearSolver", 1)) { return 1; } C = SUNAdaptController_I(ctx); if (check_retval((void*)C, "SUNAdaptController_I", 0)) { return 1; } - ierr = ARKodeSetAdaptController(arkode_mem, C); - if (check_retval(&ierr, "ARKodeSetAdaptController", 1)) { return 1; } + ierr = ARKStepSetAdaptController(arkode_mem, C); + if (check_retval(&ierr, "ARKStepSetAdaptController", 1)) { return 1; } - ierr = ARKodeSetInitStep(arkode_mem, dt); - if (check_retval(&ierr, "ARKodeSetInitStep", 1)) { return 1; } + ierr = ARKStepSetInitStep(arkode_mem, dt); + if (check_retval(&ierr, "ARKStepSetInitStep", 1)) { return 1; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Perform the integration @@ -265,18 +265,18 @@ int main(int argc, char** argv) /* Advance time */ tstop += dtout; - ierr = ARKodeSetStopTime(arkode_mem, tstop); - if (check_retval(&ierr, "ARKodeSetStopTime", 1)) { return 1; } + ierr = ARKStepSetStopTime(arkode_mem, tstop); + if (check_retval(&ierr, "ARKStepSetStopTime", 1)) { return 1; } /* Evolve solution in time */ - ierr = ARKodeEvolve(arkode_mem, ftime, nvecx, &t, ARK_NORMAL); - if (check_retval(&ierr, "ARKodeEvolve", 1)) { return 1; } + ierr = ARKStepEvolve(arkode_mem, ftime, nvecx, &t, ARK_NORMAL); + if (check_retval(&ierr, "ARKStepEvolve", 1)) { return 1; } /* Get statistics */ - 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; } + 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; } } 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 */ - ARKodeFree(&arkode_mem); /* Free integrator memory */ + ARKStepFree(&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 ARKODE format + User provided functions in ARKStep 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 = ARKodeGetCurrentGamma(user->arkode_mem, &gamma); + ierr = ARKStepGetCurrentGamma(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 9f160e8df1..7bbbd42a6d 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 - * ARKodeSetLinearSolver are called only for the first run, whereas + * ARKStepSetLinearSolver are called only for the first run, whereas * ARKStepReInit, SUNLinSol_SPGMRSetPrecType, and * SUNLinSol_SPGMRSetGSType are called for each of the remaining * three runs. @@ -193,13 +193,6 @@ 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; @@ -301,32 +294,32 @@ int main(int argc, char* argv[]) wdata->arkode_mem = arkode_mem; - flag = ARKodeSetUserData(arkode_mem, wdata); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return (1); } + flag = ARKStepSetUserData(arkode_mem, wdata); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return (1); } - flag = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return (1); } + flag = ARKStepSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return (1); } - flag = ARKodeSetMaxNumSteps(arkode_mem, 1000); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return (1); } + flag = ARKStepSetMaxNumSteps(arkode_mem, 1000); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return (1); } - flag = ARKodeSetNonlinConvCoef(arkode_mem, 1.e-3); - if (check_flag(&flag, "ARKodeSetNonlinConvCoef", 1)) { return (1); } + flag = ARKStepSetNonlinConvCoef(arkode_mem, 1.e-3); + if (check_flag(&flag, "ARKStepSetNonlinConvCoef", 1)) { return (1); } LS = SUNLinSol_SPGMR(c, jpre, MAXL, ctx); if (check_flag((void*)LS, "SUNLinSol_SPGMR", 0)) { return (1); } - flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } flag = SUNLinSol_SPGMRSetGSType(LS, gstype); if (check_flag(&flag, "SUNLinSol_SPGMRSetGSType", 1)) { return (1); } - flag = ARKodeSetEpsLin(arkode_mem, DELT); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return (1); } + flag = ARKStepSetEpsLin(arkode_mem, DELT); + if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return (1); } - flag = ARKodeSetPreconditioner(arkode_mem, Precond, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return (1); } + flag = ARKStepSetPreconditioner(arkode_mem, Precond, PSolve); + if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return (1); } /* Set the linear solver tolerance conversion factor */ switch (nrmfactor) @@ -345,8 +338,8 @@ int main(int argc, char* argv[]) break; } - flag = ARKodeSetLSNormFactor(arkode_mem, nrmfac); - if (check_flag(&flag, "ARKodeSetLSNormFactor", 1)) { return (1); } + flag = ARKStepSetLSNormFactor(arkode_mem, nrmfac); + if (check_flag(&flag, "ARKStepSetLSNormFactor", 1)) { return (1); } } else { @@ -363,14 +356,14 @@ int main(int argc, char* argv[]) /* Print initial values */ if (firstrun) { PrintAllSpecies(c, ns, mxns, T0); } - /* Loop over output points, call ARKodeEvolve, print sample solution values. */ + /* Loop over output points, call ARKStepEvolve, print sample solution values. */ tout = T1; for (iout = 1; iout <= NOUT; iout++) { - flag = ARKodeEvolve(arkode_mem, tout, c, &t, ARK_NORMAL); + flag = ARKStepEvolve(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, "ARKodeEvolve", 1)) { break; } + if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } if (tout > SUN_RCONST(0.9)) { tout += DTOUT; } else { tout *= TOUT_MULT; } } @@ -381,7 +374,7 @@ int main(int argc, char* argv[]) } /* Free all memory */ - ARKodeFree(&arkode_mem); + ARKStepFree(&arkode_mem); N_VDestroy(c); SUNLinSolFree(LS); FreeUserData(wdata); @@ -631,14 +624,14 @@ static void PrintOutput(void* arkode_mem, sunrealtype t) int flag; sunrealtype hu; - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); - flag = ARKodeGetLastStep(arkode_mem, &hu); - check_flag(&flag, "ARKodeGetLastStep", 1); + flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); + flag = ARKStepGetLastStep(arkode_mem, &hu); + check_flag(&flag, "ARKStepGetLastStep", 1); #if defined(SUNDIALS_EXTENDED_PRECISION) printf("t = %10.2Le nst = %ld nfe = %ld nfi = %ld nni = %ld", t, nst, nfe, @@ -664,33 +657,33 @@ static void PrintFinalStats(void* arkode_mem) int flag; sunrealtype avdim; - flag = ARKodeGetWorkSpace(arkode_mem, &lenrw, &leniw); - check_flag(&flag, "ARKodeGetWorkSpace", 1); - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKStepGetWorkSpace(arkode_mem, &lenrw, &leniw); + check_flag(&flag, "ARKStepGetWorkSpace", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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); + 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); printf("\n\n Final statistics for this run:\n\n"); printf(" ARKStep real workspace length = %4ld \n", lenrw); @@ -853,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 = ARKodeGetErrWeights(arkode_mem, rewt); - if (check_flag(&flag, "ARKodeGetErrWeights", 1)) { return (1); } + flag = ARKStepGetErrWeights(arkode_mem, rewt); + if (check_flag(&flag, "ARKStepGetErrWeights", 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 e60c62304f..79d7c4a86f 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 = 143 + ARKStep integer workspace length = 131 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 = 148 + ARKStep integer workspace length = 136 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 = 153 + ARKStep integer workspace length = 141 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 = 158 + ARKStep integer workspace length = 146 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 e60c62304f..79d7c4a86f 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 = 143 + ARKStep integer workspace length = 131 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 = 148 + ARKStep integer workspace length = 136 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 = 153 + ARKStep integer workspace length = 141 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 = 158 + ARKStep integer workspace length = 146 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 e60c62304f..79d7c4a86f 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 = 143 + ARKStep integer workspace length = 131 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 = 148 + ARKStep integer workspace length = 136 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 = 153 + ARKStep integer workspace length = 141 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 = 158 + ARKStep integer workspace length = 146 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 c13bd87b15..eb1a7cd934 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 = 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; } + 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; } /* 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 = 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; } + 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; } /* Specify linearly implicit RHS, with non-time-dependent Jacobian */ - flag = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKStepEvolve", 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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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); + 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); 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 */ - ARKodeFree(&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 */ + ARKStepFree(&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 08d0fa5884..e1dd476909 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 ARKODE */ +/* User-supplied functions called by ARKStep */ 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 = 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; } + 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; } /* Initialize custom matrix-embedded linear solver */ LS = MatrixEmbeddedLS(arkode_mem, ctx); if (check_retval((void*)LS, "MatrixEmbeddedLS", 0)) { return 1; } - retval = ARKodeSetLinearSolver(arkode_mem, LS, NULL); /* Attach linear solver */ - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKStepSetLinearSolver(arkode_mem, LS, NULL); /* Attach linear solver */ + if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } /* Specify linearly implicit RHS, with non-time-dependent Jacobian */ - retval = ARKodeSetLinear(arkode_mem, 0); - if (check_retval(&retval, "ARKodeSetLinear", 1)) { return 1; } + retval = ARKStepSetLinear(arkode_mem, 0); + if (check_retval(&retval, "ARKStepSetLinear", 1)) { return 1; } - /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then prints results. Stops when the final time has been reached. */ t = T0; tout = T0 + dTout; @@ -131,8 +131,9 @@ int main(void) printf(" ---------------------\n"); while (Tf - t > 1.0e-15) { - retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = ARKStepEvolve(arkode_mem, tout, y, &t, + ARK_NORMAL); /* call integrator */ + if (check_retval(&retval, "ARKStepEvolve", 1)) { break; } printf(" %10.6" FSYM " %10.6" FSYM "\n", t, NV_Ith_S(y, 0)); /* access/print solution */ if (retval >= 0) @@ -149,24 +150,24 @@ int main(void) printf(" ---------------------\n"); /* Get/print some final statistics on how the solve progressed */ - retval = ARKodeGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKodeGetNumStepAttempts", 1); + retval = ARKStepGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKStepGetNumSteps", 1); + retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKStepGetNumStepAttempts", 1); retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 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); + 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); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -182,10 +183,10 @@ int main(void) retval = check_ans(y, t, reltol, abstol); /* Clean up and return */ - N_VDestroy(y); /* Free y vector */ - ARKodeFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNContext_Free(&ctx); /* Free the SUNContext */ + N_VDestroy(y); /* Free y vector */ + ARKStepFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solver */ + SUNContext_Free(&ctx); /* Free the SUNContext */ return retval; } @@ -249,10 +250,10 @@ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, sunrealtype* rdata; sunrealtype lamda; - /* 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)) + /* 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)) { return (-1); } diff --git a/examples/arkode/C_serial/ark_analytic_nonlin.c b/examples/arkode/C_serial/ark_analytic_nonlin.c index 1bb5f99987..f8a4565c55 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 = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ERKStepSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ERKStepSStolerances", 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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ERKStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ERKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ERKStepEvolve", 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 = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + flag = ERKStepPrintAllStats(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); + flag = ERKStepPrintAllStats(arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); fclose(FID); /* Clean up and return with successful completion */ - N_VDestroy(y); /* Free y vector */ - ARKodeFree(&arkode_mem); /* Free integrator memory */ - SUNContext_Free(&ctx); /* Free context */ + N_VDestroy(y); /* Free y vector */ + ERKStepFree(&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 f2ab415dbf..9dc799d308 100644 --- a/examples/arkode/C_serial/ark_brusselator.c +++ b/examples/arkode/C_serial/ark_brusselator.c @@ -168,42 +168,30 @@ int main(void) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - 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; } + 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; } /* 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; } /* Linear solver interface */ - 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; } + 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; } /* Open output stream for results, output comment line */ UFID = fopen("solution.txt", "w"); @@ -213,7 +201,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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; tout = T0 + dTout; @@ -224,8 +212,8 @@ int main(void) for (iout = 0; iout < Nt; iout++) { - flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKStepEvolve", 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)); @@ -246,26 +234,26 @@ int main(void) fclose(UFID); /* Print some final statistics */ - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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 = 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); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -279,11 +267,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 */ - ARKodeFree(&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 */ + ARKStepFree(&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.out b/examples/arkode/C_serial/ark_brusselator.out index dec501df56..260a9fb31b 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.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 + 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 ------------------------------------------- Final Solver Statistics: - Internal solver steps = 252 (attempted = 262) - Total RHS evals: Fe = 0, Fi = 1910 - Total linear solver setups = 111 + Internal solver steps = 250 (attempted = 262) + Total RHS evals: Fe = 0, Fi = 3282 + Total linear solver setups = 118 Total RHS evals for setting up the linear system = 0 - 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 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 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 38f312756c..abd7399099 100644 --- a/examples/arkode/C_serial/ark_brusselator1D.c +++ b/examples/arkode/C_serial/ark_brusselator1D.c @@ -207,29 +207,24 @@ int main(void) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - 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; } + 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; } /* 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; } /* Linear solver interface */ - 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; } + 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; } /* output spatial mesh to disk */ FID = fopen("bruss_mesh.txt", "w"); @@ -251,7 +246,7 @@ int main(void) fprintf(VFID, "\n"); fprintf(WFID, "\n"); - /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = (Tf - T0) / Nt; @@ -260,8 +255,8 @@ int main(void) printf(" ----------------------------------------------\n"); for (iout = 0; iout < Nt; iout++) { - flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } u = N_VWL2Norm(y, umask); /* access/print solution statistics */ u = sqrt(u * u / N); v = N_VWL2Norm(y, vmask); @@ -295,24 +290,24 @@ int main(void) fclose(WFID); /* Print some final statistics */ - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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); + 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); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -330,11 +325,11 @@ int main(void) N_VDestroy(umask); N_VDestroy(vmask); N_VDestroy(wmask); - 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 */ + 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 */ return 0; } diff --git a/examples/arkode/C_serial/ark_brusselator1D.out b/examples/arkode/C_serial/ark_brusselator1D.out index d430e862df..fed3032856 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 = 1186 + Total RHS evals: Fe = 0, Fi = 1694 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 b0ddf2295d..11d9dbab40 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c +++ b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c @@ -285,20 +285,16 @@ int main(int argc, char* argv[]) /* Set routines */ /* Pass udata to user functions */ - retval = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return (1); } + retval = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKStepSetUserData", 1)) { return (1); } /* Specify tolerances */ - retval = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return (1); } + retval = ARKStepSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKStepSStolerances", 1)) { return (1); } /* Specify residual tolerance */ - 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); } + retval = ARKStepResStolerance(arkode_mem, abstol); + if (check_retval(&retval, "ARKStepResStolerance", 1)) { return (1); } /* Initialize sparse matrix data structure and linear solvers (system and mass) */ NNZ = 15 * NEQ; @@ -315,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 ARKODE */ + /* Attach the matrix, linear solver, and Jacobian construction routine to ARKStep */ /* Attach matrix and LS */ - retval = ARKodeSetLinearSolver(arkode_mem, LS, A); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return (1); } + retval = ARKStepSetLinearSolver(arkode_mem, LS, A); + if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return (1); } /* Supply Jac routine */ - retval = ARKodeSetJacFn(arkode_mem, Jac); - if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return (1); } + retval = ARKStepSetJacFn(arkode_mem, Jac); + if (check_retval(&retval, "ARKStepSetJacFn", 1)) { return (1); } - /* Attach the mass matrix, linear solver and construction routines to ARKode; - notify ARKode that the mass matrix is not time-dependent */ + /* Attach the mass matrix, linear solver and construction routines to ARKStep; + notify ARKStep that the mass matrix is not time-dependent */ /* Attach matrix and LS */ - retval = ARKodeSetMassLinearSolver(arkode_mem, MLS, M, SUNFALSE); - if (check_retval(&retval, "ARKodeSetMassLinearSolver", 1)) { return (1); } + retval = ARKStepSetMassLinearSolver(arkode_mem, MLS, M, SUNFALSE); + if (check_retval(&retval, "ARKStepSetMassLinearSolver", 1)) { return (1); } /* Supply M routine */ - retval = ARKodeSetMassFn(arkode_mem, MassMatrix); - if (check_retval(&retval, "ARKodeSetMassFn", 1)) { return (1); } + retval = ARKStepSetMassFn(arkode_mem, MassMatrix); + if (check_retval(&retval, "ARKStepSetMassFn", 1)) { return (1); } /* output mesh to disk */ FID = fopen("bruss_FEM_mesh.txt", "w"); @@ -356,7 +352,7 @@ int main(int argc, char* argv[]) fprintf(VFID, "\n"); fprintf(WFID, "\n"); - /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = Tf / Nt; @@ -365,8 +361,9 @@ int main(int argc, char* argv[]) printf(" ----------------------------------------------\n"); for (iout = 0; iout < Nt; iout++) { - retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = ARKStepEvolve(arkode_mem, tout, y, &t, + ARK_NORMAL); /* call integrator */ + if (check_retval(&retval, "ARKStepEvolve", 1)) { break; } u = N_VWL2Norm(y, umask); /* access/print solution statistics */ u = sqrt(u * u / N); v = N_VWL2Norm(y, vmask); @@ -400,28 +397,28 @@ int main(int argc, char* argv[]) fclose(WFID); /* Print some final statistics */ - retval = ARKodeGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKodeGetNumStepAttempts", 1); + retval = ARKStepGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKStepGetNumSteps", 1); + retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKStepGetNumStepAttempts", 1); retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 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); + 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); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -445,8 +442,8 @@ int main(int argc, char* argv[]) N_VDestroy(udata->tmp); free(udata->x); free(udata); - ARKodeFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solvers */ + ARKStepFree(&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_FEM_slu.out b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.out index 8cae2ef2fe..863032a717 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 = 1111 + Total RHS evals: Fe = 0, Fi = 1596 Total mass matrix setups = 1 Total mass matrix solves = 193 Total mass times evals = 1688 diff --git a/examples/arkode/C_serial/ark_brusselator1D_imexmri.c b/examples/arkode/C_serial/ark_brusselator1D_imexmri.c index c1245a4f4e..7a557fa22a 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 = ARKodeSStolerances(inner_arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = ARKStepSStolerances(inner_arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } /* Attach matrix and linear solver */ - retval = ARKodeSetLinearSolver(inner_arkode_mem, LSf, Af); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKStepSetLinearSolver(inner_arkode_mem, LSf, Af); + if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } /* Set max number of nonlinear iters */ - retval = ARKodeSetMaxNonlinIters(inner_arkode_mem, 10); - if (check_retval(&retval, "ARKodeSetMaxNonlinIters", 1)) { return 1; } + retval = ARKStepSetMaxNonlinIters(inner_arkode_mem, 10); + if (check_retval(&retval, "ARKStepSetMaxNonlinIters", 1)) { return 1; } /* Set the Jacobian routine */ - retval = ARKodeSetJacFn(inner_arkode_mem, Jf); - if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + retval = ARKStepSetJacFn(inner_arkode_mem, Jf); + if (check_retval(&retval, "ARKStepSetJacFn", 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 = ARKodeSetOrder(inner_arkode_mem, 5); - if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } + retval = ARKStepSetOrder(inner_arkode_mem, 5); + if (check_retval(&retval, "ARKStepSetOrder", 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 = ARKodeSStolerances(inner_arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = ARKStepSStolerances(inner_arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } /* Attach matrix and linear solver */ - retval = ARKodeSetLinearSolver(inner_arkode_mem, LSf, Af); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKStepSetLinearSolver(inner_arkode_mem, LSf, Af); + if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } /* Set the Jacobian routine */ - retval = ARKodeSetJacFn(inner_arkode_mem, Jac); - if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + retval = ARKStepSetJacFn(inner_arkode_mem, Jac); + if (check_retval(&retval, "ARKStepSetJacFn", 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 = ARKodeSStolerances(inner_arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = ARKStepSStolerances(inner_arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } /* Attach matrix and linear solver */ - retval = ARKodeSetLinearSolver(inner_arkode_mem, LSf, Af); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKStepSetLinearSolver(inner_arkode_mem, LSf, Af); + if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } /* Set max number of nonlinear iters */ - retval = ARKodeSetMaxNonlinIters(inner_arkode_mem, 10); - if (check_retval(&retval, "ARKodeSetMaxNonlinIters", 1)) { return 1; } + retval = ARKStepSetMaxNonlinIters(inner_arkode_mem, 10); + if (check_retval(&retval, "ARKStepSetMaxNonlinIters", 1)) { return 1; } /* Set the Jacobian routine */ - retval = ARKodeSetJacFn(inner_arkode_mem, Jf); - if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + retval = ARKStepSetJacFn(inner_arkode_mem, Jf); + if (check_retval(&retval, "ARKStepSetJacFn", 1)) { return 1; } break; } /* Attach user data to fast integrator */ - retval = ARKodeSetUserData(inner_arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = ARKStepSetUserData(inner_arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKStepSetUserData", 1)) { return 1; } /* Set the fast step size */ - retval = ARKodeSetFixedStep(inner_arkode_mem, hf); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = ARKStepSetFixedStep(inner_arkode_mem, hf); + if (check_retval(&retval, "ARKStepSetFixedStep", 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 = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = MRIStepSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "MRIStepSStolerances", 1)) { return 1; } /* Attach matrix and linear solver */ - retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = MRIStepSetLinearSolver(arkode_mem, LSs, As); + if (check_retval(&retval, "MRIStepSetLinearSolver", 1)) { return 1; } /* Set the Jacobian routine */ - retval = ARKodeSetJacFn(arkode_mem, Js); - if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + retval = MRIStepSetJacFn(arkode_mem, Js); + if (check_retval(&retval, "MRIStepSetJacFn", 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 = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = MRIStepSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "MRIStepSStolerances", 1)) { return 1; } /* Attach matrix and linear solver */ - retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = MRIStepSetLinearSolver(arkode_mem, LSs, As); + if (check_retval(&retval, "MRIStepSetLinearSolver", 1)) { return 1; } /* Set the Jacobian routine */ - retval = ARKodeSetJacFn(arkode_mem, Jsi); - if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + retval = MRIStepSetJacFn(arkode_mem, Jsi); + if (check_retval(&retval, "MRIStepSetJacFn", 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 = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = MRIStepSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "MRIStepSStolerances", 1)) { return 1; } /* Attach matrix and linear solver */ - retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = MRIStepSetLinearSolver(arkode_mem, LSs, As); + if (check_retval(&retval, "MRIStepSetLinearSolver", 1)) { return 1; } /* Set the Jacobian routine */ - retval = ARKodeSetJacFn(arkode_mem, Jsi); - if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + retval = MRIStepSetJacFn(arkode_mem, Jsi); + if (check_retval(&retval, "MRIStepSetJacFn", 1)) { return 1; } break; } /* Pass udata to user functions */ - retval = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = MRIStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "MRIStepSetUserData", 1)) { return 1; } /* Set the slow step size */ - retval = ARKodeSetFixedStep(arkode_mem, hs); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = MRIStepSetFixedStep(arkode_mem, hs); + if (check_retval(&retval, "MRIStepSetFixedStep", 1)) { return 1; } /* Set maximum number of steps taken by solver */ - retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } + retval = MRIStepSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "MRIStepSetMaxNumSteps", 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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls MRIStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "MRIStepEvolve", 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 = ARKodeGetNumSteps(arkode_mem, &nsts); - check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = MRIStepGetNumSteps(arkode_mem, &nsts); + check_retval(&retval, "MRIStepGetNumSteps", 1); retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); check_retval(&retval, "MRIStepGetNumRhsEvals", 1); /* Get some fast integrator statistics */ - retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); - check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = ARKStepGetNumSteps(inner_arkode_mem, &nstf); + check_retval(&retval, "ARKStepGetNumSteps", 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 = ARKodeGetNonlinSolvStats(arkode_mem, &nnis, &nncs); - check_retval(&retval, "ARKodeGetNonlinSolvStats", 1); - retval = ARKodeGetNumJacEvals(arkode_mem, &njes); - check_retval(&retval, "ARKodeGetNumJacEvals", 1); + retval = MRIStepGetNonlinSolvStats(arkode_mem, &nnis, &nncs); + check_retval(&retval, "MRIStepGetNonlinSolvStats", 1); + retval = MRIStepGetNumJacEvals(arkode_mem, &njes); + check_retval(&retval, "MRIStepGetNumJacEvals", 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 = ARKodeGetNonlinSolvStats(inner_arkode_mem, &nnif, &nncf); - check_retval(&retval, "ARKodeGetNonlinSolvStats", 1); - retval = ARKodeGetNumJacEvals(inner_arkode_mem, &njef); - check_retval(&retval, "ARKodeGetNumJacEvals", 1); + retval = ARKStepGetNonlinSolvStats(inner_arkode_mem, &nnif, &nncf); + check_retval(&retval, "ARKStepGetNonlinSolvStats", 1); + retval = ARKStepGetNumJacEvals(inner_arkode_mem, &njef); + check_retval(&retval, "ARKStepGetNumJacEvals", 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 */ - ARKodeFree(&inner_arkode_mem); /* Free integrator memory */ + ARKStepFree(&inner_arkode_mem); /* Free integrator memory */ MRIStepInnerStepper_Free(&inner_stepper); /* Free inner stepper */ - ARKodeFree(&arkode_mem); /* Free integrator memory */ + MRIStepFree(&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 f5fc65b396..1c34e56c3c 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_klu.c +++ b/examples/arkode/C_serial/ark_brusselator1D_klu.c @@ -223,29 +223,24 @@ int main(void) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - 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; } + 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; } /* Initialize sparse matrix data structure and KLU solver */ 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; } + /* 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; } /* output spatial mesh to disk */ FID = fopen("bruss_mesh.txt", "w"); @@ -267,7 +262,7 @@ int main(void) fprintf(VFID, "\n"); fprintf(WFID, "\n"); - /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = Tf / Nt; @@ -276,7 +271,7 @@ int main(void) printf(" ----------------------------------------------\n"); for (iout = 0; iout < Nt; iout++) { - flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ u = N_VWL2Norm(y, umask); u = SUNRsqrt(u * u / N); v = N_VWL2Norm(y, vmask); @@ -310,22 +305,22 @@ int main(void) fclose(WFID); /* Print some final statistics */ - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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 = 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); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -344,10 +339,10 @@ int main(void) N_VDestroy(wmask); SUNMatDestroy(udata->R); /* Free user data */ free(udata); - ARKodeFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNMatDestroy(A); /* Free A matrix */ - SUNContext_Free(&ctx); /* Free context */ + ARKStepFree(&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_klu.out b/examples/arkode/C_serial/ark_brusselator1D_klu.out index a4e1828ee9..453cd212f8 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 = 1186 + Total RHS evals: Fe = 0, Fi = 1694 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_1D_mri.c b/examples/arkode/C_serial/ark_brusselator_1D_mri.c index ba858f7a0e..57171864e9 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 = ARKodeSetUserData(inner_arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = ARKStepSetUserData(inner_arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKStepSetUserData", 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 = ARKodeSStolerances(inner_arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = ARKStepSStolerances(inner_arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } /* Attach matrix and linear solver */ - retval = ARKodeSetLinearSolver(inner_arkode_mem, LS, A); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKStepSetLinearSolver(inner_arkode_mem, LS, A); + if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } /* Set the Jacobian routine */ - retval = ARKodeSetJacFn(inner_arkode_mem, Jf); - if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + retval = ARKStepSetJacFn(inner_arkode_mem, Jf); + if (check_retval(&retval, "ARKStepSetJacFn", 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 = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = MRIStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "MRIStepSetUserData", 1)) { return 1; } /* Set the slow step size */ - retval = ARKodeSetFixedStep(arkode_mem, hs); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = MRIStepSetFixedStep(arkode_mem, hs); + if (check_retval(&retval, "MRIStepSetFixedStep", 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 ARKodeEvolve to perform the integration, + /* Main time-stepping loop: calls ARKStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "MRIStepEvolve", 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 = ARKodeGetNumSteps(arkode_mem, &nsts); - check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = MRIStepGetNumSteps(arkode_mem, &nsts); + check_retval(&retval, "MRIStepGetNumSteps", 1); retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); check_retval(&retval, "MRIStepGetNumRhsEvals", 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 = ARKStepGetNumSteps(inner_arkode_mem, &nstf); + check_retval(&retval, "ARKStepGetNumSteps", 1); + retval = ARKStepGetNumStepAttempts(inner_arkode_mem, &nstf_a); + check_retval(&retval, "ARKStepGetNumStepAttempts", 1); retval = ARKStepGetNumRhsEvals(inner_arkode_mem, &nffe, &nffi); check_retval(&retval, "ARKStepGetNumRhsEvals", 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); + 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); /* 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 */ - ARKodeFree(&inner_arkode_mem); /* Free integrator memory */ + ARKStepFree(&inner_arkode_mem); /* Free integrator memory */ MRIStepInnerStepper_Free(&inner_stepper); /* Free inner stepper */ - ARKodeFree(&arkode_mem); /* Free integrator memory */ + MRIStepFree(&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 25380ff79e..012acd329e 100644 --- a/examples/arkode/C_serial/ark_brusselator_fp.c +++ b/examples/arkode/C_serial/ark_brusselator_fp.c @@ -185,27 +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 ARKODE */ + /* Initialize fixed-point nonlinear solver and attach to ARKStep */ NLS = SUNNonlinSol_FixedPoint(y, fp_m, ctx); if (check_flag((void*)NLS, "SUNNonlinSol_FixedPoint", 0)) { return 1; } - flag = ARKodeSetNonlinearSolver(arkode_mem, NLS); - if (check_flag(&flag, "ARKodeSetNonlinearSolver", 1)) { return 1; } + flag = ARKStepSetNonlinearSolver(arkode_mem, NLS); + if (check_flag(&flag, "ARKStepSetNonlinearSolver", 1)) { return 1; } /* Set routines */ - 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; } + 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; } /* Open output stream for results, output comment line */ UFID = fopen("solution.txt", "w"); @@ -215,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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; tout = T0 + dTout; @@ -223,8 +218,8 @@ int main(int argc, char* argv[]) printf(" ----------------------------------------------\n"); for (iout = 0; iout < Nt; iout++) { - flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKStepEvolve", 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)); @@ -245,18 +240,18 @@ int main(int argc, char* argv[]) fclose(UFID); /* Print some final statistics */ - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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 = 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); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -268,7 +263,7 @@ int main(int argc, char* argv[]) /* Clean up and return with successful completion */ N_VDestroy(y); - ARKodeFree(&arkode_mem); + ARKStepFree(&arkode_mem); SUNNonlinSolFree(NLS); SUNLogger_Destroy(&logger); SUNContext_Free(&ctx); diff --git a/examples/arkode/C_serial/ark_brusselator_fp.out b/examples/arkode/C_serial/ark_brusselator_fp.out index 76e1aa7768..ed5ca0e6f3 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 = 15142 + Total RHS evals: Fe = 4382, Fi = 18792 Total number of fixed-point iterations = 14410 Total number of nonlinear solver convergence failures = 0 Total number of error test failures = 1 diff --git a/examples/arkode/C_serial/ark_brusselator_fp_1.out b/examples/arkode/C_serial/ark_brusselator_fp_1.out index 76e1aa7768..ed5ca0e6f3 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 = 15142 + Total RHS evals: Fe = 4382, Fi = 18792 Total number of fixed-point iterations = 14410 Total number of nonlinear solver convergence failures = 0 Total number of error test failures = 1 diff --git a/examples/arkode/C_serial/ark_brusselator_mri.c b/examples/arkode/C_serial/ark_brusselator_mri.c index 0b636fd3a7..0fbca635e7 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 = ARKodeSetUserData(inner_arkode_mem, (void*)rdata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = ARKStepSetUserData(inner_arkode_mem, (void*)rdata); + if (check_retval(&retval, "ARKStepSetUserData", 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 = ARKodeSetFixedStep(inner_arkode_mem, hf); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = ARKStepSetFixedStep(inner_arkode_mem, hf); + if (check_retval(&retval, "ARKStepSetFixedStep", 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 = ARKodeSetUserData(arkode_mem, (void*)rdata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = MRIStepSetUserData(arkode_mem, (void*)rdata); + if (check_retval(&retval, "MRIStepSetUserData", 1)) { return 1; } /* Set the slow step size */ - retval = ARKodeSetFixedStep(arkode_mem, hs); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = MRIStepSetFixedStep(arkode_mem, hs); + if (check_retval(&retval, "MRIStepSetFixedStep", 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 ARKodeEvolve to perform the + /* Main time-stepping loop: calls MRIStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "MRIStepEvolve", 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 = ARKodeGetNumSteps(arkode_mem, &nsts); - check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = MRIStepGetNumSteps(arkode_mem, &nsts); + check_retval(&retval, "MRIStepGetNumSteps", 1); retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); check_retval(&retval, "MRIStepGetNumRhsEvals", 1); /* Get some fast integrator statistics */ - retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); - check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = ARKStepGetNumSteps(inner_arkode_mem, &nstf); + check_retval(&retval, "ARKStepGetNumSteps", 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 */ - ARKodeFree(&inner_arkode_mem); /* Free integrator memory */ + ARKStepFree(&inner_arkode_mem); /* Free integrator memory */ MRIStepInnerStepper_Free(&inner_stepper); /* Free inner stepper */ - ARKodeFree(&arkode_mem); /* Free integrator memory */ + MRIStepFree(&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 c9570e8bec..4ef129b9d3 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 = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + flag = ARKStepSStolerances(arkode_mem, reltol, abstol); + if (check_flag(flag, "ARKStepSStolerances")) { return 1; } if (relax) { /* Enable relaxation methods */ - flag = ARKodeSetRelaxFn(arkode_mem, Ent, JacEnt); - if (check_flag(flag, "ARKodeSetRelaxFn")) { return 1; } + flag = ARKStepSetRelaxFn(arkode_mem, Ent, JacEnt); + if (check_flag(flag, "ARKStepSetRelaxFn")) { 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 = ARKodeSetLinearSolver(arkode_mem, LS, A); - if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, A); + if (check_flag(flag, "ARKStepSetLinearSolver")) { return 1; } /* Set Jacobian routine */ - flag = ARKodeSetJacFn(arkode_mem, Jac); - if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } + flag = ARKStepSetJacFn(arkode_mem, Jac); + if (check_flag(flag, "ARKStepSetJacFn")) { 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 = ARKodeSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); - if (check_flag(flag, "ARKodeSetNonlinConvCoef")) { return 1; } + flag = ARKStepSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if (check_flag(flag, "ARKStepSetNonlinConvCoef")) { return 1; } } if (fixed_h > SUN_RCONST(0.0)) { - flag = ARKodeSetFixedStep(arkode_mem, fixed_h); - if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + flag = ARKStepSetFixedStep(arkode_mem, fixed_h); + if (check_flag(flag, "ARKStepSetFixedStep")) { 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 = ARKodeEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); - if (check_flag(flag, "ARKodeEvolve")) { break; } + flag = ARKStepEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); + if (check_flag(flag, "ARKStepEvolve")) { 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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ARKodeGetNumSteps"); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ARKStepGetNumSteps"); if (nst % 40 == 0) { @@ -331,14 +331,14 @@ int main(int argc, char* argv[]) * ------------ */ /* Get final statistics on how the solve progressed */ - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ARKodeGetNumSteps"); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ARKStepGetNumSteps"); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(flag, "ARKodeGetNumStepAttempts"); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(flag, "ARKStepGetNumStepAttempts"); - flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); - check_flag(flag, "ARKodeGetNumErrTestFails"); + flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); + check_flag(flag, "ARKStepGetNumErrTestFails"); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(flag, "ARKStepGetNumRhsEvals"); @@ -350,20 +350,20 @@ int main(int argc, char* argv[]) if (implicit) { - flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(flag, "ARKodeGetNumNonlinSolvIters"); + flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(flag, "ARKStepGetNumNonlinSolvIters"); - flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(flag, "ARKodeGetNumNonlinSolvConvFails"); + flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(flag, "ARKStepGetNumNonlinSolvConvFails"); - flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(flag, "ARKodeGetNumLinSolvSetups"); + flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(flag, "ARKStepGetNumLinSolvSetups"); - flag = ARKodeGetNumJacEvals(arkode_mem, &nje); - check_flag(flag, "ARKodeGetNumJacEvals"); + flag = ARKStepGetNumJacEvals(arkode_mem, &nje); + check_flag(flag, "ARKStepGetNumJacEvals"); - flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(flag, "ARKodeGetNumLinRhsEvals"); + flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(flag, "ARKStepGetNumLinRhsEvals"); 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 = ARKodeGetNumRelaxFnEvals(arkode_mem, &nre); - check_flag(flag, "ARKodeGetNumRelaxFnEvals"); + flag = ARKStepGetNumRelaxFnEvals(arkode_mem, &nre); + check_flag(flag, "ARKStepGetNumRelaxFnEvals"); - flag = ARKodeGetNumRelaxJacEvals(arkode_mem, &nrje); - check_flag(flag, "ARKodeGetNumRelaxJacEvals"); + flag = ARKStepGetNumRelaxJacEvals(arkode_mem, &nrje); + check_flag(flag, "ARKStepGetNumRelaxJacEvals"); - flag = ARKodeGetNumRelaxFails(arkode_mem, &nrf); - check_flag(flag, "ARKodeGetNumRelaxFails"); + flag = ARKStepGetNumRelaxFails(arkode_mem, &nrf); + check_flag(flag, "ARKStepGetNumRelaxFails"); - flag = ARKodeGetNumRelaxBoundFails(arkode_mem, &nrbf); - check_flag(flag, "ARKodeGetNumRelaxBoundFails"); + flag = ARKStepGetNumRelaxBoundFails(arkode_mem, &nrbf); + check_flag(flag, "ARKStepGetNumRelaxBoundFails"); - flag = ARKodeGetNumRelaxSolveFails(arkode_mem, &nrnlsf); - check_flag(flag, "ARKodeGetNumRelaxSolveFails"); + flag = ARKStepGetNumRelaxSolveFails(arkode_mem, &nrnlsf); + check_flag(flag, "ARKStepGetNumRelaxSolveFails"); - flag = ARKodeGetNumRelaxSolveIters(arkode_mem, &nrnlsi); - check_flag(flag, "ARKodeGetNumRelaxSolveIters"); + flag = ARKStepGetNumRelaxSolveIters(arkode_mem, &nrnlsi); + check_flag(flag, "ARKStepGetNumRelaxSolveIters"); 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 ARKode integrator and SUNDIALS objects */ - ARKodeFree(&arkode_mem); + /* Free ARKStep integrator and SUNDIALS objects */ + ARKStepFree(&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 6b73b0d999..e78a50e9bc 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 = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + flag = ERKStepSStolerances(arkode_mem, reltol, abstol); + if (check_flag(flag, "ERKStepSStolerances")) { return 1; } if (relax) { /* Enable relaxation methods */ - flag = ARKodeSetRelaxFn(arkode_mem, Ent, JacEnt); - if (check_flag(flag, "ARKodeSetRelaxFn")) { return 1; } + flag = ERKStepSetRelaxFn(arkode_mem, Ent, JacEnt); + if (check_flag(flag, "ERKStepSetRelaxFn")) { return 1; } } if (fixed_h > SUN_RCONST(0.0)) { - flag = ARKodeSetFixedStep(arkode_mem, fixed_h); - if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + flag = ERKStepSetFixedStep(arkode_mem, fixed_h); + if (check_flag(flag, "ERKStepSetFixedStep")) { 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 = ARKodeEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); - if (check_flag(flag, "ARKodeEvolve")) { break; } + flag = ERKStepEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); + if (check_flag(flag, "ERKStepEvolve")) { 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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ARKodeGetNumSteps"); + flag = ERKStepGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ERKStepGetNumSteps"); if (nst % 40 == 0) { @@ -291,14 +291,14 @@ int main(int argc, char* argv[]) * ------------ */ /* Get final statistics on how the solve progressed */ - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ARKodeGetNumSteps"); + flag = ERKStepGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ERKStepGetNumSteps"); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(flag, "ARKodeGetNumStepAttempts"); + flag = ERKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(flag, "ERKStepGetNumStepAttempts"); - flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); - check_flag(flag, "ARKodeGetNumErrTestFails"); + flag = ERKStepGetNumErrTestFails(arkode_mem, &netf); + check_flag(flag, "ERKStepGetNumErrTestFails"); flag = ERKStepGetNumRhsEvals(arkode_mem, &nfe); check_flag(flag, "ERKStepGetNumRhsEvals"); @@ -310,23 +310,23 @@ int main(int argc, char* argv[]) if (relax) { - flag = ARKodeGetNumRelaxFnEvals(arkode_mem, &nre); - check_flag(flag, "ARKodeGetNumRelaxFnEvals"); + flag = ERKStepGetNumRelaxFnEvals(arkode_mem, &nre); + check_flag(flag, "ERKStepGetNumRelaxFnEvals"); - flag = ARKodeGetNumRelaxJacEvals(arkode_mem, &nrje); - check_flag(flag, "ARKodeGetNumRelaxJacEvals"); + flag = ERKStepGetNumRelaxJacEvals(arkode_mem, &nrje); + check_flag(flag, "ERKStepGetNumRelaxJacEvals"); - flag = ARKodeGetNumRelaxFails(arkode_mem, &nrf); - check_flag(flag, "ARKodeGetNumRelaxFails"); + flag = ERKStepGetNumRelaxFails(arkode_mem, &nrf); + check_flag(flag, "ERKStepGetNumRelaxFails"); - flag = ARKodeGetNumRelaxBoundFails(arkode_mem, &nrbf); - check_flag(flag, "ARKodeGetNumRelaxBoundFails"); + flag = ERKStepGetNumRelaxBoundFails(arkode_mem, &nrbf); + check_flag(flag, "ERKStepGetNumRelaxBoundFails"); - flag = ARKodeGetNumRelaxSolveFails(arkode_mem, &nrnlsf); - check_flag(flag, "ARKodeGetNumRelaxSolveFails"); + flag = ERKStepGetNumRelaxSolveFails(arkode_mem, &nrnlsf); + check_flag(flag, "ERKStepGetNumRelaxSolveFails"); - flag = ARKodeGetNumRelaxSolveIters(arkode_mem, &nrnlsi); - check_flag(flag, "ARKodeGetNumRelaxSolveIters"); + flag = ERKStepGetNumRelaxSolveIters(arkode_mem, &nrnlsi); + check_flag(flag, "ERKStepGetNumRelaxSolveIters"); 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 ARKode integrator and SUNDIALS objects */ - ARKodeFree(&arkode_mem); + /* Free ERKStep integrator and SUNDIALS objects */ + ERKStepFree(&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 ec3b797928..79e6310538 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 = ARKodeSetOrder(arkode_mem, order); - if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } + retval = SPRKStepSetOrder(arkode_mem, order); + if (check_retval(&retval, "SPRKStepSetOrder", 1)) { return 1; } retval = SPRKStepSetUseCompensatedSums(arkode_mem, use_compsums); if (check_retval(&retval, "SPRKStepSetUseCompensatedSums", 1)) { return 1; } - retval = ARKodeSetFixedStep(arkode_mem, dt); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = SPRKStepSetFixedStep(arkode_mem, dt); + if (check_retval(&retval, "SPRKStepSetFixedStep", 1)) { return 1; } - retval = ARKodeSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 2); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } + retval = SPRKStepSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 2); + if (check_retval(&retval, "SPRKStepSetMaxNumSteps", 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) { ARKodeSetStopTime(arkode_mem, tout); } - retval = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + if (args.use_tstop) { SPRKStepSetStopTime(arkode_mem, tout); } + retval = SPRKStepEvolve(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,17 +149,17 @@ int main(int argc, char* argv[]) } fprintf(stdout, "\n"); - ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + SPRKStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); N_VDestroy(y); - ARKodeFree(&arkode_mem); + SPRKStepFree(&arkode_mem); SUNContext_Free(&sunctx); return 0; } -static sunrealtype omega(sunrealtype t) { return cos(t / SUN_RCONST(2.0)); } +sunrealtype omega(sunrealtype t) { return cos(t / SUN_RCONST(2.0)); } -static sunrealtype F(sunrealtype t) { return SUN_RCONST(0.018) * sin(t / PI); } +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_dissipated_exp_entropy.c b/examples/arkode/C_serial/ark_dissipated_exp_entropy.c index 5b071b61ae..7f6db669c1 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 = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + flag = ARKStepSStolerances(arkode_mem, reltol, abstol); + if (check_flag(flag, "ARKStepSStolerances")) { return 1; } if (relax) { /* Enable relaxation methods */ - flag = ARKodeSetRelaxFn(arkode_mem, Ent, JacEnt); - if (check_flag(flag, "ARKodeSetRelaxFn")) { return 1; } + flag = ARKStepSetRelaxFn(arkode_mem, Ent, JacEnt); + if (check_flag(flag, "ARKStepSetRelaxFn")) { 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 = ARKodeSetLinearSolver(arkode_mem, LS, A); - if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, A); + if (check_flag(flag, "ARKStepSetLinearSolver")) { return 1; } /* Set Jacobian routine */ - flag = ARKodeSetJacFn(arkode_mem, Jac); - if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } + flag = ARKStepSetJacFn(arkode_mem, Jac); + if (check_flag(flag, "ARKStepSetJacFn")) { 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 = ARKodeSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); - if (check_flag(flag, "ARKodeSetNonlinConvCoef")) { return 1; } + flag = ARKStepSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if (check_flag(flag, "ARKStepSetNonlinConvCoef")) { return 1; } } if (fixed_h > SUN_RCONST(0.0)) { - flag = ARKodeSetFixedStep(arkode_mem, fixed_h); - if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + flag = ARKStepSetFixedStep(arkode_mem, fixed_h); + if (check_flag(flag, "ARKStepSetFixedStep")) { 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 = ARKodeEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); - if (check_flag(flag, "ARKodeEvolve")) { break; } + flag = ARKStepEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); + if (check_flag(flag, "ARKStepEvolve")) { 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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ARKodeGetNumSteps"); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ARKStepGetNumSteps"); if (nst % 40 == 0) { @@ -309,14 +309,14 @@ int main(int argc, char* argv[]) * ------------ */ /* Get final statistics on how the solve progressed */ - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ARKodeGetNumSteps"); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ARKStepGetNumSteps"); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(flag, "ARKodeGetNumStepAttempts"); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(flag, "ARKStepGetNumStepAttempts"); - flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); - check_flag(flag, "ARKodeGetNumErrTestFails"); + flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); + check_flag(flag, "ARKStepGetNumErrTestFails"); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(flag, "ARKStepGetNumRhsEvals"); @@ -328,20 +328,20 @@ int main(int argc, char* argv[]) if (implicit) { - flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(flag, "ARKodeGetNumNonlinSolvIters"); + flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(flag, "ARKStepGetNumNonlinSolvIters"); - flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(flag, "ARKodeGetNumNonlinSolvConvFails"); + flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(flag, "ARKStepGetNumNonlinSolvConvFails"); - flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(flag, "ARKodeGetNumLinSolvSetups"); + flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(flag, "ARKStepGetNumLinSolvSetups"); - flag = ARKodeGetNumJacEvals(arkode_mem, &nje); - check_flag(flag, "ARKodeGetNumJacEvals"); + flag = ARKStepGetNumJacEvals(arkode_mem, &nje); + check_flag(flag, "ARKStepGetNumJacEvals"); - flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(flag, "ARKodeGetNumLinRhsEvals"); + flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(flag, "ARKStepGetNumLinRhsEvals"); 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 = ARKodeGetNumRelaxFnEvals(arkode_mem, &nre); - check_flag(flag, "ARKodeGetNumRelaxFnEvals"); + flag = ARKStepGetNumRelaxFnEvals(arkode_mem, &nre); + check_flag(flag, "ARKStepGetNumRelaxFnEvals"); - flag = ARKodeGetNumRelaxJacEvals(arkode_mem, &nrje); - check_flag(flag, "ARKodeGetNumRelaxJacEvals"); + flag = ARKStepGetNumRelaxJacEvals(arkode_mem, &nrje); + check_flag(flag, "ARKStepGetNumRelaxJacEvals"); - flag = ARKodeGetNumRelaxFails(arkode_mem, &nrf); - check_flag(flag, "ARKodeGetNumRelaxFails"); + flag = ARKStepGetNumRelaxFails(arkode_mem, &nrf); + check_flag(flag, "ARKStepGetNumRelaxFails"); - flag = ARKodeGetNumRelaxBoundFails(arkode_mem, &nrbf); - check_flag(flag, "ARKodeGetNumRelaxBoundFails"); + flag = ARKStepGetNumRelaxBoundFails(arkode_mem, &nrbf); + check_flag(flag, "ARKStepGetNumRelaxBoundFails"); - flag = ARKodeGetNumRelaxSolveFails(arkode_mem, &nrnlsf); - check_flag(flag, "ARKodeGetNumRelaxSolveFails"); + flag = ARKStepGetNumRelaxSolveFails(arkode_mem, &nrnlsf); + check_flag(flag, "ARKStepGetNumRelaxSolveFails"); - flag = ARKodeGetNumRelaxSolveIters(arkode_mem, &nrnlsi); - check_flag(flag, "ARKodeGetNumRelaxSolveIters"); + flag = ARKStepGetNumRelaxSolveIters(arkode_mem, &nrnlsi); + check_flag(flag, "ARKStepGetNumRelaxSolveIters"); 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 ARKODE integrator and SUNDIALS objects */ - ARKodeFree(&arkode_mem); + /* Free ARKStep integrator and SUNDIALS objects */ + ARKStepFree(&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 72ddfa656c..411c49ea63 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 = ARKodeSetOrder(arkode_mem, order); - if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } + retval = SPRKStepSetOrder(arkode_mem, order); + if (check_retval(&retval, "SPRKStepSetOrder", 1)) { return 1; } - retval = ARKodeSetUserData(arkode_mem, &udata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = SPRKStepSetUserData(arkode_mem, &udata); + if (check_retval(&retval, "SPRKStepSetUserData", 1)) { return 1; } retval = SPRKStepSetUseCompensatedSums(arkode_mem, use_compsums); if (check_retval(&retval, "SPRKStepSetUseCompensatedSums", 1)) { return 1; } - retval = ARKodeSetFixedStep(arkode_mem, dt); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = SPRKStepSetFixedStep(arkode_mem, dt); + if (check_retval(&retval, "SPRKStepSetFixedStep", 1)) { return 1; } - retval = ARKodeSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 2); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } + retval = SPRKStepSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 2); + if (check_retval(&retval, "SPRKStepSetMaxNumSteps", 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) { ARKodeSetStopTime(arkode_mem, tout); } - retval = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + if (args.use_tstop) { SPRKStepSetStopTime(arkode_mem, tout); } + retval = SPRKStepEvolve(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); - ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); - ARKodeFree(&arkode_mem); + SPRKStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + SPRKStepFree(&arkode_mem); SUNContext_Free(&sunctx); return 0; diff --git a/examples/arkode/C_serial/ark_harmonic_symplectic.h b/examples/arkode/C_serial/ark_harmonic_symplectic.h index 498c4eb0d1..816961e6e5 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; -static void PrintHelp(void) +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 @@ static void PrintHelp(void) /* clang-format on */ } -static int ParseArgs(int argc, char* argv[], ProgramArgs* args) +int ParseArgs(int argc, char* argv[], ProgramArgs* args) { int argi = 0; @@ -110,7 +110,7 @@ static int ParseArgs(int argc, char* argv[], ProgramArgs* args) opt == 2 means function allocates memory so check if returned NULL pointer */ -static int check_retval(void* returnvalue, const char* funcname, int opt) +int check_retval(void* returnvalue, const char* funcname, int opt) { int* retval; diff --git a/examples/arkode/C_serial/ark_heat1D.c b/examples/arkode/C_serial/ark_heat1D.c index c5e7597ecb..eb6609029d 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 = 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; } + 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; } /* 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 = 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; } + 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; } /* Specify linearly implicit RHS, with non-time-dependent Jacobian */ - flag = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKStepEvolve", 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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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); + 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); 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 */ - ARKodeFree(&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 */ + ARKStepFree(&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 3f9e349073..2852bffc4a 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 = 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 = 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, "ARKodeSetAdaptivityMethod", 1)) { return 1; } - flag = ARKodeSetPredictorMethod(arkode_mem, 0); /* Set predictor method */ - if (check_flag(&flag, "ARKodeSetPredictorMethod", 1)) { return 1; } + if (check_flag(&flag, "ARKStepSetAdaptivityMethod", 1)) { return 1; } + flag = ARKStepSetPredictorMethod(arkode_mem, 0); /* Set predictor method */ + if (check_flag(&flag, "ARKStepSetPredictorMethod", 1)) { return 1; } /* Specify linearly implicit RHS, with time-dependent Jacobian */ - flag = ARKodeSetLinear(arkode_mem, 1); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 1); + if (check_flag(&flag, "ARKStepSetLinear", 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 = 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; } + 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; } - /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve 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 = ARKodeSetStopTime(arkode_mem, Tf); - if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = ARKStepSetStopTime(arkode_mem, Tf); + if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } /* call integrator */ - flag = ARKodeEvolve(arkode_mem, Tf, y, &t, ARK_ONE_STEP); - if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } + flag = ARKStepEvolve(arkode_mem, Tf, y, &t, ARK_ONE_STEP); + if (check_flag(&flag, "ARKStepEvolve", 1)) { return 1; } /* "get" routines */ - 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; } + 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; } /* print current solution stats */ iout++; @@ -262,18 +262,18 @@ int main(void) y = y2; y2 = yt; - /* 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; } + /* 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; } - /* destroy and re-allocate linear solver memory; reattach to ARKODE interface */ + /* destroy and re-allocate linear solver memory; reattach to ARKStep interface */ SUNLinSolFree(LS); LS = SUNLinSol_PCG(y, 0, (int)N, ctx); if (check_flag((void*)LS, "SUNLinSol_PCG", 0)) { 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; } + 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; } } printf(" --------------------------------------------------------------------" "--------------------\n"); @@ -290,9 +290,9 @@ int main(void) N_VDestroy(y); /* Free vectors */ free(udata->x); /* Free user data */ free(udata); - ARKodeFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNContext_Free(&ctx); /* Free context */ + ARKStepFree(&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 5492d040fd..f6fd9982d5 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) { - ARKodeRootInit(arkode_mem, 1, rootfn); - if (check_retval(&retval, "ARKodeRootInit", 1)) { return 1; } + SPRKStepRootInit(arkode_mem, 1, rootfn); + if (check_retval(&retval, "SPRKStepRootInit", 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 = ARKodeSetFixedStep(arkode_mem, dt); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = SPRKStepSetFixedStep(arkode_mem, dt); + if (check_retval(&retval, "SPRKStepSetFixedStep", 1)) { return 1; } - retval = ARKodeSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 1); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } + retval = SPRKStepSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 1); + if (check_retval(&retval, "SPRKStepSetMaxNumSteps", 1)) { return 1; } } else { @@ -186,8 +186,8 @@ int SolveProblem(ProgramArgs* args, ProblemResult* result, SUNContext sunctx) return 1; } - retval = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = SPRKStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "SPRKStepSetUserData", 1)) { return 1; } } else if (stepper == 1) { @@ -198,21 +198,21 @@ int SolveProblem(ProgramArgs* args, ProblemResult* result, SUNContext sunctx) if (count_orbits) { - ARKodeRootInit(arkode_mem, 1, rootfn); - if (check_retval(&retval, "ARKodeRootInit", 1)) { return 1; } + ARKStepRootInit(arkode_mem, 1, rootfn); + if (check_retval(&retval, "ARKStepRootInit", 1)) { return 1; } } - retval = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = ARKStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKStepSetUserData", 1)) { return 1; } - retval = ARKodeSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 1); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } + retval = ARKStepSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 1); + if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1)) { return 1; } - if (step_mode == 0) { retval = ARKodeSetFixedStep(arkode_mem, dt); } + if (step_mode == 0) { retval = ARKStepSetFixedStep(arkode_mem, dt); } else { - retval = ARKodeSStolerances(arkode_mem, dt, dt); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = ARKStepSStolerances(arkode_mem, dt, dt); + if (check_retval(&retval, "ARKStepSStolerances", 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) { ARKodeSetStopTime(arkode_mem, tout); } - retval = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + if (args->use_tstop) { SPRKStepSetStopTime(arkode_mem, tout); } + retval = SPRKStepEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); if (retval == ARK_ROOT_RETURN) { num_orbits += SUN_RCONST(0.5); fprintf(stdout, "ROOT RETURN:\t"); - ARKodeGetRootInfo(arkode_mem, &rootsfound); + SPRKStepGetRootInfo(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) { ARKodeSetStopTime(arkode_mem, tout); } - retval = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + if (args->use_tstop) { ARKStepSetStopTime(arkode_mem, tout); } + retval = ARKStepEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); if (retval == ARK_ROOT_RETURN) { num_orbits += SUN_RCONST(0.5); fprintf(stdout, "ROOT RETURN:\t"); - ARKodeGetRootInfo(arkode_mem, &rootsfound); + ARKStepGetRootInfo(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,8 +361,17 @@ int SolveProblem(ProgramArgs* args, ProblemResult* result, SUNContext sunctx) fclose(solution_fp); if (NLS) { SUNNonlinSolFree(NLS); } N_VDestroy(y); - ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); - ARKodeFree(&arkode_mem); + if (stepper == 0) + { + SPRKStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + SPRKStepFree(&arkode_mem); + } + else + { + ARKStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + ARKStepFree(&arkode_mem); + } + return 0; } diff --git a/examples/arkode/C_serial/ark_kepler.h b/examples/arkode/C_serial/ark_kepler.h index d487347466..01f40f26b5 100644 --- a/examples/arkode/C_serial/ark_kepler.h +++ b/examples/arkode/C_serial/ark_kepler.h @@ -37,12 +37,11 @@ typedef struct const char* method_name; } ProgramArgs; -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) +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/examples/arkode/C_serial/ark_kpr_mri.c b/examples/arkode/C_serial/ark_kpr_mri.c index 6ba73c89ae..af9fad93a0 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 = 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; } + 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; } 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 = ARKodeSetUserData(inner_arkode_mem, (void*)rpar); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = ARKStepSetUserData(inner_arkode_mem, (void*)rpar); + if (check_retval(&retval, "ARKStepSetUserData", 1)) { return 1; } /* Set the fast step size */ - retval = ARKodeSetFixedStep(inner_arkode_mem, hf); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = ARKStepSetFixedStep(inner_arkode_mem, hf); + if (check_retval(&retval, "ARKStepSetFixedStep", 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 = 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; } + 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; } 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 = 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; } + 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; } 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 = 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; } + 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; } 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 = 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; } + 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; } break; } /* Set the user data pointer */ - retval = ARKodeSetUserData(arkode_mem, (void*)rpar); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = MRIStepSetUserData(arkode_mem, (void*)rpar); + if (check_retval(&retval, "MRIStepSetUserData", 1)) { return 1; } - retval = ARKodeSetDeduceImplicitRhs(arkode_mem, deduce); - if (check_retval(&retval, "ARKodeSetDeduceImplicitRhs", 1)) { return 1; } + retval = MRIStepSetDeduceImplicitRhs(arkode_mem, deduce); + if (check_retval(&retval, "MRIStepSetDeduceImplicitRhs", 1)) { return 1; } /* Set the slow step size */ - retval = ARKodeSetFixedStep(arkode_mem, hs); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = MRIStepSetFixedStep(arkode_mem, hs); + if (check_retval(&retval, "MRIStepSetFixedStep", 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 ARKodeEvolve to perform the + /* Main time-stepping loop: calls MRIStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "MRIStepEvolve", 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 = ARKodeGetNumSteps(arkode_mem, &nsts); - check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = MRIStepGetNumSteps(arkode_mem, &nsts); + check_retval(&retval, "MRIStepGetNumSteps", 1); retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); check_retval(&retval, "MRIStepGetNumRhsEvals", 1); /* Get some fast integrator statistics */ - retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); - check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = ARKStepGetNumSteps(inner_arkode_mem, &nstf); + check_retval(&retval, "ARKStepGetNumSteps", 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 = ARKodeGetNonlinSolvStats(arkode_mem, &nnis, &nncs); - check_retval(&retval, "ARKodeGetNonlinSolvStats", 1); - retval = ARKodeGetNumJacEvals(arkode_mem, &njes); - check_retval(&retval, "ARKodeGetNumJacEvals", 1); + retval = MRIStepGetNonlinSolvStats(arkode_mem, &nnis, &nncs); + check_retval(&retval, "MRIStepGetNonlinSolvStats", 1); + retval = MRIStepGetNumJacEvals(arkode_mem, &njes); + check_retval(&retval, "MRIStepGetNumJacEvals", 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 = ARKodeGetNonlinSolvStats(inner_arkode_mem, &nnif, &nncf); - check_retval(&retval, "ARKodeGetNonlinSolvStats", 1); - retval = ARKodeGetNumJacEvals(inner_arkode_mem, &njef); - check_retval(&retval, "ARKodeGetNumJacEvals", 1); + retval = ARKStepGetNonlinSolvStats(inner_arkode_mem, &nnif, &nncf); + check_retval(&retval, "ARKStepGetNonlinSolvStats", 1); + retval = ARKStepGetNumJacEvals(inner_arkode_mem, &njef); + check_retval(&retval, "ARKStepGetNumJacEvals", 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 */ - ARKodeFree(&inner_arkode_mem); /* Free fast integrator memory */ + ARKStepFree(&inner_arkode_mem); /* Free fast integrator memory */ MRIStepInnerStepper_Free(&inner_stepper); /* Free inner stepper */ - ARKodeFree(&arkode_mem); /* Free slow integrator memory */ + MRIStepFree(&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 d6993383fe..a0842f2736 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 = ARKodeSetFixedStep(inner_arkode_mem, hf); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = ARKStepSetFixedStep(inner_arkode_mem, hf); + if (check_retval(&retval, "ARKStepSetFixedStep", 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 = ARKodeSetFixedStep(arkode_mem, hs); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = MRIStepSetFixedStep(arkode_mem, hs); + if (check_retval(&retval, "MRIStepSetFixedStep", 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 ARKodeEvolve to perform the + /* Main time-stepping loop: calls MRIStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "MRIStepEvolve", 1)) { break; } /* compute the analytic solution */ retval = ans(t, ytrue, NULL); @@ -226,14 +226,14 @@ int main(void) */ /* Get some slow integrator statistics */ - retval = ARKodeGetNumSteps(arkode_mem, &nsts); - check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = MRIStepGetNumSteps(arkode_mem, &nsts); + check_retval(&retval, "MRIStepGetNumSteps", 1); retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); check_retval(&retval, "MRIStepGetNumRhsEvals", 1); /* Get some fast integrator statistics */ - retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); - check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = ARKStepGetNumSteps(inner_arkode_mem, &nstf); + check_retval(&retval, "ARKStepGetNumSteps", 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 */ - ARKodeFree(&inner_arkode_mem); /* Free integrator memory */ + ARKStepFree(&inner_arkode_mem); /* Free integrator memory */ MRIStepInnerStepper_Free(&inner_stepper); /* Free inner stepper */ - ARKodeFree(&arkode_mem); /* Free integrator memory */ + MRIStepFree(&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 65a4ca73bf..b11cc23b61 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 = ARKodeSetUserData(inner_arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = ARKStepSetUserData(inner_arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKStepSetUserData", 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 = ARKodeSetFixedStep(inner_arkode_mem, hf); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = ARKStepSetFixedStep(inner_arkode_mem, hf); + if (check_retval(&retval, "ARKStepSetFixedStep", 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 = ARKodeSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = MRIStepSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "MRIStepSetUserData", 1)) { return 1; } /* Set the slow step size */ - retval = ARKodeSetFixedStep(arkode_mem, hs); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = MRIStepSetFixedStep(arkode_mem, hs); + if (check_retval(&retval, "MRIStepSetFixedStep", 1)) { return 1; } /* Increase max num steps */ - retval = ARKodeSetMaxNumSteps(arkode_mem, 10000); - if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } + retval = MRIStepSetMaxNumSteps(arkode_mem, 10000); + if (check_retval(&retval, "MRIStepSetMaxNumSteps", 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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls MRIStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "MRIStepEvolve", 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 = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + retval = MRIStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); printf("\nFinal Fast Statistics:\n"); - retval = ARKodePrintAllStats(inner_arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + retval = ARKStepPrintAllStats(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 = ARKodePrintAllStats(arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); + retval = MRIStepPrintAllStats(arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); fclose(FID); FID = fopen("ark_reaction_diffusion_mri_fast_stats.csv", "w"); - retval = ARKodePrintAllStats(inner_arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); + retval = ARKStepPrintAllStats(inner_arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); fclose(FID); /* Clean up and return */ N_VDestroy(y); /* Free y vector */ - ARKodeFree(&inner_arkode_mem); /* Free integrator memory */ + ARKStepFree(&inner_arkode_mem); /* Free integrator memory */ MRIStepInnerStepper_Free(&inner_stepper); /* Free inner stepper */ - ARKodeFree(&arkode_mem); /* Free integrator memory */ + MRIStepFree(&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 833861243d..b4e47e214d 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 = 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 = 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; } /* 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 = 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 = 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; } /* 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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKStepEvolve", 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 = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + flag = ARKStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); /* Print final statistics to a file in CSV format */ FID = fopen("ark_robertson_stats.csv", "w"); - flag = ARKodePrintAllStats(arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); + flag = ARKStepPrintAllStats(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 */ - ARKodeFree(&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 */ + ARKStepFree(&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 8c247dbf28..43b4718ebc 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 = 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; } + 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; } /* 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 = 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 = 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; } /* 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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKStepEvolve", 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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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); + 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); 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 */ - ARKodeFree(&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 */ + ARKStepFree(&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 a4aa8fb066..be0782279c 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 = 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; } + 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; } /* Specify the root-finding function, having 2 equations */ - flag = ARKodeRootInit(arkode_mem, 2, g); - if (check_flag(&flag, "ARKodeRootInit", 1)) { return 1; } + flag = ARKStepRootInit(arkode_mem, 2, g); + if (check_flag(&flag, "ARKStepRootInit", 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 = 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 = 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; } /* 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 ARKodeEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKStepEvolve", 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 = ARKodeGetRootInfo(arkode_mem, rootsfound); - if (check_flag(&rtflag, "ARKodeGetRootInfo", 1)) { return 1; } + rtflag = ARKStepGetRootInfo(arkode_mem, rootsfound); + if (check_flag(&rtflag, "ARKStepGetRootInfo", 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 = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 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); + 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); 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 */ - ARKodeFree(&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 */ + ARKStepFree(&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 d44204d38f..ec05170aec 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 = ARKodeSetFixedStep(inner_arkode_mem, hf); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = ARKStepSetFixedStep(inner_arkode_mem, hf); + if (check_retval(&retval, "ARKStepSetFixedStep", 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 = ARKodeSetFixedStep(arkode_mem, hs); - if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } + retval = MRIStepSetFixedStep(arkode_mem, hs); + if (check_retval(&retval, "MRIStepSetFixedStep", 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 ARKodeEvolve to perform the + /* Main time-stepping loop: calls MRIStepEvolve 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 = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } + retval = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "MRIStepEvolve", 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 = ARKodeGetNumSteps(arkode_mem, &nsts); - check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = MRIStepGetNumSteps(arkode_mem, &nsts); + check_retval(&retval, "MRIStepGetNumSteps", 1); retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); check_retval(&retval, "MRIStepGetNumRhsEvals", 1); /* Get some fast integrator statistics */ - retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); - check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = ARKStepGetNumSteps(inner_arkode_mem, &nstf); + check_retval(&retval, "ARKStepGetNumSteps", 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 */ - ARKodeFree(&inner_arkode_mem); /* Free integrator memory */ + ARKStepFree(&inner_arkode_mem); /* Free integrator memory */ MRIStepInnerStepper_Free(&inner_stepper); /* Free inner stepper */ - ARKodeFree(&arkode_mem); /* Free integrator memory */ + MRIStepFree(&arkode_mem); /* Free integrator memory */ SUNContext_Free(&ctx); /* Free context */ return 0; diff --git a/examples/arkode/F2003_custom/CMakeLists.txt b/examples/arkode/F2003_custom/CMakeLists.txt index 98abe2d887..6393b31306 100644 --- a/examples/arkode/F2003_custom/CMakeLists.txt +++ b/examples/arkode/F2003_custom/CMakeLists.txt @@ -17,22 +17,18 @@ # 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_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" + ) -endif() +set(FARKODE_tests + "test_fnvector_complex_mod\;develop" + "test_fnvector_fortran_mod\;develop" + "test_fsunmatrix_fortran_mod\;develop" + "test_fsunlinsol_fortran_mod\;develop" + ) # note the order matters when auto-generating the installed Makefile set(FARKODEsources @@ -56,7 +52,7 @@ foreach(example_tuple ${FARKODE_examples}) list(GET example_tuple 0 example) list(GET example_tuple 1 example_type) - # build fortran modules into a unique directory to avoid naming collisions + # 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 diff --git a/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 b/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 index ad1c64c8fa..fc1e3c3c5d 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_long), 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 + ! main time-stepping loop: calls FARKStepEvolve 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 - end if + ! call integrator + ierr = FARKStepEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) + if (ierr /= 0) then + write(*,*) 'Error in FARKStepEvolve, ierr = ', ierr, '; halting' + stop 1 + endif - ! 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 @@ -208,12 +208,13 @@ program main print *, ' ' ! clean up - call FARKodeFree(arkode_mem) + call FARKStepFree(arkode_mem) call FN_VDestroy(sunvec_y) ierr = FSUNContext_Free(sunctx) end program main + ! ---------------------------------------------------------------- ! ARKStepStats ! @@ -240,16 +241,16 @@ subroutine ARKStepStats(arkode_mem) !======= Internals ============ - ierr = FARKodeGetNumSteps(arkode_mem, nsteps) - ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) + ierr = FARKStepGetNumSteps(arkode_mem, nsteps) + ierr = FARKStepGetNumStepAttempts(arkode_mem, nst_a) ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) - ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) + ierr = FARKStepGetNumErrTestFails(arkode_mem, netfails) 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 71e577acd5..86a7d97447 100644 --- a/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 +++ b/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 @@ -51,21 +51,21 @@ module ode_mod !======= Declarations ========= implicit none - integer(c_int64_t), parameter :: N = 201 ! number of intervals + integer(c_long), parameter :: N = 201 ! number of intervals 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 + integer(c_long), parameter :: Nvar = 3 ! number of solution fields + integer(c_long), 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 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 @@ -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_int64_t) :: i + integer(c_long) :: i !======= Internals ============ @@ -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 @@ -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_int64_t) :: i, j + integer(c_long) :: i, j !======= Internals ============ @@ -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 @@ -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_int64_t) :: i + integer(c_long) :: i !======= Internals ============ @@ -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) + ierr = FARKStepSStolerances(arkode_mem, reltol, abstol) if (ierr /= 0) then - write (*, *) 'Error in FARKodeSStolerances' + write(*,*) 'Error in FARKStepSStolerances' stop 1 end if - ! initialize custom matrix data structure and solver; attach to ARKODE + ! initialize custom matrix data structure and solver; attach to ARKStep 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) + ierr = FARKStepSetLinearSolver(arkode_mem, sunls, sunmat_A) if (ierr /= 0) then - write (*, *) 'Error in FARKodeSetLinearSolver' + write(*,*) 'Error in FARKStepSetLinearSolver' stop 1 end if - ierr = FARKodeSetJacFn(arkode_mem, c_funloc(JacFn)) + ierr = FARKStepSetJacFn(arkode_mem, c_funloc(JacFn)) if (ierr /= 0) then - write (*, *) 'Error in FARKodeSetJacFn' + write(*,*) 'Error in FARKStepSetJacFn' stop 1 end if - ! main time-stepping loop: calls FARKodeEvolve to perform the integration, then + ! main time-stepping loop: calls FARKStepEvolve 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 - end if + ! call integrator + ierr = FARKStepEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) + if (ierr /= 0) then + write(*,*) 'Error in FARKStepEvolve, ierr = ', ierr, '; halting' + stop 1 + endif - ! 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 *, " ----------------------------------------------" @@ -390,7 +390,7 @@ program main call ARKStepStats(arkode_mem) ! clean up - call FARKodeFree(arkode_mem) + call FARKStepFree(arkode_mem) call FN_VDestroy(sunvec_y) call FSUNMatDestroy(sunmat_A) ierr = FSUNLinSolFree(sunls) @@ -398,6 +398,7 @@ program main end program main + ! ---------------------------------------------------------------- ! ARKStepStats ! @@ -431,27 +432,27 @@ subroutine ARKStepStats(arkode_mem) !======= Internals ============ - ierr = FARKodeGetNumSteps(arkode_mem, nsteps) - ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) + ierr = FARKStepGetNumSteps(arkode_mem, nsteps) + ierr = FARKStepGetNumStepAttempts(arkode_mem, nst_a) ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) - 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) + 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) 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 d6d1c0f504..5a4ce4548a 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_int64_t) :: len + integer(c_long) :: len complex(c_double_complex), pointer :: data(:) end type FVec ! ---------------------------------------------------------------- @@ -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_long), 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_long), 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 @@ -191,12 +191,12 @@ subroutine FN_VDestroy_Complex(sunvec_y) bind(C) end subroutine FN_VDestroy_Complex ! ---------------------------------------------------------------- - integer(c_int64_t) function FN_VGetLength_Complex(sunvec_y) & - bind(C) result(length) + integer(c_long) function FN_VGetLength_Complex(sunvec_y) & + 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,21 +442,21 @@ 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 type(N_Vector) :: sunvec_w type(N_Vector) :: sunvec_id type(FVec), pointer :: x, w, id - integer(c_int64_t) :: i + integer(c_long) :: i ! extract Fortran vector structures to work with x => FN_VGetFVec(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,13 +565,13 @@ 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 type(N_Vector) :: sunvec_z type(FVec), pointer :: x, z - integer(c_int64_t) :: i + integer(c_long) :: i ! extract Fortran vector structures to work with x => FN_VGetFVec(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 163885792b..1f4b2851bc 100644 --- a/examples/arkode/F2003_custom/fnvector_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/fnvector_fortran_mod.f90 @@ -25,9 +25,9 @@ module fnvector_fortran_mod ! ---------------------------------------------------------------- type, public :: FVec logical :: own_data - integer(c_int64_t) :: length1 - integer(c_int64_t) :: length2 - real(c_double), pointer :: data(:, :) + integer(c_long) :: length1 + integer(c_long) :: length2 + 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_long), value :: n1 + integer(c_long), 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_long), value :: n1 + integer(c_long), 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 @@ -206,8 +206,8 @@ subroutine FN_VDestroy_Fortran(sunvec_y) bind(C) end subroutine FN_VDestroy_Fortran ! ---------------------------------------------------------------- - integer(c_int64_t) function FN_VGetLength_Fortran(sunvec_y) & - bind(C) result(length) + integer(c_long) function FN_VGetLength_Fortran(sunvec_y) & + 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,21 +466,21 @@ 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 type(N_Vector) :: sunvec_w type(N_Vector) :: sunvec_id type(FVec), pointer :: x, w, id - integer(c_int64_t) :: i, j + integer(c_long) :: i, j ! extract Fortran vector structures to work with x => FN_VGetFVec(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,22 +595,22 @@ 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 - integer(c_int64_t) :: i, j + type(FVec), pointer :: x, z + integer(c_long) :: i, j ! extract Fortran vector structures to work with x => FN_VGetFVec(sunvec_x) 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)) >= 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)) .ge. c) then + z%data(i,j) = 1.d0 + else + z%data(i,j) = 0.d0 + end if + end do end do return @@ -618,13 +618,13 @@ 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 type(N_Vector) :: sunvec_z type(FVec), pointer :: x, z - integer(c_int64_t) :: i, j + integer(c_long) :: i, j ! extract Fortran vector structures to work with x => FN_VGetFVec(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,14 +647,14 @@ 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 type(N_Vector) :: sunvec_x type(N_Vector) :: sunvec_m type(FVec), pointer :: c, x, m - integer(c_int64_t) :: i, j + integer(c_long) :: i, j logical :: test ! extract Fortran vector structures to work with @@ -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) <= 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) .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 end do return @@ -686,13 +686,13 @@ 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 type(N_Vector) :: sunvec_d type(FVec), pointer :: n, d - integer(c_int64_t) :: i, j + integer(c_long) :: i, j logical :: notEvenOnce ! extract Fortran vector structures to work with @@ -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 f9ddcbe404..6939fa2795 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_long) :: Nvar + integer(c_long) :: N + integer(c_long), 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_long), value :: Nvar + integer(c_long), 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 - integer(c_int64_t) :: i, j, k, l + type(FLinSol), pointer :: S + type(FMat), pointer :: AMat + integer(c_long) :: 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 + do i = 1,S%N - ! set 2D pointer to this diagonal block - A => AMat%data(:, :, i) + ! set 2D pointer to this diagonal block + A => AMat%data(:,:,i) - ! k-th elimination step number - do k = 1, S%Nvar + ! k-th elimination step number + do k = 1,S%Nvar - ! 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 - - ! 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 + ! 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 - 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) + 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 - end do - end do + ! 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 ! 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 - integer(c_int64_t) :: i, k, pk + type(FLinSol), pointer :: S + type(FMat), pointer :: AMat + type(FVec), pointer :: xvec, bvec + integer(c_long) :: 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 ced4f4263b..88dfd5710d 100644 --- a/examples/arkode/F2003_custom/fsunmatrix_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/fsunmatrix_fortran_mod.f90 @@ -30,9 +30,9 @@ module fsunmatrix_fortran_mod ! ---------------------------------------------------------------- type, public :: FMat logical :: own_data - integer(c_int64_t) :: Nvar - integer(c_int64_t) :: N - real(c_double), pointer :: data(:, :, :) + integer(c_long) :: Nvar + integer(c_long) :: N + 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_long), value :: Nvar + integer(c_long), 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,25 +230,25 @@ 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 type(SUNMatrix) :: sunmat_A type(FMat), pointer :: A - integer(c_int64_t) :: i, j, k + integer(c_long) :: i, j, k ! extract Fortran matrix structure to work with 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 @@ -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_int64_t) :: i + integer(c_long) :: i ! extract Fortran matrix and vector structures to work with A => FSUNMatGetFMat(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 aa28a002ac..28c5bb0410 100644 --- a/examples/arkode/F2003_custom/test_fnvector_complex_mod.f90 +++ b/examples/arkode/F2003_custom/test_fnvector_complex_mod.f90 @@ -29,15 +29,15 @@ 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_int64_t), value :: N + integer(c_long), value :: N Type(N_Vector) :: sunvec_x Type(FVec), pointer :: x - integer(c_int64_t) :: i + integer(c_long) :: i 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 @@ -58,7 +58,7 @@ program main ! local variables type(c_ptr) :: sunctx integer(c_int) :: fails, i, loc - integer(c_int64_t), parameter :: N = 1000 + integer(c_long), 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) @@ -76,72 +76,74 @@ 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 @@ -149,60 +151,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) @@ -210,10 +212,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) @@ -221,10 +223,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) @@ -232,10 +234,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) @@ -243,10 +245,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) @@ -254,10 +256,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) @@ -265,10 +267,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) @@ -276,10 +278,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) @@ -287,10 +289,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) @@ -298,10 +300,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) @@ -309,10 +311,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 @@ -321,10 +323,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) @@ -332,10 +334,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) @@ -343,10 +345,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 @@ -355,10 +357,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) @@ -366,10 +368,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) @@ -377,50 +379,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 @@ -428,30 +430,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 @@ -459,20 +461,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 @@ -480,30 +482,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 @@ -512,42 +514,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 @@ -555,54 +557,55 @@ 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 @@ -618,10 +621,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 0673d668ad..148f95212b 100644 --- a/examples/arkode/F2003_custom/test_fnvector_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/test_fnvector_fortran_mod.f90 @@ -28,17 +28,17 @@ integer(c_int) function check_ans(val, tol, Nvar, N, sunvec_x) result(failure) implicit none real(c_double), value :: val, tol - integer(c_int64_t), value :: Nvar, N + integer(c_long), value :: Nvar, N Type(N_Vector) :: sunvec_x Type(FVec), pointer :: x - integer(c_int64_t) :: i, j + integer(c_long) :: i, j 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 @@ -59,15 +59,16 @@ program main ! local variables type(c_ptr) :: sunctx integer(c_int) :: fails - integer(c_int64_t) :: i, j, loc - integer(c_int64_t), parameter :: N = 1000 - integer(c_int64_t), parameter :: Nvar = 10 + integer(c_long) :: i, j, loc + integer(c_long), parameter :: N = 1000 + integer(c_long), 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 @@ -77,75 +78,77 @@ 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 @@ -153,60 +156,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) @@ -214,10 +217,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) @@ -225,10 +228,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) @@ -236,10 +239,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) @@ -247,10 +250,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) @@ -258,10 +261,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) @@ -269,10 +272,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) @@ -280,10 +283,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) @@ -291,10 +294,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) @@ -302,10 +305,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) @@ -313,10 +316,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 @@ -325,10 +328,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 @@ -337,50 +340,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 @@ -388,10 +391,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 @@ -399,10 +402,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 @@ -410,111 +413,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 @@ -522,173 +525,174 @@ 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 @@ -700,17 +704,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 dc1985d6ae..508a1c74a3 100644 --- a/examples/arkode/F2003_custom/test_fsunlinsol_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/test_fsunlinsol_fortran_mod.f90 @@ -31,37 +31,37 @@ integer(c_int) function check_vector(sunvec_x, sunvec_y, tol, Nvar, N) result(fa implicit none real(c_double), value :: tol - integer(c_int64_t), value :: Nvar, N + integer(c_long), value :: Nvar, N Type(N_Vector) :: sunvec_x, sunvec_y Type(FVec), pointer :: x, y - integer(c_int64_t) :: i, j + integer(c_long) :: i, j 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,105 +82,107 @@ 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_long), parameter :: N = 1000 + integer(c_long), 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 @@ -190,10 +192,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 @@ -201,10 +203,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 190d1b9b61..740db810e1 100644 --- a/examples/arkode/F2003_custom/test_fsunmatrix_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/test_fsunmatrix_fortran_mod.f90 @@ -30,20 +30,20 @@ integer(c_int) function check_matrix(sunmat_A, sunmat_B, tol, Nvar, N) result(fa implicit none real(c_double), value :: tol - integer(c_int64_t), value :: Nvar, N + integer(c_long), value :: Nvar, N Type(SUNMatrix) :: sunmat_A, sunmat_B Type(FMat), pointer :: A, B - integer(c_int64_t) :: i, j, k + integer(c_long) :: i, j, k 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 @@ -53,19 +53,19 @@ 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_int64_t), value :: Nvar, N + integer(c_long), value :: Nvar, N Type(SUNMatrix) :: sunmat_A Type(FMat), pointer :: A - integer(c_int64_t) :: i, j, k + integer(c_long) :: i, j, k 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 @@ -75,37 +75,37 @@ integer(c_int) function check_vector(sunvec_x, sunvec_y, tol, Nvar, N) result(fa implicit none real(c_double), value :: tol - integer(c_int64_t), value :: Nvar, N + integer(c_long), value :: Nvar, N Type(N_Vector) :: sunvec_x, sunvec_y Type(FVec), pointer :: x, y - integer(c_int64_t) :: i, j + integer(c_long) :: i, j 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 @@ -127,13 +127,14 @@ program main ! local variables type(c_ptr) :: sunctx integer(c_int) :: fails, retval, i, j, k - integer(c_int64_t), parameter :: N = 1000 - integer(c_int64_t), parameter :: Nvar = 50 + integer(c_long), parameter :: N = 1000 + integer(c_long), 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 @@ -145,139 +146,140 @@ 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 @@ -285,12 +287,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 @@ -309,10 +311,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/CMakeLists.txt b/examples/arkode/F2003_parallel/CMakeLists.txt index 63c87909cf..d1084b5af3 100644 --- a/examples/arkode/F2003_parallel/CMakeLists.txt +++ b/examples/arkode/F2003_parallel/CMakeLists.txt @@ -18,17 +18,12 @@ # 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" -) - -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() + "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") # 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 f35968c09b..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 @@ -69,37 +69,27 @@ 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(kind=myindextype), parameter :: Nvar = 3 + 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) real(c_double) :: Esend(Nvar), Erecv(Nvar) ! Problem settings - 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) + integer :: Nx ! number of intervals (global) + integer :: Npts ! number of spatial nodes (local) + integer :: Neq ! number of equations (local) real(c_double) :: xmax ! maximum x value real(c_double) :: dx ! mesh spacing @@ -141,7 +131,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,14 +143,14 @@ 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(:) real(c_double), pointer :: fdata(:) ! local variables - integer(myindextype) :: i, j, idx1, idx2 ! loop counters and array indices + integer :: i, j, idx1, idx2 ! loop counters and array indices real(c_double) :: tmp ! temporary value !======= Internals ============ @@ -176,29 +166,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 +198,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,9 +214,10 @@ 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 @@ -238,7 +229,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(:) @@ -246,7 +237,7 @@ integer(c_int) function Reaction(t, sunvec_y, sunvec_f, user_data) & ! local variables real(c_double) :: u, v, w ! chemcial species - integer(kind=myindextype) :: j, idx ! loop counter and array index + integer :: j, idx ! loop counter and array index !======= Internals ============ @@ -257,40 +248,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 @@ -299,9 +290,10 @@ 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 @@ -313,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), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data !======= Internals ============ @@ -333,6 +325,7 @@ end function AdvectionReaction end module ode_mod + module prec_mod !======= Inclusions =========== @@ -345,7 +338,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 @@ -353,15 +346,17 @@ 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) + 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 !======= Declarations ========= implicit none @@ -373,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), value :: 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 real(c_double) :: u, v, w ! chemical species - integer(kind=myindextype) :: i, idx, offset ! loop counter, array index, col offset + integer :: i, idx, offset ! loop counter, array index, col offset !======= Internals ============ @@ -391,67 +386,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 @@ -460,12 +455,14 @@ 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 + use fnvector_mpiplusx_mod !======= Declarations ========= @@ -480,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), 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 @@ -494,8 +491,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 @@ -505,6 +502,7 @@ end function PSolve end module prec_mod + module nls_mod !======= Inclusions =========== @@ -528,8 +526,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 @@ -543,13 +541,14 @@ 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 !======= Declarations ========= implicit none @@ -581,35 +580,35 @@ integer(c_int) function TaskLocalNlsResidual(sunvec_zcor, sunvec_F, arkode_mem) real(c_double), pointer :: Fi_data(:) real(c_double), pointer :: sdata_data(:) - integer(kind=myindextype) :: i ! loop counter + integer :: i ! loop counter !======= Internals ============ ! get nonlinear residual data - ierr = FARKodeGetNonlinearSystemData(arkmem, tcur, zpred_ptr, z_ptr, & - Fi_ptr, gam, sdata_ptr, user_data) + ierr = FARKStepGetNonlinearSystemData(arkmem, tcur, zpred_ptr, z_ptr, & + Fi_ptr, gam, sdata_ptr, user_data) if (ierr /= 0) then - print *, "Error: FARKodeGetNonlinearSystemData returned ", ierr - return + print *, "Error: FARKStepGetNonlinearSystemData 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 @@ -620,13 +619,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 @@ -634,15 +633,19 @@ 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 !======= Declarations ========= implicit none @@ -666,16 +669,16 @@ integer(c_int) function TaskLocalLSolve(sunvec_delta, arkode_mem) & real(c_double), pointer :: bnode_data(:) real(c_double) :: u, v, w ! chemical species - integer(kind=myindextype) :: i, idx ! loop counter and array index + integer :: i, idx ! loop counter and array index !======= Internals ============ ! get nonlinear residual data - ierr = FARKodeGetNonlinearSystemData(arkmem, tcur, zpred_ptr, z_ptr, & - Fi_ptr, gam, sdata_ptr, user_data) + ierr = FARKStepGetNonlinearSystemData(arkmem, tcur, zpred_ptr, z_ptr, & + Fi_ptr, gam, sdata_ptr, user_data) if (ierr /= 0) then - print *, "Error: FARKodeGetNonlinearSystemData returned ", ierr - return + print *, "Error: FARKStepGetNonlinearSystemData returned ",ierr + return end if ! get vectors from pointers @@ -689,59 +692,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 @@ -750,12 +753,14 @@ 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 + !======= Declarations ========= implicit none @@ -768,12 +773,14 @@ 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 + !======= Declarations ========= implicit none @@ -785,20 +792,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 @@ -806,13 +813,17 @@ 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 @@ -840,36 +851,41 @@ 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 + + + + !======= Declarations ========= implicit none @@ -890,12 +906,14 @@ 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 + !======= Declarations ========= implicit none @@ -909,12 +927,14 @@ 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 + !======= Declarations ========= implicit none @@ -929,12 +949,14 @@ 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 + !======= Declarations ========= implicit none @@ -951,16 +973,19 @@ integer(c_int) function TaskLocalNewton_GetNumConvFails(sunnls, nconvfails) & end function TaskLocalNewton_GetNumConvFails + 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 - use ode_mod + use ode_mod, only : sunctx, Nvar, comm !======= Declarations ========= implicit none @@ -969,10 +994,10 @@ 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 + integer :: ierr ! MPI error status !======= Internals ============ @@ -982,20 +1007,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 @@ -1003,22 +1028,23 @@ 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) + sunvec_bnode => FN_VNew_Serial(int(Nvar, c_long), sunctx) + sunmat_Jnode => FSUNDenseMatrix(int(Nvar, c_long), int(Nvar, c_long), 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 =========== @@ -1028,8 +1054,7 @@ 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 !======= Declarations ========= implicit none @@ -1037,7 +1062,7 @@ program main ! With MPI-3 use mpi_f08 is preferred include "mpif.h" - integer(kind=myindextype) :: i + integer :: i integer :: ierr ! MPI error status integer(c_int) :: retval ! SUNDIALS error status real(c_double) :: starttime, endtime ! timing variables @@ -1050,8 +1075,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 @@ -1061,7 +1086,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 @@ -1079,19 +1104,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 @@ -1099,22 +1124,22 @@ program main call SetupProblem() ! Create solution vector - sunvec_ys => FN_VNew_Serial(Neq, sunctx) - sunvec_y => FN_VMake_MPIPlusX(comm, sunvec_ys, sunctx) + sunvec_ys => FN_VNew_Serial(int(Neq, c_long), 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 @@ -1122,24 +1147,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 @@ -1150,6 +1175,7 @@ program main end program main + ! Setup ARKODE and evolve problem in time with IMEX method subroutine EvolveProblemIMEX(sunvec_y) @@ -1163,12 +1189,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 @@ -1195,8 +1221,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 @@ -1204,266 +1230,260 @@ 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) + 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) + retval = FARKStepSetOrder(arkode_mem, order) if (retval /= 0) then - print *, "Error: FARKodeSetOrder returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepSetOrder returned ",retval + call MPI_Abort(comm, 1, ierr) end if ! Specify tolerances - retval = FARKodeSStolerances(arkode_mem, rtol, atol) + retval = FARKStepSStolerances(arkode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FARKodeSStolerances returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepSStolerances 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)) + retval = FARKStepSetMaxNumSteps(arkode_mem, int(100000, c_long)) if (retval /= 0) then - print *, "Error: FARKodeMaxNumSteps returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepMaxNumSteps returned ",retval + call MPI_Abort(comm, 1, ierr) end if ! Create the (non)linear solver - sun_NLS => null() - sun_LS => null() - 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 = FARKStepSetNonlinearSolver(arkode_mem, sun_NLS) + if (retval /= 0) then + print *, "Error: FARKStepSetNonlinearSolver 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 = 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 + + ! Create MPI task-local data structures for preconditioning + sunmat_P => FSUNDenseMatrix(int(Neq, c_long), int(Neq, c_long), 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 = FARKStepSetNonlinearSolver(arkode_mem, sun_NLS) + if (retval /= 0) then + print *, "Error: FARKStepSetNonlinearSolver 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 = 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 - ! 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) + retval = FARKStepGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, "Error: FARKodeGetNumSteps returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepGetNumSteps returned ",retval + call MPI_Abort(comm, 1, ierr) end if - retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) + retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, "Error: FARKodeGetNumStepAttempts returned ", retval - call MPI_Abort(comm, 1, ierr) + 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) + print *, "Error: FARKStepGetNumRhsEvals returned ",retval + call MPI_Abort(comm, 1, ierr) end if - retval = FARKodeGetNumErrTestFails(arkode_mem, netf) + retval = FARKStepGetNumErrTestFails(arkode_mem, netf) if (retval /= 0) then - print *, "Error: FARKodeGetNumErrTestFails returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepGetNumErrTestFails returned ",retval + call MPI_Abort(comm, 1, ierr) end if - retval = FARKodeGetNumNonlinSolvIters(arkode_mem, nni) + retval = FARKStepGetNumNonlinSolvIters(arkode_mem, nni) if (retval /= 0) then - print *, "Error: FARKodeGetNumNonlinSolvIters returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepGetNumNonlinSolvIters returned ",retval + call MPI_Abort(comm, 1, ierr) end if - retval = FARKodeGetNumNonlinSolvConvFails(arkode_mem, ncfn) + retval = FARKStepGetNumNonlinSolvConvFails(arkode_mem, ncfn) if (retval /= 0) then - print *, "Error: FARKodeGetNumNonlinSolvConvFails returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepGetNumNonlinSolvConvFails 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 = FARKStepGetNumLinIters(arkode_mem, nli) + if (retval /= 0) then + print *, "Error: FARKStepGetNumLinIters 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 = FARKStepGetNumPrecEvals(arkode_mem, npre) + if (retval /= 0) then + print *, "Error: FARKStepGetNumPrecEvals 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 = FARKStepGetNumPrecSolves(arkode_mem, npsol) + if (retval /= 0) then + print *, "Error: FARKStepGetNumPrecSolves 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 ! Clean up - call FARKodeFree(arkode_mem) + call FARKStepFree(arkode_mem) ! 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 =========== @@ -1472,8 +1492,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 @@ -1502,116 +1522,117 @@ 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) + retval = FERKStepSetOrder(arkode_mem, order) if (retval /= 0) then - print *, "Error: FARKodeSetOrder returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FERKStepSetOrder returned ",retval + call MPI_Abort(comm, 1, ierr) end if ! Specify tolerances - retval = FARKodeSStolerances(arkode_mem, rtol, atol) + retval = FERKStepSStolerances(arkode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FARKodeSStolerances returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FERKStepSStolerances 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)) + retval = FERKStepSetMaxNumSteps(arkode_mem, int(100000, c_long)) if (retval /= 0) then - print *, "Error: FARKodeMaxNumSteps returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FERKStepMaxNumSteps 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 = 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 - ! 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) + retval = FERKStepGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, "Error: FARKodeGetNumSteps returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FERKStepGetNumSteps returned ",retval + call MPI_Abort(comm, 1, ierr) end if - retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) + retval = FERKStepGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, "Error: FARKodeGetNumStepAttempts returned ", retval - call MPI_Abort(comm, 1, ierr) + 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) + print *, "Error: FERKStepGetNumRhsEvals returned ",retval + call MPI_Abort(comm, 1, ierr) end if - retval = FARKodeGetNumErrTestFails(arkode_mem, netf) + retval = FERKStepGetNumErrTestFails(arkode_mem, netf) if (retval /= 0) then - print *, "Error: FARKodeGetNumErrTestFails returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FERKStepGetNumErrTestFails 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 - call FARKodeFree(arkode_mem) + call FERKStepFree(arkode_mem) end subroutine EvolveProblemExplicit + ! Write time and solution to disk subroutine WriteOutput(t, sunvec_y) @@ -1619,9 +1640,11 @@ 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, myindextype + use ode_mod, only : Nvar, nprocs, myid, Erecv, Nx, Npts, monitor, nout, & + umask, vmask, wmask !======= Declarations ========= implicit none @@ -1632,7 +1655,7 @@ subroutine WriteOutput(t, sunvec_y) real(c_double), pointer :: ydata(:) ! vector data - integer(kind=myindextype) i, idx ! loop counter and array index + integer i, idx ! loop counter and array index real(c_double) :: u, v, w ! RMS norm of chemical species @@ -1641,57 +1664,58 @@ 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) @@ -1699,7 +1723,7 @@ subroutine SetIC(sunvec_y) use, intrinsic :: iso_c_binding use fsundials_core_mod - use ode_mod + use ode_mod, only : Nvar, myid, Npts, xmax, dx, A, B, k1, k2, k4, k3 !======= Declarations ========= implicit none @@ -1713,7 +1737,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(kind=myindextype) :: j, idx ! loop counter and array index + integer :: j, idx ! loop counter and array index !======= Internals ============ @@ -1721,35 +1745,37 @@ 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) @@ -1758,7 +1784,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 @@ -1780,51 +1806,52 @@ 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) @@ -1832,8 +1859,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 @@ -1855,19 +1882,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 @@ -1875,57 +1902,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 @@ -1940,25 +1967,29 @@ 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 =========== use, intrinsic :: iso_c_binding + + + use fnvector_serial_mod use fnvector_mpiplusx_mod use fnvector_mpimanyvector_mod @@ -1972,185 +2003,184 @@ subroutine SetupProblem() include "mpif.h" ! local variables - 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 + 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 !======= Internals ============ ! 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 - 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 + j = 1 + do while (j <= nargs) + + ! get input arg + call get_command_argument(j, 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 + j = j + 1 + call get_command_argument(j, arg) + read(arg,*) nout + else if (trim(arg) == "--nx") then + j = j + 1 + call get_command_argument(j, arg) + read(arg,*) Nx + else if (trim(arg) == "--xmax") then + j = j + 1 + call get_command_argument(j, arg) + read(arg,*) xmax + else if (trim(arg) == "--A") then + j = j + 1 + call get_command_argument(j, arg) + read(arg,*) A + else if (trim(arg) == "--B") then + j = j + 1 + call get_command_argument(j, arg) + read(arg,*) B + else if (trim(arg) == "--k") then + j = j + 1 + call get_command_argument(j, 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) + read(arg,*) c + else if (trim(arg) == "--order") then + j = j + 1 + call get_command_argument(j, 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 + j = j + 1 + call get_command_argument(j, arg) + read(arg,*) tf + else if (trim(arg) == "--rtol") then + j = j + 1 + call get_command_argument(j, arg) + read(arg,*) rtol + else if (trim(arg) == "--atol") then + j = j + 1 + call get_command_argument(j, 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 + j = j+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,nprocs) > 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_s => FN_VNew_Serial(int(Neq, c_long), 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) @@ -2158,7 +2188,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) @@ -2166,67 +2196,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 @@ -2242,17 +2272,18 @@ 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 8c67715974..7e849b7830 100644 --- a/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 @@ -51,10 +51,10 @@ 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_int64_t), parameter :: nlocal = 10 - integer(c_int64_t) :: neq, mu, ml, mudq, mldq + 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 @@ -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 @@ -118,18 +118,18 @@ integer(c_int) function LocalgFn(nnlocal, t, sunvec_y, sunvec_g, user_data) & ! calling variables real(c_double), value :: t ! current time - integer(c_int64_t) :: nnlocal ! local space + 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 + 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,6 +140,7 @@ end function LocalgFn end module DiagkryData ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! Main driver program ! ---------------------------------------------------------------- @@ -204,47 +205,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, *) " " - end if + 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) @@ -254,36 +255,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) + retval = FARKStepSetLinearSolver(arkode_mem, sunls, sunmat_A) if (retval /= 0) then - print *, 'Error in FARKodeSetLinearSolver, retval = ', retval - call MPI_Abort(comm, 1, ierr) + 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) + print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval + call MPI_Abort(comm, 1, ierr) end if ! Specify tolerances - retval = FARKodeSStolerances(arkode_mem, rtol, atol) + retval = FARKStepSStolerances(arkode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FARKodeSStolerances returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepSStolerances returned ",retval + call MPI_Abort(comm, 1, ierr) end if ! Initialize BBD preconditioner @@ -292,222 +293,222 @@ 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 + 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 - if (iPretype == 2) then + ! Print global max. error + if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax - 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 + ! 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 + end if - retval = FARKBBDPrecReInit(arkode_mem, mudq, mldq, 0.d0) - if (retval /= 0) then - print *, "Error in FARKBBDPrecReInit, retval = ", retval + retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + if (retval /= 0) then + print *, "Error: FARKStepGetNumStepAttempts returned ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - retval = FSUNLinSol_SPGMRSetPrecType(sunls, iPretype) - if (retval /= 0) then - print *, "Error in FSUNLinSol_SPGMRSetPrecType, retval = ", retval + retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + if (retval /= 0) then + print *, "Error: FARKStepGetNumRhsEvals returned ", retval call MPI_Abort(comm, 1, ierr) - end if - - if (outproc) write (6, *) " Preconditioning on right:" - - end if + 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 + retval = FARKStepGetNumPrecEvals(arkode_mem, npre) + if (retval /= 0) then + print *, "Error: FARKStepGetNumPrecEvals returned ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - ! Retrieve solver statistics - retval = FARKodeGetNumSteps(arkode_mem, nst) - if (retval /= 0) then - print *, "Error: FARKodeGetNumSteps returned ", retval + retval = FARKStepGetNumPrecSolves(arkode_mem, npsol) + if (retval /= 0) then + print *, "Error: FARKStepGetNumPrecSolves returned ", 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 = FARKStepGetNumNonlinSolvIters(arkode_mem, nni) + if (retval /= 0) then + print *, "Error: FARKStepGetNumNonlinSolvIters returned ", 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 = FARKStepGetNumLinIters(arkode_mem, nli) + if (retval /= 0) then + print *, "Error: FARKStepGetNumLinIters 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 = 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 - - retval = FARKodeGetNumPrecEvals(arkode_mem, npre) - if (retval /= 0) then - print *, "Error: FARKodeGetNumPrecEvals 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 - call MPI_Abort(comm, 1, ierr) - end if + avdim = dble(nli) / dble(nni) - 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 = FARKStepGetNumNonlinSolvConvFails(arkode_mem, ncfn) + if (retval /= 0) then + print *, "Error: FARKStepGetNumNonlinSolvConvFails 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 = FARKStepGetNumLinConvFails(arkode_mem, ncfl) + if (retval /= 0) then + print *, "Error: FARKStepGetNumLinSolvConvFails 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 = FARKStepGetNumErrTestFails(arkode_mem, netf) + if (retval /= 0) then + print *, "Error: FARKStepGetNumErrTestFails 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 = FARKStepGetWorkSpace(arkode_mem, lenrw, leniw) + if (retval /= 0) then + print *, "Error: FARKStepGetWorkSpace 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 = FARKStepGetLinWorkSpace(arkode_mem, lenrwls, leniwls) + if (retval /= 0) then + print *, "Error: FARKStepGetLinWorkSpace 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 + retval = FARKBBDPrecGetWorkSpace(arkode_mem, lenrwbbd, leniwbbd) + if (retval /= 0) then + print *, "Error: FARKBBDPrecGetWorkSpace 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 = 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 FARKodeFree(arkode_mem) ! free integrator memory + 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 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 0e09570888..537ef428b9 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 279 + 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 ------------------------------------------------- @@ -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,7 +73,10 @@ 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 284 + 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 index d3bfc3a55f..0ddb06d0d1 100644 --- a/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 @@ -46,17 +46,19 @@ module DiagnonData integer :: nprocs ! total number of MPI processes ! Problem parameters - integer(c_int64_t), parameter :: nlocal = 2 - integer(c_int64_t) :: neq + 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) + result(retval) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -68,7 +70,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 +82,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,9 +98,11 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & end function frhs !----------------------------------------------------------------- + end module DiagnonData !------------------------------------------------------------------- + !------------------------------------------------------------------- ! Main driver program !------------------------------------------------------------------- @@ -145,45 +149,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, *) " " - end if + 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) @@ -193,118 +197,118 @@ 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) + retval = FERKStepSStolerances(arkode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FARKodeSStolerances returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FERKStepSStolerances returned ",retval + call MPI_Abort(comm, 1, ierr) end if - ! Main time-stepping loop: calls FARKodeEvolve to perform the + ! 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 + 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 = 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, *) " -----------------------------------------" + 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 if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax ! Get final statistics - retval = FARKodeGetNumSteps(arkode_mem, nst) + retval = FERKStepGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, "Error: FARKodeGetNumSteps returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FERKStepGetNumSteps returned ",retval + call MPI_Abort(comm, 1, ierr) end if - retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) + retval = FERKStepGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, "Error: FARKodeGetNumStepAttempts returned ", retval - call MPI_Abort(comm, 1, ierr) + 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) + print *, "Error: FERKStepGetNumRhsEvals returned ",retval + call MPI_Abort(comm, 1, ierr) end if - retval = FARKodeGetNumErrTestFails(arkode_mem, netf) + retval = FERKStepGetNumErrTestFails(arkode_mem, netf) if (retval /= 0) then - print *, "Error: FARKodeGetNumErrTestFails returned ", retval - call MPI_Abort(comm, 1, ierr) + 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 - end if + 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 FARKodeFree(arkode_mem) ! free integrator memory + 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 diff --git a/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 b/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 index 36e1d9e315..50c54e0211 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,23 +122,24 @@ 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 ! -------------------------------------------------------------- @@ -153,90 +154,91 @@ 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)) - 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 + 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 + 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) @@ -246,193 +248,194 @@ 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 - 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 + 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 - 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 + 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) - 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 + 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 - 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 + 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) + 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 @@ -442,7 +445,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 @@ -454,11 +457,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 @@ -467,8 +470,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 @@ -476,66 +479,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) - end do - end do + 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) - 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 + 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 @@ -544,11 +547,12 @@ 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 @@ -563,7 +567,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 @@ -584,11 +588,12 @@ 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 @@ -605,17 +610,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 @@ -628,6 +633,7 @@ end function PSolve end module Heat2DData ! ------------------------------------------------------------------ + ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -661,11 +667,11 @@ 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_long) :: N, Ntot integer(c_int) :: retval integer :: ierr logical :: outproc @@ -688,13 +694,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 @@ -703,130 +709,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, *) " " - end if + 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(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) + retval = FARKStepSetLinearSolver(arkode_mem, sun_LS, sunmat_A) if (retval /= 0) then - print *, "Error: FARKodeSetLinearSolver returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepSetLinearSolver returned ",retval + call MPI_Abort(comm, 1, ierr) end if ! Attach preconditioner - retval = FARKodeSetPreconditioner(arkode_mem, c_funloc(PSetup), & - c_funloc(PSolve)) + retval = FARKStepSetPreconditioner(arkode_mem, c_funloc(PSetup), & + c_funloc(PSolve)) if (retval /= 0) then - print *, "Error: FARKodeSetPreconditioner returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepSetPreconditioner returned ",retval + call MPI_Abort(comm, 1, ierr) end if ! Specify tolerances - retval = FARKodeSStolerances(arkode_mem, rtol, atol) + retval = FARKStepSStolerances(arkode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FARKodeSStolerances returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepSStolerances returned ",retval + call MPI_Abort(comm, 1, ierr) end if ! Specify nonlinear solver convergence coefficient - retval = FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) + retval = FARKStepSetNonlinConvCoef(arkode_mem, nlscoef) if (retval /= 0) then - print *, "Error: FARKodeSetNonlinConvCoef returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepSetNonlinConvCoef returned ",retval + call MPI_Abort(comm, 1, ierr) end if ! Specify nonlinear solver predictor method - retval = FARKodeSetPredictorMethod(arkode_mem, int(1, c_int)) + retval = FARKStepSetPredictorMethod(arkode_mem, int(1, c_int)) if (retval /= 0) then - print *, "Error: FARKodeSetNonlinConvCoef returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepSetNonlinConvCoef returned ",retval + call MPI_Abort(comm, 1, ierr) end if ! Specify that problem is linearly implicit - retval = FARKodeSetLinear(arkode_mem, int(0, c_int)) + retval = FARKStepSetLinear(arkode_mem, int(0, c_int)) if (retval /= 0) then - print *, "Error: FARKodeSetNonlinConvCoef returned ", retval - call MPI_Abort(comm, 1, ierr) + 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) - end do - end do + 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) + 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) - end do - end do - write (101, *) " " + 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) @@ -835,115 +841,115 @@ 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 - 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 + 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, *) " ----------------------" - end if - close (101) + write(6,*) " ----------------------" + endif + close(101) ! Get final statistics - retval = FARKodeGetNumSteps(arkode_mem, nst) + retval = FARKStepGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, "Error: FARKodeGetNumSteps returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepGetNumSteps returned ",retval + call MPI_Abort(comm, 1, ierr) end if - retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) + retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, "Error: FARKodeGetNumStepAttempts returned ", retval - call MPI_Abort(comm, 1, ierr) + 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) + print *, "Error: FARKStepGetNumRhsEvals returned ",retval + call MPI_Abort(comm, 1, ierr) end if - retval = FARKodeGetNumErrTestFails(arkode_mem, netf) + retval = FARKStepGetNumErrTestFails(arkode_mem, netf) if (retval /= 0) then - print *, "Error: FARKodeGetNumErrTestFails returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepGetNumErrTestFails returned ",retval + call MPI_Abort(comm, 1, ierr) end if - retval = FARKodeGetNumNonlinSolvIters(arkode_mem, nni) + retval = FARKStepGetNumNonlinSolvIters(arkode_mem, nni) if (retval /= 0) then - print *, "Error: FARKodeGetNumNonlinSolvIters returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepGetNumNonlinSolvIters returned ",retval + call MPI_Abort(comm, 1, ierr) end if - retval = FARKodeGetNumLinConvFails(arkode_mem, ncfn) + retval = FARKStepGetNumLinConvFails(arkode_mem, ncfn) if (retval /= 0) then - print *, "Error: FARKodeGetNumLinConvFails returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepGetNumLinConvFails returned ",retval + call MPI_Abort(comm, 1, ierr) end if - retval = FARKodeGetNumLinIters(arkode_mem, nli) + retval = FARKStepGetNumLinIters(arkode_mem, nli) if (retval /= 0) then - print *, "Error: FARKodeGetNumLinIters returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepGetNumLinIters returned ",retval + call MPI_Abort(comm, 1, ierr) end if - retval = FARKodeGetNumPrecEvals(arkode_mem, npre) + retval = FARKStepGetNumPrecEvals(arkode_mem, npre) if (retval /= 0) then - print *, "Error: FARKodeGetNumPrecEvals returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepGetNumPrecEvals returned ",retval + call MPI_Abort(comm, 1, ierr) end if - retval = FARKodeGetNumPrecSolves(arkode_mem, npsol) + retval = FARKStepGetNumPrecSolves(arkode_mem, npsol) if (retval /= 0) then - print *, "Error: FARKodeGetNumPrecSolves returned ", retval - call MPI_Abort(comm, 1, ierr) + 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 - end if + 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 FARKodeFree(arkode_mem) ! free integrator memory + 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 diff --git a/examples/arkode/F2003_serial/CMakeLists.txt b/examples/arkode/F2003_serial/CMakeLists.txt index f755a4695b..635906df1b 100644 --- a/examples/arkode/F2003_serial/CMakeLists.txt +++ b/examples/arkode/F2003_serial/CMakeLists.txt @@ -18,45 +18,48 @@ # 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" -) - -# Regression tests -set(FARKODE_tests - "test_ark_butcher_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" + ) +# 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) @@ -73,9 +76,6 @@ 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) @@ -84,6 +84,9 @@ 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,12 +128,11 @@ if(BUILD_SUNLINSOL_KLU) 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) - - # create the cmake executable target + # 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} @@ -141,7 +143,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) @@ -169,9 +171,6 @@ 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_analytic_f2003.f90 b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 index 974e0cea02..877d76062b 100644 --- a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 @@ -34,18 +34,8 @@ 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(kind=myindextype), parameter :: neq = 1 + integer(c_long), parameter :: neq = 1 ! ODE parameters real(c_double), parameter :: lamda = -100.0d0 @@ -62,7 +52,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 +64,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,7 +77,8 @@ 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 @@ -98,6 +89,7 @@ end function RhsFn end module analytic_mod ! ------------------------------------------------------------------ + ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -129,9 +121,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 @@ -143,17 +135,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) @@ -162,52 +154,52 @@ 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) + ierr = FARKStepSetLinearSolver(arkode_mem, sunls, sunmat_A) if (ierr /= 0) then - write (*, *) 'Error in FARKodeSetLinearSolver' - stop 1 + write(*,*) 'Error in FARKStepSetLinearSolver' + stop 1 end if ! set relative and absolute tolerances rtol = 1.0d-6 atol = 1.0d-10 - ierr = FARKodeSStolerances(arkode_mem, rtol, atol) + ierr = FARKStepSStolerances(arkode_mem, rtol, atol) if (ierr /= 0) then - write (*, *) 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + write(*,*) 'Error in FARKStepSStolerances, 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) + ierr = FARKStepSetAdaptController(arkode_mem, sunCtrl) if (ierr /= 0) then - write (*, *) 'Error in FARKodeSetAdaptController, ierr = ', ierr, '; halting' - stop 1 + write(*,*) 'Error in FARKStepSetAdaptController, ierr = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeSetNonlinConvCoef(arkode_mem, 0.01d0) + ierr = FARKStepSetNonlinConvCoef(arkode_mem, 0.01d0) if (ierr /= 0) then - write (*, *) 'Error in FARKodeSetNonlinConvCoef, ierr = ', ierr, '; halting' - stop 1 + write(*,*) 'Error in FARKStepSetNonlinConvCoef, ierr = ', ierr, '; halting' + stop 1 end if ! Start time stepping @@ -217,26 +209,26 @@ 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 - end if + ! call ARKStep + tout = min(tout + dtout, tend) + ierr = FARKStepEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) + if (ierr /= 0) then + write(*,*) 'Error in FARKODE, ierr = ', ierr, '; halting' + stop 1 + endif - ! output current solution - print '(2x,2(es12.5,1x))', tcur, yvec(1) + ! output current solution + print '(2x,2(es12.5,1x))', tcur, yvec(1) - end do + enddo ! diagnostics output call ARKStepStats(arkode_mem) ! clean up - call FARKodeFree(arkode_mem) + call FARKStepFree(arkode_mem) call FN_VDestroy(sunvec_y) call FSUNMatDestroy(sunmat_A) ierr = FSUNLinSolFree(sunls) @@ -246,6 +238,7 @@ program main end program main ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! ARKStepStats ! @@ -284,92 +277,92 @@ subroutine ARKStepStats(arkode_mem) !======= Internals ============ - ierr = FARKodeGetNumSteps(arkode_mem, nsteps) + ierr = FARKStepGetNumSteps(arkode_mem, nsteps) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumSteps, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumSteps, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) + ierr = FARKStepGetNumStepAttempts(arkode_mem, nst_a) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumStepAttempts, retval = ', ierr, '; halting' - stop 1 + 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 + print *, 'Error in FARKStepGetNumRhsEvals, retval = ', ierr, '; halting' + stop 1 end if - nfevals = nfe + nfi + nfevals=nfe+nfi - ierr = FARKodeGetActualInitStep(arkode_mem, hinused) + ierr = FARKStepGetActualInitStep(arkode_mem, hinused) if (ierr /= 0) then - print *, 'Error in FARKodeGetActualInitStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetActualInitStep, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetLastStep(arkode_mem, hlast) + ierr = FARKStepGetLastStep(arkode_mem, hlast) if (ierr /= 0) then - print *, 'Error in FARKodeGetLastStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetLastStep, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetCurrentStep(arkode_mem, hcur) + ierr = FARKStepGetCurrentStep(arkode_mem, hcur) if (ierr /= 0) then - print *, 'Error in FARKodeGetCurrentStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetCurrentStep, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetCurrentTime(arkode_mem, tcur) + ierr = FARKStepGetCurrentTime(arkode_mem, tcur) if (ierr /= 0) then - print *, 'Error in FARKodeGetCurrentTime, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetCurrentTime, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) + ierr = FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumLinSolvSetups, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) + ierr = FARKStepGetNumErrTestFails(arkode_mem, netfails) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumErrTestFails, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumErrTestFails, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) + ierr = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumNonlinSolvIters, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) + ierr = FARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumJacEvals(arkode_mem, njacevals) + ierr = FARKStepGetNumJacEvals(arkode_mem, njacevals) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumJacEvals, retval = ', ierr, '; halting' - stop 1 + 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 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 0d63e260cf..6389a9e7de 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_int64_t), parameter :: neqreal = 3 + integer(c_int), parameter :: neqreal = 3 ! ODE parameters - 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 + 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 @@ -89,9 +89,8 @@ 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_int64_t) function idx(ix, ivar) - integer(c_int64_t):: ix - integer(c_int) :: ivar + integer(c_int) function idx(ix, ivar) + integer(c_int) :: ivar, ix idx = neqreal*(ix - 1) + ivar - 1 end function idx @@ -105,36 +104,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 +146,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 +194,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,16 +207,16 @@ 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 + 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(:, :) + real(c_double), pointer, dimension(neqreal, N) :: yvec(:,:) + real(c_double), pointer, dimension(neqreal, N) :: fvec(:,:) !======= Internals ============ @@ -229,149 +228,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,6 +381,7 @@ integer(c_int) function ImpRhsFn(tn, sunvec_y, sunvec_f, user_data) & end function ImpRhsFn ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! Jac: The Jacobian function ! @@ -391,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 @@ -407,39 +407,40 @@ 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 ! Local data - integer(c_int64_t) :: ix, nz, Nint + 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 + 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_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) + 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() @@ -450,381 +451,390 @@ 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,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 + 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 @@ -833,11 +843,12 @@ 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 @@ -851,31 +862,31 @@ 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 ! Local data - integer(c_int64_t) :: ix, nz, Nint + 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_int64_t), pointer, dimension(nnz) :: Mcolvals(:) - integer(c_int64_t), pointer, dimension(neq + 1) :: Mrowptrs(:) - real(c_double), pointer, dimension(nnz) :: Mdata(:) + 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) + 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() @@ -886,112 +897,113 @@ 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 @@ -1003,6 +1015,7 @@ end function Mass end module bruss1D_ode_mod ! ------------------------------------------------------------------ + ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -1037,22 +1050,22 @@ program main integer(c_int) :: outstep ! output loop counter integer(c_int) :: sparsetype ! CSR signal, here 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 + 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 + 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 ============ @@ -1061,179 +1074,179 @@ 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) + sunvec_y => FN_VNew_Serial(int(neq,c_long), 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) + sunvec_u => FN_VNew_Serial(int(neq,c_long), 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) + sunvec_v => FN_VNew_Serial(int(neq,c_long), 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) + sunvec_w => FN_VNew_Serial(int(neq,c_long), 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) + 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 + print *, 'ERROR: sunmat_A = NULL' + stop 1 end if - sunmat_M => FSUNSparseMatrix(neq, neq, nnz, sparsetype, ctx) + 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 + 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) + ierr = FARKStepSetLinearSolver(arkode_mem, sunls_A, sunmat_A) if (ierr /= 0) then - print *, 'Error in FARKodeSetLinearSolver' - stop 1 + print *, 'Error in FARKStepSetLinearSolver' + stop 1 end if - ierr = FARKodeSetJacFn(arkode_mem, c_funloc(Jac)) + ierr = FARKStepSetJacFn(arkode_mem, c_funloc(Jac)) if (ierr /= 0) then - print *, 'Error in FARKodeSetJacFn' - stop 1 + 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 + print *, 'ERROR: sunls_M = NULL' + stop 1 end if time_dep = 0 - ierr = FARKodeSetMassLinearSolver(arkode_mem, sunls_M, sunmat_M, time_dep) + ierr = FARKStepSetMassLinearSolver(arkode_mem, sunls_M, sunmat_M, time_dep) if (ierr /= 0) then - print *, 'Error in FARKodeSetMassLinearSolver' - stop 1 + print *, 'Error in FARKStepSetMassLinearSolver' + stop 1 end if - ierr = FARKodeSetMassFn(arkode_mem, c_funloc(Mass)) + ierr = FARKStepSetMassFn(arkode_mem, c_funloc(Mass)) if (ierr /= 0) then - print *, 'Error in FARKodeSetMassFn' - stop 1 + print *, 'Error in FARKStepSetMassFn' + stop 1 end if ! set relative and absolute tolerances rtol = 1.0d-6 atol = 1.0d-11 - ierr = FARKodeSStolerances(arkode_mem, rtol, atol) + ierr = FARKStepSStolerances(arkode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepSStolerances, ierr = ', ierr, '; halting' + stop 1 end if ! set residual tolerance with the same atol as above - ierr = FARKodeResStolerance(arkode_mem, atol) + ierr = FARKStepResStolerance(arkode_mem, atol) if (ierr /= 0) then - print *, 'Error in FARKodeResStolerance, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepResStolerance, ierr = ', ierr, '; halting' + stop 1 end if ! Set maximum number of internal time steps mxsteps = 1000 - ierr = FARKodeSetMaxNumSteps(arkode_mem, mxsteps) + ierr = FARKStepSetMaxNumSteps(arkode_mem, mxsteps) if (ierr /= 0) then - print *, 'Error in FARKodeSetNonlinConvCoef' - stop 1 + 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') + 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) + ierr = FARKStepWriteParameters(arkode_mem, outstr) if (ierr /= 0) then - print *, 'Error in FARKodeWriteParameters' - stop 1 + print *, 'Error in FARKStepWriteParameters' + 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 @@ -1243,43 +1256,43 @@ 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 = 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) + close(501) + close(502) + close(503) ! diagnostics output call ARKStepStats(arkode_mem) ! clean up - call FARKodeFree(arkode_mem) + call FARKStepFree(arkode_mem) call FN_VDestroy(sunvec_y) call FN_VDestroy(sunvec_u) call FN_VDestroy(sunvec_v) @@ -1293,6 +1306,7 @@ program main end program main ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! ARKStepStats ! @@ -1330,93 +1344,93 @@ subroutine ARKStepStats(arkode_mem) !======= Internals ============ - ierr = FARKodeGetNumSteps(arkode_mem, nsteps) + ierr = FARKStepGetNumSteps(arkode_mem, nsteps) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumSteps, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumSteps, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) + ierr = FARKStepGetNumStepAttempts(arkode_mem, nst_a) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumStepAttempts, retval = ', ierr, '; halting' - stop 1 + 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 + print *, 'Error in FARKStepGetNumRhsEvals, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetLastStep(arkode_mem, hlast) + ierr = FARKStepGetLastStep(arkode_mem, hlast) if (ierr /= 0) then - print *, 'Error in FARKodeGetLastStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetLastStep, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetCurrentStep(arkode_mem, hcur) + ierr = FARKStepGetCurrentStep(arkode_mem, hcur) if (ierr /= 0) then - print *, 'Error in FARKodeGetCurrentStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetCurrentStep, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetCurrentTime(arkode_mem, tcur) + ierr = FARKStepGetCurrentTime(arkode_mem, tcur) if (ierr /= 0) then - print *, 'Error in FARKodeGetCurrentTime, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetCurrentTime, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) + ierr = FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumLinSolvSetups, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) + ierr = FARKStepGetNumErrTestFails(arkode_mem, netfails) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumErrTestFails, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumErrTestFails, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) + ierr = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumNonlinSolvIters, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) + ierr = FARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumJacEvals(arkode_mem, njacevals) + ierr = FARKStepGetNumJacEvals(arkode_mem, njacevals) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumJacEvals, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumJacEvals, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumMassSetups(arkode_mem, nmassevals) + ierr = FARKStepGetNumMassSetups(arkode_mem, nmassevals) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumMassSetups, retval = ', ierr, '; halting' - stop 1 + 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 '(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 2b6579cf20..cdf1ebdb0b 100644 --- a/examples/arkode/F2003_serial/ark_bruss_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_bruss_f2003.f90 @@ -46,21 +46,11 @@ 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(kind=myindextype), parameter :: neq = 3 + 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, 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 +69,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 +81,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,6 +113,7 @@ 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) @@ -135,7 +126,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 @@ -147,7 +138,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 @@ -170,7 +161,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 @@ -188,7 +179,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 @@ -202,13 +193,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 ============ @@ -217,7 +208,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 @@ -229,6 +220,7 @@ end function Jac end module bruss_mod ! ------------------------------------------------------------------ + ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -264,8 +256,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 @@ -277,17 +269,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) @@ -296,54 +288,54 @@ 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) + ierr = FARKStepSetLinearSolver(arkode_mem, sunls, sunmat_A) if (ierr /= 0) then - print *, 'Error in FARKodeSetLinearSolver' - stop 1 + print *, 'Error in FARKStepSetLinearSolver' + stop 1 end if - ierr = FARKodeSetJacFn(arkode_mem, c_funloc(Jac)) + ierr = FARKStepSetJacFn(arkode_mem, c_funloc(Jac)) if (ierr /= 0) then - print *, 'Error in FARKodeSetJacFn' - stop 1 + print *, 'Error in FARKStepSetJacFn' + stop 1 end if ! set relative and absolute tolerances rtol = 1.0d-6 atol = 1.0d-10 - ierr = FARKodeSStolerances(arkode_mem, rtol, atol) + ierr = FARKStepSStolerances(arkode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepSStolerances, ierr = ', ierr, '; halting' + stop 1 end if ! Set additional method parameters - ierr = FARKodeSetOrder(arkode_mem, order) + ierr = FARKStepSetOrder(arkode_mem, order) if (ierr /= 0) then - print *, 'Error in FARKodeSetOrder' - stop 1 + print *, 'Error in FARKStepSetOrder' + stop 1 end if - ierr = FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) + ierr = FARKStepSetNonlinConvCoef(arkode_mem, nlscoef) if (ierr /= 0) then - print *, 'Error in FARKodeSetNonlinConvCoef' - stop 1 + print *, 'Error in FARKStepSetNonlinConvCoef' + stop 1 end if imethod = 0 @@ -352,16 +344,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 *, ' ' @@ -370,29 +362,29 @@ 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 - end if + ! 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) + ! 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) - end do + enddo print *, ' ----------------------------------------------------' - close (100) + close(100) ! diagnostics output call ARKStepStats(arkode_mem) ! clean up - call FARKodeFree(arkode_mem) + call FARKStepFree(arkode_mem) call FN_VDestroy(sunvec_y) call FSUNMatDestroy(sunmat_A) ierr = FSUNLinSolFree(sunls) @@ -401,6 +393,7 @@ program main end program main ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! ARKStepStats ! @@ -438,93 +431,93 @@ subroutine ARKStepStats(arkode_mem) !======= Internals ============ - ierr = FARKodeGetNumSteps(arkode_mem, nsteps) + ierr = FARKStepGetNumSteps(arkode_mem, nsteps) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumSteps, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumSteps, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) + ierr = FARKStepGetNumStepAttempts(arkode_mem, nst_a) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumStepAttempts, retval = ', ierr, '; halting' - stop 1 + 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 + print *, 'Error in FARKStepGetNumRhsEvals, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetActualInitStep(arkode_mem, hinused) + ierr = FARKStepGetActualInitStep(arkode_mem, hinused) if (ierr /= 0) then - print *, 'Error in FARKodeGetActualInitStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetActualInitStep, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetLastStep(arkode_mem, hlast) + ierr = FARKStepGetLastStep(arkode_mem, hlast) if (ierr /= 0) then - print *, 'Error in FARKodeGetLastStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetLastStep, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetCurrentStep(arkode_mem, hcur) + ierr = FARKStepGetCurrentStep(arkode_mem, hcur) if (ierr /= 0) then - print *, 'Error in FARKodeGetCurrentStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetCurrentStep, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetCurrentTime(arkode_mem, tcur) + ierr = FARKStepGetCurrentTime(arkode_mem, tcur) if (ierr /= 0) then - print *, 'Error in FARKodeGetCurrentTime, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetCurrentTime, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) + ierr = FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumLinSolvSetups, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) + ierr = FARKStepGetNumErrTestFails(arkode_mem, netfails) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumErrTestFails, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumErrTestFails, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) + ierr = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumNonlinSolvIters, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) + ierr = FARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumJacEvals(arkode_mem, njacevals) + ierr = FARKStepGetNumJacEvals(arkode_mem, njacevals) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumJacEvals, retval = ', ierr, '; halting' - stop 1 + 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 '(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 6cdc9bad24..372cbf1642 100644 --- a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 @@ -53,9 +53,9 @@ module DiurnalKryBP_mod implicit none ! setup and number of equations - integer(c_int), parameter :: mx = 10, my = 10 - integer(c_int64_t), parameter :: mm = mx*my - integer(c_int64_t), parameter :: neq = 2*mm + 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 @@ -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,6 +204,7 @@ end function ImpRhsFn end module DiurnalKryBP_mod ! ------------------------------------------------------------------ + ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -229,15 +230,15 @@ 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_int64_t) :: mu, ml ! band preconditioner constants + 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(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) @@ -250,80 +251,81 @@ 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) + ierr = FARKStepSetLinearSolver(arkode_mem, sunls, sunmat_A) if (ierr /= 0) then - print *, 'Error in FARKodeSetLinearSolver, ierr = ', ierr, '; halting' - stop 1 + 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 + 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) + ierr = FARKStepSStolerances(arkode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepSStolerances, ierr = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeSetMaxNumSteps(arkode_mem, mxsteps) + ierr = FARKStepSetMaxNumSteps(arkode_mem, mxsteps) if (ierr /= 0) then - print *, 'Error in FARKodeSetMaxNumSteps' - stop 1 + print *, 'Error in FARKStepSetMaxNumSteps' + stop 1 end if ! Start time stepping @@ -334,40 +336,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 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 *, ' ----------------------------------------------------------------------------------------' @@ -376,7 +378,7 @@ program main call ARKStepStats(arkode_mem) ! clean up - call FARKodeFree(arkode_mem) + call FARKStepFree(arkode_mem) call FN_VDestroy(sunvec_u) call FN_VDestroy(sunvec_f) ierr = FSUNLinSolFree(sunls) @@ -385,6 +387,7 @@ program main end program main ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! ARKStepStats ! @@ -426,110 +429,110 @@ subroutine ARKStepStats(arkode_mem) !======= Internals ============ - ierr = FARKodeGetNumSteps(arkode_mem, nsteps) + ierr = FARKStepGetNumSteps(arkode_mem, nsteps) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumSteps, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumSteps, ierr = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) + ierr = FARKStepGetNumStepAttempts(arkode_mem, nst_a) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumStepAttempts, ierr = ', ierr, '; halting' - stop 1 + 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 + print *, 'Error in FARKStepGetNumRhsEvals, ierr = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) + ierr = FARKStepGetNumErrTestFails(arkode_mem, netfails) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumErrTestFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumErrTestFails, ierr = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumPrecEvals(arkode_mem, npe) + ierr = FARKStepGetNumPrecEvals(arkode_mem, npe) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumPrecEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumPrecEvals, ierr = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumPrecSolves(arkode_mem, nps) + ierr = FARKStepGetNumPrecSolves(arkode_mem, nps) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumPrecSolves, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumPrecSolves, ierr = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) + ierr = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvIters, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumNonlinSolvIters, ierr = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumLinIters(arkode_mem, nliters) + ierr = FARKStepGetNumLinIters(arkode_mem, nliters) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumLinIters, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumLinIters, ierr = ', ierr, '; halting' + stop 1 end if avdim = dble(nliters)/dble(nniters) - ierr = FARKodeGetNumLinConvFails(arkode_mem, ncfl) + ierr = FARKStepGetNumLinConvFails(arkode_mem, ncfl) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumLinConvFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumLinConvFails, ierr = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetNumNonlinSolvConvFails(arkode_mem, ncf) + ierr = FARKStepGetNumNonlinSolvConvFails(arkode_mem, ncf) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetWorkSpace(arkode_mem, lenrw, leniw) + ierr = FARKStepGetWorkSpace(arkode_mem, lenrw, leniw) if (ierr /= 0) then - print *, 'Error in FARKodeGetWorkSpace, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetWorkSpace, ierr = ', ierr, '; halting' + stop 1 end if - ierr = FARKodeGetLinWorkSpace(arkode_mem, lenrwls, leniwls) + ierr = FARKStepGetLinWorkSpace(arkode_mem, lenrwls, leniwls) if (ierr /= 0) then - print *, 'Error in FARKodeGetLinWorkSpace, ierr = ', ierr, '; halting' - stop 1 + 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 + 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_diurnal_kry_bp_f2003.out b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.out index 68e0609dbb..4bc5495c61 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,7 +43,8 @@ Avg Krylov subspace dim = 1.946096E+00 Num nonlinear solver fails = 0 Num linear solver fails = 0 - main solver real/int workspace sizes = 3702 145 + 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 2b5cc5747e..b925a5ab76 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_long), 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,6 +571,7 @@ end function Ytrue end module kpr_mod ! ------------------------------------------------------------------ + ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -579,6 +580,7 @@ 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 @@ -598,8 +600,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) @@ -620,18 +622,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 @@ -641,11 +643,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 @@ -657,15 +659,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 @@ -679,41 +681,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 @@ -742,17 +744,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 @@ -766,17 +768,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 @@ -790,17 +792,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 @@ -815,21 +817,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 @@ -840,27 +842,27 @@ program main call check_retval(retval, "FARKStepSetTables") MATf => FSUNDenseMatrix(NEQ, NEQ, sunctx) LSf => FSUNLinSol_Dense(y, MATf, sunctx) - 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") + 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") call FARKodeButcherTable_Free(BTf) 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 @@ -879,9 +881,9 @@ program main end if ! Set the fast step size */ - retval = FARKodeSetFixedStep(inner_arkode_mem, hf) + retval = FARKStepSetFixedStep(inner_arkode_mem, hf) if (retval /= 0) then - print *, 'ERROR: FARKodeSetFixedStep failed' + print *, 'ERROR: FARKStepSetFixedStep failed' stop 1 end if @@ -924,15 +926,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 @@ -949,12 +951,12 @@ program main call check_retval(retval, "FMRIStepSetCoupling") MATs => FSUNDenseMatrix(NEQ, NEQ, sunctx) LSs => FSUNLinSol_Dense(y, MATs, sunctx) - 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") + 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") 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) @@ -963,12 +965,12 @@ program main call check_retval(retval, "FMRIStepSetCoupling") MATs => FSUNDenseMatrix(NEQ, NEQ, sunctx) LSs => FSUNLinSol_Dense(y, MATs, sunctx) - 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") + 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") 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) @@ -977,12 +979,12 @@ program main call check_retval(retval, "FMRIStepSetCoupling") MATs => FSUNDenseMatrix(NEQ, NEQ, sunctx) LSs => FSUNLinSol_Dense(y, MATs, sunctx) - 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") + 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") 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) @@ -990,12 +992,12 @@ program main retval = FMRIStepSetCoupling(arkode_mem, SC) MATs => FSUNDenseMatrix(NEQ, NEQ, sunctx) LSs => FSUNLinSol_Dense(y, MATs, sunctx) - 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") + 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") end if if (.not. c_associated(arkode_mem)) then @@ -1004,23 +1006,23 @@ program main end if ! Set the slow step size - retval = FARKodeSetFixedStep(arkode_mem, hs) - call check_retval(retval, "FARKodeSetFixedStep") + retval = FMRIStepSetFixedStep(arkode_mem, hs) + call check_retval(retval, "FMRIStepSetFixedStep") ! ! Integrate ODE ! - ! Main time-stepping loop: calls ARKodeEvolve to perform the + ! Main time-stepping loop: calls MRIStepEvolve to perform the ! 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)', & @@ -1028,14 +1030,14 @@ program main do iout = 1, Nt ! call integrator - retval = FARKodeEvolve(arkode_mem, tout, y, tret, ARK_NORMAL) - call check_retval(retval, "FARKodeEvolve") + retval = FMRIStepEvolve(arkode_mem, tout, y, tret, ARK_NORMAL) + call check_retval(retval, "FMRIStepEvolve") ! 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 @@ -1045,10 +1047,10 @@ program main if (tout > Tf) then tout = Tf end if - end do - uerrtot = sqrt(uerrtot/Nt) - verrtot = sqrt(verrtot/Nt) - errtot = sqrt(errtot/Nt/2) + enddo + uerrtot = sqrt(uerrtot / Nt) + verrtot = sqrt(verrtot / Nt) + errtot = sqrt(errtot / Nt / 2) print *, " ------------------------------------------------------" ! @@ -1056,11 +1058,11 @@ program main ! ! Get some slow integrator statistics - retval = FARKodeGetNumSteps(arkode_mem, nsts) + retval = FMRIStepGetNumSteps(arkode_mem, nsts) retval = FMRIStepGetNumRhsEvals(arkode_mem, nfse, nfsi) ! Get some fast integrator statistics - retval = FARKodeGetNumSteps(inner_arkode_mem, nstf) + retval = FARKStepGetNumSteps(inner_arkode_mem, nstf) retval = FARKStepGetNumRhsEvals(inner_arkode_mem, nff, tmp) ! Print some final statistics @@ -1078,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 = FARKodeGetNonlinSolvStats(arkode_mem, nnis, nncs) - call check_retval(retval, "ARKodeGetNonlinSolvStats") - retval = FARKodeGetNumJacEvals(arkode_mem, njes) - call check_retval(retval, "ARKodeGetNumJacEvals") + retval = FMRIStepGetNonlinSolvStats(arkode_mem, nnis, nncs) + call check_retval(retval, "MRIStepGetNonlinSolvStats") + retval = FMRIStepGetNumJacEvals(arkode_mem, njes) + call check_retval(retval, "MRIStepGetNumJacEvals") print '(A, I7)', " Slow Newton iters = ", nnis print '(A, I7)', " Slow Newton conv fails = ", nncs print '(A, I7)', " Slow Jacobian evals = ", njes @@ -1089,34 +1091,34 @@ program main ! Get/print fast integrator implicit solver statistics if (solve_type == 2) then - retval = FARKodeGetNonlinSolvStats(inner_arkode_mem, nnif, nncf) - call check_retval(retval, "ARKodeGetNonlinSolvStats") - retval = FARKodeGetNumJacEvals(inner_arkode_mem, njef) - call check_retval(retval, "ARKodeGetNumJacEvals") + retval = FARKStepGetNonlinSolvStats(inner_arkode_mem, nnif, nncf) + call check_retval(retval, "ARKStepGetNonlinSolvStats") + retval = FARKStepGetNumJacEvals(inner_arkode_mem, njef) + call check_retval(retval, "ARKStepGetNumJacEvals") print '(A, I7)', " Fast Newton iters = ", nnif print '(A, I7)', " Fast Newton conv fails = ", nncf print '(A, I7)', " Fast Jacobian evals = ", njef 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 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 FARKodeFree(inner_arkode_mem) ! Free fast integrator memory + call FARKStepFree(inner_arkode_mem) ! Free fast integrator memory retval = FMRIStepInnerStepper_Free(inner_stepper) ! Free inner stepper - call FARKodeFree(arkode_mem) ! Free slow integrator memory + call FMRIStepFree(arkode_mem) ! Free slow integrator memory retval = FSUNContext_Free(sunctx) ! Free context end program main @@ -1129,7 +1131,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 2c5016d2d2..a57dd5f9c6 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_int64_t), parameter :: neq = 3 + integer(c_long), parameter :: neq = 3 integer(c_long), parameter :: nout = 12 contains @@ -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 @@ -275,90 +275,90 @@ 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 FARKodeSVtolerances to set tolerances - retval = FARKodeSVtolerances(arkode_mem, rtol, sunvec_av) + ! Call FARKStepSVtolerances to set tolerances + retval = FARKStepSVtolerances(arkode_mem, rtol, sunvec_av) if (retval /= 0) then - print *, 'Error in FARKodeSVtolerances, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepSVtolerances, retval = ', retval, '; halting' + stop 1 end if - ! Call FARKodeRootInit to specify the root function grob with 2 components + ! Call FARKStepRootInit to specify the root function grob with 2 components nrtfn = 2 - retval = FARKodeRootInit(arkode_mem, nrtfn, c_funloc(grob)) + retval = FARKStepRootInit(arkode_mem, nrtfn, c_funloc(grob)) if (retval /= 0) then - print *, 'Error in FARKodeRootInit, retval = ', retval, '; halting' - stop 1 + 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 + 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 = FARKStepSetLinearSolver(arkode_mem, sunlinsol_LS, sunmat_A); if (retval /= 0) then - print *, 'Error in FARKodeSetLinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepSetLinearSolver, retval = ', retval, '; halting' + stop 1 end if ! Set the user-supplied Jacobian routine - retval = FARKodeSetJacFn(arkode_mem, c_funloc(jacrob)) + retval = FARKStepSetJacFn(arkode_mem, c_funloc(jacrob)) if (retval /= 0) then - print *, 'Error in FARKodeSetJacFn, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepSetJacFn, retval = ', retval, '; halting' + stop 1 end if ! Set additional method parameters mxsteps = 10000 - retval = FARKodeSetMaxNumSteps(arkode_mem, mxsteps) + retval = FARKStepSetMaxNumSteps(arkode_mem, mxsteps) if (retval /= 0) then - print *, 'Error in FARKodeSetMaxNumSteps' - stop 1 + print *, 'Error in FARKStepSetMaxNumSteps' + stop 1 end if - initsize = 1.d-4*rtol - retval = FARKodeSetInitStep(arkode_mem, initsize) + initsize = 1.d-4 * rtol + retval = FARKStepSetInitStep(arkode_mem, initsize) if (retval /= 0) then - print *, 'Error in FARKodeSetInitStep' - stop 1 + print *, 'Error in FARKStepSetInitStep' + stop 1 end if nlscoef = 1.d-7 - retval = FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) + retval = FARKStepSetNonlinConvCoef(arkode_mem, nlscoef) if (retval /= 0) then - print *, 'Error in FARKodeSetNonlinConvCoef' - stop 1 + print *, 'Error in FARKStepSetNonlinConvCoef' + stop 1 end if nliters = 8 - retval = FARKodeSetMaxNonlinIters(arkode_mem, nliters) + retval = FARKStepSetMaxNonlinIters(arkode_mem, nliters) if (retval /= 0) then - print *, 'Error in FARKodeSetMaxNonlinIters' - stop 1 + print *, 'Error in FARKStepSetMaxNonlinIters' + stop 1 end if pmethod = 1 - retval = FARKodeSetPredictorMethod(arkode_mem, pmethod) + retval = FARKStepSetPredictorMethod(arkode_mem, pmethod) if (retval /= 0) then - print *, 'Error in FARKodeSetPredictorMethod' - stop 1 + print *, 'Error in FARKStepSetPredictorMethod' + stop 1 end if maxetf = 20 - retval = FARKodeSetMaxErrTestFails(arkode_mem, maxetf) + retval = FARKStepSetMaxErrTestFails(arkode_mem, maxetf) if (retval /= 0) then - print *, 'Error in FARKodeSetMaxErrTestFails' - stop 1 + print *, 'Error in FARKStepSetMaxErrTestFails' + 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) + retval = FARKStepSetNonlinearSolver(arkode_mem, sunnonlin_NLS) if (retval /= 0) then - print *, 'Error in FARKodeSetNonlinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepSetNonlinearSolver, retval = ', retval, '; halting' + stop 1 end if - ! In loop, call ARKodeEvolve, print results, and test for error. + ! In loop, call ARKStepEvolve, 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) - - if (retval == ARK_ROOT_RETURN) then - retvalr = FARKodeGetRootInfo(arkode_mem, rootsfound) - if (retvalr < 0) then - print *, 'Error in FARKodeGetRootInfo, retval = ', retval, '; halting' + retval = FARKStepEvolve(arkode_mem, tout, sunvec_y, tret(1), ARK_NORMAL) + if (retval < 0) then + print *, 'Error in FARKStepEvolve, retval = ', retval, '; halting' stop 1 - 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 + 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 + print *, 'ERROR: sunvec = NULL' + stop 1 end if - retval = FARKodeGetDky(arkode_mem, tret(1), 1, sunvec_dky) + retval = FARKStepGetDky(arkode_mem, tret(1), 1, sunvec_dky) if (retval /= 0) then - print *, 'Error in ARKodeGetDky' - stop 1 + print *, 'Error in ARKStepGetDky' + stop 1 end if print *, " " print *, "------------------------------------------------------" @@ -428,7 +428,7 @@ program main call PrintFinalStats(arkode_mem) ! free memory - call FARKodeFree(arkode_mem) + call FARKStepFree(arkode_mem) retval = FSUNNonlinSolFree(sunnonlin_NLS) retval = FSUNLinSolFree(sunlinsol_LS) call FSUNMatDestroy(sunmat_A) @@ -440,6 +440,7 @@ program main end program main ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -464,8 +465,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 *, "----------------------------------------------------------------------" @@ -476,6 +477,7 @@ subroutine PrintHeader(rtol, avtol, y) end subroutine PrintHeader ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -501,24 +503,25 @@ subroutine PrintOutput(arkode_mem, t, y) !======= Internals ============ - retval = FARKodeGetNumSteps(arkode_mem, nst) + retval = FARKStepGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumSteps, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetLastStep(arkode_mem, hused) + retval = FARKStepGetLastStep(arkode_mem, hused) if (retval /= 0) then - print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' - stop 1 + 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) + t, y(1), y(2), y(3), "| ", nst, hused(1) end subroutine PrintOutput ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -556,93 +559,93 @@ subroutine PrintFinalStats(arkode_mem) !======= Internals ============ - retval = FARKodeGetNumSteps(arkode_mem, nsteps) + retval = FARKStepGetNumSteps(arkode_mem, nsteps) if (retval /= 0) then - print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumSteps, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) + retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, 'Error in FARKodeGetNumStepAttempts, retval = ', retval, '; halting' - stop 1 + 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 + print *, 'Error in FARKStepGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetActualInitStep(arkode_mem, hinused) + retval = FARKStepGetActualInitStep(arkode_mem, hinused) if (retval /= 0) then - print *, 'Error in FARKodeGetActualInitStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetActualInitStep, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetLastStep(arkode_mem, hlast) + retval = FARKStepGetLastStep(arkode_mem, hlast) if (retval /= 0) then - print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetLastStep, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetCurrentStep(arkode_mem, hcur) + retval = FARKStepGetCurrentStep(arkode_mem, hcur) if (retval /= 0) then - print *, 'Error in FARKodeGetCurrentStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetCurrentStep, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetCurrentTime(arkode_mem, tcur) + retval = FARKStepGetCurrentTime(arkode_mem, tcur) if (retval /= 0) then - print *, 'Error in FARKodeGetCurrentTime, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetCurrentTime, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) + retval = FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) if (retval /= 0) then - print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumLinSolvSetups, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetNumErrTestFails(arkode_mem, netfails) + retval = FARKStepGetNumErrTestFails(arkode_mem, netfails) if (retval /= 0) then - print *, 'Error in FARKodeGetNumErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) + retval = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) if (retval /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) + retval = FARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) if (retval /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetNumJacEvals(arkode_mem, njacevals) + retval = FARKStepGetNumJacEvals(arkode_mem, njacevals) if (retval /= 0) then - print *, 'Error in FARKodeGetNumJacEvals, retval = ', retval, '; halting' - stop 1 + 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 '(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 79c3395ffa..30b41329ee 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_int64_t), parameter :: neq = 3 + integer(c_long), parameter :: neq = 3 integer(c_long), parameter :: nout = 12 contains @@ -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,6 +195,7 @@ end function jacrob end module dns_mod ! ------------------------------------------------------------------ + program main !======= Inclusions =========== @@ -215,12 +216,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 @@ -239,11 +240,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 @@ -251,20 +252,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 @@ -277,90 +278,90 @@ 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 FARKodeSVtolerances to set tolerances - retval = FARKodeSVtolerances(arkode_mem, rtol, sunvec_av) + ! Call FARKStepSVtolerances to set tolerances + retval = FARKStepSVtolerances(arkode_mem, rtol, sunvec_av) if (retval /= 0) then - print *, 'Error in FARKodeSVtolerances, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepSVtolerances, retval = ', retval, '; halting' + stop 1 end if - ! Call FARKodeRootInit to specify the root function grob with 2 components + ! Call FARKStepRootInit to specify the root function grob with 2 components nrtfn = 2 - retval = FARKodeRootInit(arkode_mem, nrtfn, c_funloc(grob)) + retval = FARKStepRootInit(arkode_mem, nrtfn, c_funloc(grob)) if (retval /= 0) then - print *, 'Error in FARKodeRootInit, retval = ', retval, '; halting' - stop 1 + 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 + 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 = FARKStepSetLinearSolver(arkode_mem, sunlinsol_LS, sunmat_A); if (retval /= 0) then - print *, 'Error in FARKodeSetLinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepSetLinearSolver, retval = ', retval, '; halting' + stop 1 end if ! Set the user-supplied Jacobian routine - retval = FARKodeSetJacFn(arkode_mem, c_funloc(jacrob)) + retval = FARKStepSetJacFn(arkode_mem, c_funloc(jacrob)) if (retval /= 0) then - print *, 'Error in FARKodeSetJacFn, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepSetJacFn, retval = ', retval, '; halting' + stop 1 end if ! Set additional method parameters mxsteps = 10000 - retval = FARKodeSetMaxNumSteps(arkode_mem, mxsteps) + retval = FARKStepSetMaxNumSteps(arkode_mem, mxsteps) if (retval /= 0) then - print *, 'Error in FARKodeSetMaxNumSteps' - stop 1 + print *, 'Error in FARKStepSetMaxNumSteps' + stop 1 end if - initsize = 1.d-4*rtol - retval = FARKodeSetInitStep(arkode_mem, initsize) + initsize = 1.d-4 * rtol + retval = FARKStepSetInitStep(arkode_mem, initsize) if (retval /= 0) then - print *, 'Error in FARKodeSetInitStep' - stop 1 + print *, 'Error in FARKStepSetInitStep' + stop 1 end if nlscoef = 1.d-7 - retval = FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) + retval = FARKStepSetNonlinConvCoef(arkode_mem, nlscoef) if (retval /= 0) then - print *, 'Error in FARKodeSetNonlinConvCoef' - stop 1 + print *, 'Error in FARKStepSetNonlinConvCoef' + stop 1 end if nliters = 8 - retval = FARKodeSetMaxNonlinIters(arkode_mem, nliters) + retval = FARKStepSetMaxNonlinIters(arkode_mem, nliters) if (retval /= 0) then - print *, 'Error in FARKodeSetMaxNonlinIters' - stop 1 + print *, 'Error in FARKStepSetMaxNonlinIters' + stop 1 end if pmethod = 1 - retval = FARKodeSetPredictorMethod(arkode_mem, pmethod) + retval = FARKStepSetPredictorMethod(arkode_mem, pmethod) if (retval /= 0) then - print *, 'Error in FARKodeSetPredictorMethod' - stop 1 + print *, 'Error in FARKStepSetPredictorMethod' + stop 1 end if maxetf = 20 - retval = FARKodeSetMaxErrTestFails(arkode_mem, maxetf) + retval = FARKStepSetMaxErrTestFails(arkode_mem, maxetf) if (retval /= 0) then - print *, 'Error in FARKodeSetMaxErrTestFails' - stop 1 + print *, 'Error in FARKStepSetMaxErrTestFails' + stop 1 end if ! Create Newton SUNNonlinearSolver object. ARKODE uses a @@ -369,56 +370,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) + retval = FARKStepSetNonlinearSolver(arkode_mem, sunnonlin_NLS) if (retval /= 0) then - print *, 'Error in FARKodeSetNonlinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepSetNonlinearSolver, retval = ', retval, '; halting' + stop 1 end if - ! In loop, call ARKodeEvolve, print results, and test for error. + ! In loop, call ARKStepEvolve, print results, and test for error. iout = 0 tout = tout1 - 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) + do while(iout < nout) - if (retval == ARK_ROOT_RETURN) then - retvalr = FARKodeGetRootInfo(arkode_mem, rootsfound) - if (retvalr < 0) then - print *, 'Error in FARKodeGetRootInfo, retval = ', retval, '; halting' + retval = FARKStepEvolve(arkode_mem, tout, sunvec_y, tret(1), ARK_NORMAL) + if (retval < 0) then + print *, 'Error in FARKStepEvolve, retval = ', retval, '; halting' stop 1 - 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 + 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 + print *, 'ERROR: sunvec = NULL' + stop 1 end if - retval = FARKodeGetDky(arkode_mem, tret(1), 1, sunvec_dky) + retval = FARKStepGetDky(arkode_mem, tret(1), 1, sunvec_dky) if (retval /= 0) then - print *, 'Error in ARKodeGetDky' - stop 1 + print *, 'Error in ARKStepGetDky' + stop 1 end if print *, " " print *, "------------------------------------------------------" @@ -430,7 +431,7 @@ program main call PrintFinalStats(arkode_mem) ! free memory - call FARKodeFree(arkode_mem) + call FARKStepFree(arkode_mem) retval = FSUNNonlinSolFree(sunnonlin_NLS) retval = FSUNLinSolFree(sunlinsol_LS) call FSUNMatDestroy(sunmat_A) @@ -442,6 +443,7 @@ program main end program main ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -466,8 +468,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 *, "----------------------------------------------------------------------" @@ -478,6 +480,7 @@ subroutine PrintHeader(rtol, avtol, y) end subroutine PrintHeader ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -503,24 +506,25 @@ subroutine PrintOutput(arkode_mem, t, y) !======= Internals ============ - retval = FARKodeGetNumSteps(arkode_mem, nst) + retval = FARKStepGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumSteps, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetLastStep(arkode_mem, hused) + retval = FARKStepGetLastStep(arkode_mem, hused) if (retval /= 0) then - print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' - stop 1 + 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) + t, y(1), y(2), y(3), "| ", nst, hused(1) end subroutine PrintOutput ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -558,93 +562,93 @@ subroutine PrintFinalStats(arkode_mem) !======= Internals ============ - retval = FARKodeGetNumSteps(arkode_mem, nsteps) + retval = FARKStepGetNumSteps(arkode_mem, nsteps) if (retval /= 0) then - print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumSteps, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) + retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, 'Error in FARKodeGetNumStepAttempts, retval = ', retval, '; halting' - stop 1 + 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 + print *, 'Error in FARKStepGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetActualInitStep(arkode_mem, hinused) + retval = FARKStepGetActualInitStep(arkode_mem, hinused) if (retval /= 0) then - print *, 'Error in FARKodeGetActualInitStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetActualInitStep, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetLastStep(arkode_mem, hlast) + retval = FARKStepGetLastStep(arkode_mem, hlast) if (retval /= 0) then - print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetLastStep, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetCurrentStep(arkode_mem, hcur) + retval = FARKStepGetCurrentStep(arkode_mem, hcur) if (retval /= 0) then - print *, 'Error in FARKodeGetCurrentStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetCurrentStep, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetCurrentTime(arkode_mem, tcur) + retval = FARKStepGetCurrentTime(arkode_mem, tcur) if (retval /= 0) then - print *, 'Error in FARKodeGetCurrentTime, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetCurrentTime, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) + retval = FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) if (retval /= 0) then - print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumLinSolvSetups, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetNumErrTestFails(arkode_mem, netfails) + retval = FARKStepGetNumErrTestFails(arkode_mem, netfails) if (retval /= 0) then - print *, 'Error in FARKodeGetNumErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) + retval = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) if (retval /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) + retval = FARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) if (retval /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 end if - retval = FARKodeGetNumJacEvals(arkode_mem, njacevals) + retval = FARKStepGetNumJacEvals(arkode_mem, njacevals) if (retval /= 0) then - print *, 'Error in FARKodeGetNumJacEvals, retval = ', retval, '; halting' - stop 1 + 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 '(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 7d3ee72e33..a6132d9df6 100644 --- a/examples/arkode/F2003_serial/test_ark_butcher_f2003.f90 +++ b/examples/arkode/F2003_serial/test_ark_butcher_f2003.f90 @@ -16,13 +16,7 @@ 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 + contains integer function smoke_tests() result(ret) @@ -33,9 +27,9 @@ integer function smoke_tests() result(ret) !======== Declarations ======== implicit none type(c_ptr) :: ERK, DIRK - 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) + 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) !===== Setup ==== @@ -52,7 +46,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 +54,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,6 +69,7 @@ end function smoke_tests end module + program main !======== Inclusions ========== use, intrinsic :: iso_c_binding diff --git a/examples/cvode/CMakeLists.txt b/examples/cvode/CMakeLists.txt index eab3a925e9..f5bdfb8d78 100644 --- a/examples/cvode/CMakeLists.txt +++ b/examples/cvode/CMakeLists.txt @@ -79,9 +79,7 @@ endif() # Fortran examples if(BUILD_FORTRAN_MODULE_INTERFACE AND EXAMPLES_ENABLE_F2003) add_subdirectory(F2003_serial) - if(ENABLE_MPI) - add_subdirectory(F2003_parallel) - endif() + add_subdirectory(F2003_parallel) endif() # CUDA examples diff --git a/examples/cvode/CXX_parallel/cv_heat2D_p.cpp b/examples/cvode/CXX_parallel/cv_heat2D_p.cpp index aabfef2e64..068d59993d 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 = ZERO; - bool outproc = (udata->myid_c == 0); + sunrealtype max; + 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 c213aeaca2..77af0d8b03 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& ctx) : sunctx(ctx) +UserData::UserData(sundials::Context& sunctx) : sunctx(sunctx) { // 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 = ZERO; - bool outproc = (udata->myid_c == 0); + sunrealtype max; + 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 5d74df7818..762d36e973 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& ctx) : sunctx(ctx) +UserData::UserData(sundials::Context& sunctx) : sunctx(sunctx) { // 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 = ZERO; - bool outproc = (udata->myid_c == 0); + sunrealtype max; + 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 35bfa1ef84..0488247e7c 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 -static int Solution(sunrealtype t, N_Vector u, UserData& udata) +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 @@ static int Solution(sunrealtype t, N_Vector u, UserData& udata) } // Compute the solution error -static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) +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 @@ static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) } // Print command line options -static void InputHelp() +void InputHelp() { std::cout << std::endl << "Command line options:\n" @@ -176,7 +176,7 @@ static void InputHelp() } // Read command line inputs -static int ReadInputs(std::vector<std::string>& args, UserData& udata) +int ReadInputs(std::vector<std::string>& args, UserData& udata) { if (find(args.begin(), args.end(), "--help") != args.end()) { @@ -212,7 +212,7 @@ static int ReadInputs(std::vector<std::string>& args, UserData& udata) } // Print user data -static void PrintUserData(UserData& udata) +void PrintUserData(UserData& udata) { std::cout << std::endl << "2D Heat problem:\n" @@ -243,7 +243,7 @@ static void PrintUserData(UserData& udata) } // Initialize output -static int OpenOutput(UserData& udata) +int OpenOutput(UserData& udata) { // Header for status output std::cout << std::scientific @@ -280,7 +280,7 @@ static int OpenOutput(UserData& udata) } // Write output -static int WriteOutput(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) +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 @@ static int WriteOutput(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) } // Finalize output -static int CloseOutput(UserData& udata) +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 5d4d0e10b4..aa258668d7 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 -static void InputHelp() +void InputHelp() { std::cout << std::endl; std::cout << "Command line options:" << std::endl; @@ -98,8 +98,7 @@ static void InputHelp() std::cout << " --nout : number of outputs\n"; } -static int ReadInputs(std::vector<std::string>& args, Options& opts, - SUNContext ctx) +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/F2003_parallel/CMakeLists.txt b/examples/cvode/F2003_parallel/CMakeLists.txt index e686e97fa3..c2b894d375 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(SUNDIALS_INDEX_SIZE MATCHES "64") +if(MPI_ENABLED) 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 52ca72d685..1710a0d061 100644 --- a/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 +++ b/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 @@ -21,482 +21,492 @@ !----------------------------------------------------------------- module DiagkrybbdData - !--------------------------------------------------------------- - ! 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) + !--------------------------------------------------------------- + ! Description: + ! Module containing problem-defining parameters. + !--------------------------------------------------------------- !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fsundials_core_mod + + 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 + ! With MPI-3 use mpi_f08 is preferred + include "mpif.h" - ! pointers to data in SUNDIALS vectors - real(c_double), pointer :: y(:) - real(c_double), pointer :: ydot(:) + save - ! local data - integer :: i + ! SUNDIALS simulation context + type(c_ptr) :: sunctx - !======= Internals ============ + ! MPI domain decomposition information + integer, target :: comm ! communicator object + integer :: myid ! MPI process ID + integer :: nprocs ! total number of MPI processes - ! Get data arrays from SUNDIALS vectors - y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) - ydot(1:nlocal) => FN_VGetArrayPointer(sunvec_ydot) + ! 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 - ! Initialize ydot to zero - ydot = 0.d0 + contains - ! 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_core_mod + !----------------------------------------------------------------- + ! ODE RHS function f(t,y) (implicit). + !----------------------------------------------------------------- + integer(c_int) function firhs(t, sunvec_y, sunvec_ydot, user_data) & + result(retval) bind(C) - !======= Declarations ========= - implicit none + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_nvector_mod - ! 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 + !======= Declarations ========= + implicit none - ! local data - integer :: ierr + ! 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 - 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 + ! pointers to data in SUNDIALS vectors + real(c_double), pointer :: y(:) + real(c_double), pointer :: ydot(:) - retval = 0 ! Return with success - return - end function LocalgFn - !----------------------------------------------------------------- + ! local data + integer :: i -end module DiagkrybbdData -!----------------------------------------------------------------- + !======= Internals ============ -!----------------------------------------------------------------- -! 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 + ! Get data arrays from SUNDIALS vectors + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + ydot(1:nlocal) => FN_VGetArrayPointer(sunvec_ydot) - 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 + ! Initialize ydot to zero + ydot = 0.d0 - retval = FSUNLinSol_SPGMRSetPrecType(sunls, iPretype) - if (retval /= 0) then - print *, "Error in FSUNLinSol_SPGMRSetPrecType, 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 - if (outproc) write (6, *) " Preconditioning on right:" + retval = 0 ! Return with success + return + end function firhs + !----------------------------------------------------------------- - 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 (iPretype == 1 .and. outproc) write (6, *) " Preconditioning on left:" + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_nvector_mod - ! 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 + !======= Declarations ========= + implicit none - ! 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 + ! 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 - retval = FCVodeGetNumSteps(cvode_mem, nst) - if (retval /= 0) then - print *, "Error: FCVodeGetNumSteps returned ", retval - call MPI_Abort(comm, 1, ierr) - end if + ! local data + integer :: ierr - retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) - if (retval /= 0) then - print *, "Error: FCVodeGetNumRhsEvals returned ", retval - call MPI_Abort(comm, 1, 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 - ! 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 = 0 ! Return with success + return + end function LocalgFn + !----------------------------------------------------------------- - end do - if (outproc) then - write (6, *) " --------------------------------" - end if + end module DiagkrybbdData + !----------------------------------------------------------------- - ! 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 + !----------------------------------------------------------------- + ! Main driver program + !----------------------------------------------------------------- + program driver - ! Print global max. error - if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax + ! 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 - ! 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 ========= + implicit none - retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) - if (retval /= 0) then - print *, "Error: FCVodeGetNumRhsEvals returned ", retval - call MPI_Abort(comm, 1, ierr) + ! 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 - - retval = FCVodeGetNumPrecEvals(cvode_mem, npre) - if (retval /= 0) then - print *, "Error: FCVodeGetNumPrecEvals returned ", retval - call MPI_Abort(comm, 1, ierr) + 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 - - retval = FCVodeGetNumPrecSolves(cvode_mem, npsol) - if (retval /= 0) then - print *, "Error: FCVodeGetNumPrecSolves returned ", retval - call MPI_Abort(comm, 1, ierr) + 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 - retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nni) - if (retval /= 0) then - print *, "Error: FCVodeGetNumNonlinSolvIters returned ", retval - call MPI_Abort(comm, 1, ierr) - end if + ! Set input arguments neq and alpha + neq = nprocs * nlocal + alpha = 10.0d0 - retval = FCVodeGetNumLinIters(cvode_mem, nli) + ! Create SUNDIALS simulation context, now that comm has been configured + retval = FSUNContext_Create(comm, sunctx) if (retval /= 0) then - print *, "Error: FCVodeGetNumLinIters returned ", retval + print *, "Error: FSUNContext_Create returned ", retval call MPI_Abort(comm, 1, ierr) end if - avdim = dble(nli)/dble(nni) + ! 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 - retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, ncfn) - if (retval /= 0) then - print *, "Error: FCVodeGetNumNonlinSolvConvFails returned ", retval - call MPI_Abort(comm, 1, ierr) + ! 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 = FCVodeGetNumLinConvFails(cvode_mem, ncfl) + retval = FCVodeInit(cvode_mem, c_funloc(firhs), t0, sunvec_y) if (retval /= 0) then - print *, "Error: FCVodeGetNumLinSolvConvFails returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVodeInit 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) + ! 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 - retval = FCVodeGetWorkSpace(cvode_mem, lenrw, leniw) + ! Attach the linear solver (with NULL SUNMatrix object) + sunmat_A => null() + retval = FCVodeSetLinearSolver(cvode_mem, sunls, sunmat_A) if (retval /= 0) then - print *, "Error: FCVodeGetWorkSpace returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, 'Error in FCVodeSetLinearSolver, retval = ', retval + call MPI_Abort(comm, 1, ierr) end if - retval = FCVodeGetLinWorkSpace(cvode_mem, lenrwls, leniwls) + retval = FSUNLinSol_SPGMRSetGSType(sunls, iGStype) if (retval /= 0) then - print *, "Error: FCVodeGetLinWorkSpace returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval + call MPI_Abort(comm, 1, ierr) end if - retval = FCVBBDPrecGetWorkSpace(cvode_mem, lenrwbbd, leniwbbd) + ! Specify tolerances + retval = FCVodeSStolerances(cvode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FCVBBDPrecGetWorkSpace returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVodeSStolerances returned ", retval + call MPI_Abort(comm, 1, ierr) end if - retval = FCVBBDPrecGetNumGfnEvals(cvode_mem, ngebbd) + 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: FCVBBDPrecGetNumGfnEvals returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVBBDPrecInit 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 + 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 + ! 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 2a8ca17ca1..9061936dfa 100644 --- a/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 +++ b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 @@ -28,7 +28,8 @@ module DiagkryData !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fsundials_core_mod + + use fsundials_nvector_mod !======= Declarations ========= implicit none @@ -47,10 +48,10 @@ 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_int64_t), parameter :: nlocal = 10 - integer(c_int64_t) :: neq + 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 @@ -60,11 +61,11 @@ 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 - use fsundials_core_mod + use fsundials_nvector_mod !======= Declarations ========= implicit none @@ -73,7 +74,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 +86,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,11 +111,11 @@ 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 - use fsundials_core_mod + use fsundials_nvector_mod !======= Declarations ========= implicit none @@ -128,14 +129,14 @@ 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(:) real(c_double), pointer, dimension(nlocal) :: r(:) ! local data - integer(c_int64_t) :: i, ibase, istart + integer(c_long) :: i, ibase, istart real(c_double) :: psubi, pj !======= Internals ============ @@ -148,12 +149,12 @@ integer(c_int) function Psolve(t, sunvec_y, sunvec_f, sunvec_r, sunvec_z, & z = r ! Calculate Jacobian here - 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 + 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 @@ -164,6 +165,7 @@ end function Psolve end module DiagkryData ! ------------------------------------------------------------------ + ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -171,10 +173,15 @@ program driver ! inclusions use, intrinsic :: iso_c_binding + use fsundials_futils_mod ! Fortran utilities use fcvode_mod ! Access CVode - use fsundials_core_mod + 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 ========= @@ -194,6 +201,7 @@ 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 @@ -223,47 +231,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, *) " " - end if + 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) @@ -273,220 +281,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 + 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 - if (iPretype == 2) then + ! Print global max. error + if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax - y = 1.d0 + ! 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 = FCVodeReInit(cvode_mem, t0, sunvec_y) - if (retval /= 0) then - print *, "Error in FCVodeReInit, retval = ", 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 = FSUNLinSol_SPGMRSetPrecType(sunls, iPretype) - if (retval /= 0) then - print *, "Error in FSUNLinSol_SPGMRSetPrecType, retval = ", retval + retval = FCVodeGetNumPrecEvals(cvode_mem, npre) + if (retval /= 0) then + print *, "Error: FCVodeGetNumPrecEvals returned ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - if (outproc) write (6, *) " Preconditioning on right:" + retval = FCVodeGetNumPrecSolves(cvode_mem, npsol) + if (retval /= 0) then + print *, "Error: FCVodeGetNumPrecSolves returned ", retval + call MPI_Abort(comm, 1, ierr) + end if - end if + retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nni) + if (retval /= 0) then + print *, "Error: FCVodeGetNumNonlinSolvIters returned ", retval + call MPI_Abort(comm, 1, ierr) + end if - if (iPretype == 1 .and. outproc) write (6, *) " Preconditioning on left:" + retval = FCVodeGetNumLinIters(cvode_mem, nli) + if (retval /= 0) then + print *, "Error: FCVodeGetNumLinIters 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 + avdim = dble(nli) / dble(nni) - ! Integrate to output time - retval = FCVode(cvode_mem, tout, sunvec_y, t, CV_NORMAL) - if (retval /= 0) then - print *, "Error: FCVode returned ", retval + retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, ncfn) + if (retval /= 0) then + print *, "Error: FCVodeGetNumNonlinSolvConvFails returned ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - retval = FCVodeGetNumSteps(cvode_mem, nst) - if (retval /= 0) then - print *, "Error: FCVodeGetNumSteps returned ", retval + retval = FCVodeGetNumLinConvFails(cvode_mem, ncfl) + if (retval /= 0) then + print *, "Error: FCVodeGetNumLinSolvConvFails returned ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) - if (retval /= 0) then - print *, "Error: FCVodeGetNumRhsEvals returned ", retval + retval = FCVodeGetNumErrTestFails(cvode_mem, netf) + if (retval /= 0) then + print *, "Error: FCVodeGetNumErrTestFails 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 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 + retval = FCVodeGetWorkSpace(cvode_mem, lenrw, leniw) + if (retval /= 0) then + print *, "Error: FCVodeGetWorkSpace 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 - - ! 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 + 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_kry_f2003.out b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.out index 284e66aed0..04ba4dc843 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 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 + 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 = 563 - Total preconditioner setups = 0 + Total RHS evals = 403 + Total preconditioner setups = 7 Total preconditioner solves = 727 - Total nonlinear iterations = 560 + Total nonlinear iterations = 400 Total linear iterations = 367 - Average Krylov subspace dimension = 0.6554 + Average Krylov subspace dimension = 0.9175 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 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 + 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 = 560 - Total preconditioner setups = 0 + Total RHS evals = 404 + Total preconditioner setups = 6 Total preconditioner solves = 730 - Total nonlinear iterations = 557 + Total nonlinear iterations = 401 Total linear iterations = 367 - Average Krylov subspace dimension = 0.6589 + Average Krylov subspace dimension = 0.9152 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 bea02183c3..c390f65de3 100644 --- a/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 +++ b/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 @@ -26,7 +26,8 @@ module DiagnonData !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fsundials_core_mod + + use fsundials_nvector_mod !======= Declarations ========= implicit none @@ -45,8 +46,8 @@ module DiagnonData integer :: nprocs ! total number of MPI processes ! Problem parameters - integer(c_int64_t), parameter :: nlocal = 2 - integer(c_int64_t) :: neq + integer(c_long), parameter :: nlocal = 2 + integer(c_long) :: neq real(c_double) :: alpha contains @@ -55,11 +56,11 @@ 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 - use fsundials_core_mod + use fsundials_nvector_mod !======= Declarations ========= implicit none @@ -68,27 +69,27 @@ 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(:) real(c_double), pointer, dimension(nlocal) :: ydot(:) ! local data - integer :: i + integer :: i, ierr !======= 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,9 +97,11 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & end function frhs ! ---------------------------------------------------------------- + end module DiagnonData ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! Main driver program ! ---------------------------------------------------------------- @@ -106,9 +109,13 @@ program driver ! inclusions use, intrinsic :: iso_c_binding - use fsundials_core_mod + 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 @@ -129,6 +136,7 @@ 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 @@ -147,46 +155,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, *) " " - end if + 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) @@ -196,88 +204,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 @@ -286,30 +294,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 - end if + 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 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 4fbc9c0568..bef79307c7 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 + Method is ADAMS/FIXED-POINT/SPGMR t steps fe ---------------------------- diff --git a/examples/cvode/F2003_serial/CMakeLists.txt b/examples/cvode/F2003_serial/CMakeLists.txt index 1a0458a11e..555ce99c6a 100644 --- a/examples/cvode/F2003_serial/CMakeLists.txt +++ b/examples/cvode/F2003_serial/CMakeLists.txt @@ -21,32 +21,33 @@ # 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 @@ -61,7 +62,6 @@ 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 32ca2ead64..fe37cc6da7 100644 --- a/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.f90 @@ -42,37 +42,27 @@ 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(kind=myindextype), parameter :: mx = 10, my = 5 - integer(kind=myindextype), parameter :: mxmy = mx*my - integer(kind=myindextype), parameter :: neq = mxmy + 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) + 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(kind=myindextype) :: i, j ! index variables - integer(kind=myindextype) :: mu, ml ! band preconditioner constants + 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 @@ -87,7 +77,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 +89,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 /= 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 + 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 @@ -155,8 +145,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,39 +160,39 @@ 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 ! local data - integer(kind=myindextype) :: mband, k, ioff, mu1, mu2, smu, mdim - integer(kind=myindextype) :: start - real(c_double), pointer, dimension(mdim, neq) :: Jmat(:, :) + integer(c_int) :: mband, k, ioff, mu1, mu2, smu, mdim + integer(c_int) :: start + real(c_double), pointer, dimension(mdim,neq) :: Jmat(:,:) - smu = FSUNBandMatrix_StoredUpperBandwidth(sunmat_J) + smu = int(FSUNBandMatrix_StoredUpperBandwidth(sunmat_J), c_int) 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,6 +205,7 @@ end function JacFn end module advdiff_mod ! ------------------------------------------------------------------ + program main !======= Inclusions =========== @@ -237,11 +228,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) @@ -253,67 +244,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) + 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 + 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 @@ -332,25 +323,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 *, ' ------------------------------' @@ -398,55 +389,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 3135171b42..28e82b79f7 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_int64_t), parameter :: neq = 1 + integer(c_long), parameter :: neq = 1 ! ODE parameters double precision, parameter :: lamda = -100.0d0 @@ -51,11 +51,12 @@ 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 @@ -76,7 +77,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 @@ -86,6 +87,7 @@ end function RhsFn end module ode_mod + program main !======= Inclusions =========== @@ -124,11 +126,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 @@ -136,22 +138,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 @@ -160,15 +162,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 @@ -185,20 +187,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 - end if + ! 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 - ! output current solution - print '(2x,2(es12.5,1x))', tcur, yvec(1) + ! output current solution + print '(2x,2(es12.5,1x))', tcur, yvec(1) - end do + enddo ! diagnostics output call CVodeStats(cvode_mem) @@ -211,6 +213,7 @@ program main end program main + ! ---------------------------------------------------------------- ! CVodeStats ! @@ -249,33 +252,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 541f0433e0..6efd6980ba 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_int64_t), parameter :: neq = 3 + integer(c_long), parameter :: neq = 3 ! ODE parameters double precision, parameter :: lamda = -100.0d0 @@ -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,6 +116,7 @@ end function RhsFn end module ode_mod + program main !======= Inclusions =========== @@ -143,8 +144,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 @@ -156,11 +157,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 @@ -173,36 +174,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 @@ -211,15 +212,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 @@ -229,20 +230,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 - end if + ! 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 - ! 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) - end do + enddo ! diagnostics output call CVodeStats(cvode_mem) @@ -256,6 +257,7 @@ program main end program main + ! ---------------------------------------------------------------- ! CVodeStats ! @@ -296,41 +298,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 fa55dda7d9..f2d44c4418 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_int64_t), parameter :: neq = 3 + integer(c_long), parameter :: neq = 3 ! ODE parameters double precision, parameter :: lamda = -100.0d0 @@ -71,11 +71,12 @@ 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 @@ -83,14 +84,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 +100,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)) @@ -114,6 +115,7 @@ 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 ! @@ -123,14 +125,15 @@ 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 @@ -151,10 +154,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 @@ -164,6 +167,7 @@ end function JacFn end module ode_mod + program main !======= Inclusions =========== @@ -193,8 +197,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 @@ -204,11 +208,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 @@ -221,36 +225,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 @@ -259,22 +263,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 @@ -284,20 +288,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 - end if + ! 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 - ! 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) - end do + enddo ! diagnostics output call CVodeStats(cvode_mem) @@ -311,6 +315,7 @@ program main end program main + ! ---------------------------------------------------------------- ! CVodeStats ! @@ -351,41 +356,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 33fd2ad507..4f458287a5 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_int64_t), parameter :: neq = 3 + integer(c_long), parameter :: neq = 3 ! ODE parameters double precision, parameter :: lamda = -100.0d0 @@ -71,11 +71,12 @@ 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 @@ -83,14 +84,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 +100,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)) @@ -123,14 +124,15 @@ 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 @@ -143,9 +145,9 @@ 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_int64_t), pointer :: Jidxptr(:) - integer(c_int64_t), pointer :: Jidxval(:) - real(c_double), pointer :: Jmat(:) + integer(c_long), pointer :: Jidxptr(:) + integer(c_long), pointer :: Jidxval(:) + real(c_double), pointer :: Jmat(:) !======= Internals ============ @@ -157,10 +159,11 @@ 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] @@ -173,6 +176,7 @@ end function JacFn end module ode_mod + program main !======= Inclusions =========== @@ -201,8 +205,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 @@ -214,11 +218,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 @@ -227,43 +231,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 @@ -272,22 +276,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 @@ -297,20 +301,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 - end if + ! 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 - ! 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) - end do + enddo ! diagnostics output call CVodeStats(cvode_mem) @@ -324,6 +328,7 @@ program main end program main + ! ---------------------------------------------------------------- ! CVodeStats ! @@ -364,41 +369,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 6bf52b7901..3ec4d5ab3b 100644 --- a/examples/cvode/F2003_serial/cv_brusselator_dns_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_brusselator_dns_f2003.f90 @@ -38,11 +38,11 @@ module ode_mod implicit none ! number of equations - integer(c_int64_t), parameter :: neq = 3 + integer(c_long), 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,11 +57,12 @@ 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 @@ -69,7 +70,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(:) @@ -82,9 +83,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 @@ -101,14 +102,15 @@ 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 @@ -135,9 +137,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 @@ -148,6 +150,7 @@ end function JacFn end module ode_mod + program main !======= Inclusions =========== @@ -162,7 +165,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 @@ -177,8 +180,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 @@ -188,11 +191,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 @@ -205,36 +208,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 @@ -243,22 +246,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 @@ -268,20 +271,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 - end if + ! 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 - ! 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) - end do + enddo ! diagnostics output call CVodeStats(cvode_mem) @@ -295,6 +298,7 @@ program main end program Main + ! ---------------------------------------------------------------- ! CVodeStats ! @@ -335,41 +339,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 cc543fdab2..69b4016927 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_int64_t), parameter :: mm = mx*my - integer(c_int64_t), parameter :: neq = 2*mm + 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 @@ -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,6 +205,7 @@ end function RhsFn end module diurnal_bp_mod ! ------------------------------------------------------------------ + program main !======= Inclusions =========== @@ -226,15 +227,15 @@ 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_int64_t) :: mu, ml ! band preconditioner constants + 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(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) @@ -247,86 +248,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 @@ -337,33 +338,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 *, ' -----------------------------------------------------------------------------------' @@ -420,100 +421,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 0dbd71e32c..d9267480ac 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_int64_t), parameter :: mm = mx*my - integer(c_int64_t), parameter :: neq = 2*mm + 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 @@ -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 - end if + ! 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 + 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 @@ -375,29 +375,29 @@ subroutine Prec_LU(mmm, p, ierr) implicit none integer(c_int), intent(out) :: ierr - integer(c_int64_t), intent(in) :: mmm - real(c_double), intent(inout) :: p(2, 2, mmm) + integer(c_long), intent(in) :: mmm + real(c_double), intent(inout) :: p(2,2,mmm) ! local variable - integer(c_int64_t) :: i + 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 + 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,25 +417,26 @@ 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 + 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 + + 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 @@ -446,6 +447,7 @@ end subroutine Prec_Sol end module diurnal_mod ! ------------------------------------------------------------------ + ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -472,12 +474,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) @@ -490,84 +492,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 @@ -578,33 +580,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 *, ' -----------------------------------------------------------------------------------' @@ -659,86 +661,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 5c5b5078b4..2563680cba 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_int64_t), parameter :: neq = 3 + integer(c_long), parameter :: neq = 3 contains @@ -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,14 +160,15 @@ 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 ============ @@ -176,15 +177,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 @@ -196,6 +197,7 @@ end function jacrob end module robertsDnsL_mod ! ------------------------------------------------------------------ + ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -217,10 +219,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 @@ -246,14 +248,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 @@ -268,92 +270,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) - - 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 + do while(iout < nout) - 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' + 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 - 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 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 + 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 *, "------------------------------------------------------" @@ -375,6 +377,7 @@ program main end program main ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -399,8 +402,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" @@ -410,6 +413,7 @@ subroutine PrintHeader(rtol, avtol, y) end subroutine PrintHeader ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -433,6 +437,7 @@ subroutine PrintOutput(cvode_mem, t, y) end subroutine PrintOutput ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -464,62 +469,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 6f9c6e7576..3e6a9901ad 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_int64_t), parameter :: neq = 3 + integer(c_long), parameter :: neq = 3 contains @@ -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,14 +164,15 @@ 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 ============ @@ -180,15 +181,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 @@ -200,6 +201,7 @@ end function jacrob end module RobertsDnsConstr_mod ! ------------------------------------------------------------------ + ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -221,11 +223,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 @@ -254,20 +256,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 @@ -282,98 +284,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) - - 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) + do while(iout < nout) - if (retval == CV_ROOT_RETURN) then - retvalr = FCVodeGetRootInfo(cvode_mem, rootsfound) - if (retvalr < 0) then - print *, 'Error in FCVodeGetRootInfo, retval = ', retval, '; halting' + 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 - 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 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 + 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 *, "---------------------------------------------------" @@ -396,6 +398,7 @@ program main end program main ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -420,9 +423,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" @@ -432,6 +435,7 @@ subroutine PrintHeader(rtol, avtol, y, c) end subroutine PrintHeader ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -456,6 +460,7 @@ subroutine PrintOutput(cvode_mem, t, y) end subroutine PrintOutput ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -487,62 +492,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 5cbe7aaddd..751a2f2807 100644 --- a/examples/cvode/F2003_serial/cv_roberts_dns_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_roberts_dns_f2003.f90 @@ -44,8 +44,8 @@ module robertsDns_mod !======= Declarations ========= implicit none - integer(c_int), parameter :: nout = 12 - integer(c_int64_t), parameter :: neq = 3 + integer(c_int), parameter :: nout = 12 + integer(c_long), 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,14 +160,15 @@ 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 ============ @@ -176,15 +177,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 @@ -196,6 +197,7 @@ end function jacrob end module robertsDns_mod ! ------------------------------------------------------------------ + program main !======= Inclusions =========== @@ -214,11 +216,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 @@ -243,14 +245,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 @@ -265,92 +267,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) - - 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) + do while(iout < nout) - if (retval == CV_ROOT_RETURN) then - retvalr = FCVodeGetRootInfo(cvode_mem, rootsfound) - if (retvalr < 0) then - print *, 'Error in FCVodeGetRootInfo, retval = ', retval, '; halting' + 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 - 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 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 + 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 *, "---------------------------------------------------" @@ -372,6 +374,7 @@ program main end program main ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -396,8 +399,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 *, "---------------------------------------------------" @@ -408,6 +411,7 @@ subroutine PrintHeader(rtol, avtol, y) end subroutine PrintHeader ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -431,6 +435,7 @@ subroutine PrintOutput(cvode_mem, t, y) end subroutine PrintOutput ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -462,62 +467,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 5e108501bd..eef7aeab8e 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_int64_t), parameter :: neq = 3 - integer(c_int64_t), parameter :: nnz = neq*neq + integer(c_long), parameter :: neq = 3 + integer(c_long), 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 @@ -164,14 +164,14 @@ 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_int64_t), pointer, dimension(nnz) :: Jrvals(:) - integer(c_int64_t), pointer, dimension(neq + 1) :: Jcptrs(:) + 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) + Jcptrs(1:neq+1) => FSUNSparseMatrix_IndexPointers(sunmat_J) Jrvals(1:nnz) => FSUNSparseMatrix_IndexValues(sunmat_J) Jdata(1:nnz) => FSUNSparseMatrix_Data(sunmat_J) @@ -191,6 +191,7 @@ 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 @@ -200,6 +201,7 @@ 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 @@ -219,6 +221,7 @@ end function jacrob end module roberts_klu_mod ! ------------------------------------------------------------------ + program main !======= Inclusions =========== @@ -236,10 +239,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 @@ -267,20 +270,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 @@ -295,116 +298,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) - - 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 + do while(iout < nout) - 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' + 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 - 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 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 + 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 *, "---------------------------------------------------" @@ -426,6 +429,7 @@ program main end program main ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -450,8 +454,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 *, "---------------------------------------------------" @@ -462,6 +466,7 @@ subroutine PrintHeader(rtol, avtol, y) end subroutine PrintHeader ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -485,6 +490,7 @@ subroutine PrintOutput(cvode_mem, t, y) end subroutine PrintOutput ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -516,62 +522,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/ginkgo/CMakeLists.txt b/examples/cvode/ginkgo/CMakeLists.txt index 5d1e706371..a66f49fdf9 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 SYCL) + BACKENDS REF OMP CUDA HIP DPCPP) # 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 "SYCL") + if(SUNDIALS_GINKGO_BACKENDS MATCHES "DPCPP") list(APPEND vectors nvecsycl) endif() if((SUNDIALS_GINKGO_BACKENDS MATCHES "OMP") OR diff --git a/examples/cvode/ginkgo/cv_heat2D_ginkgo.SYCL.out b/examples/cvode/ginkgo/cv_heat2D_ginkgo.DPCPP.out similarity index 100% rename from examples/cvode/ginkgo/cv_heat2D_ginkgo.SYCL.out rename to examples/cvode/ginkgo/cv_heat2D_ginkgo.DPCPP.out diff --git a/examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp b/examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp index eaa7627e09..3cda52748b 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_SYCL) +#elif defined(USE_DPCPP) #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_SYCL) +#elif defined(USE_DPCPP) 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_SYCL) +#if defined(USE_DPCPP) 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_SYCL) +#elif defined(USE_DPCPP) // 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_SYCL) +#elif defined(USE_DPCPP) 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 75bc3ba8c9..f64ec2c1b7 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_SYCL) +#elif defined(USE_DPCPP) #include <nvector/nvector_sycl.h> #endif @@ -124,7 +124,7 @@ __global__ void solution_kernel(const sunindextype nx, const sunindextype ny, #endif // Compute the exact solution -static int Solution(sunrealtype t, N_Vector u, UserData& udata) +int Solution(sunrealtype t, N_Vector u, UserData& udata) { // Access problem data and set shortcuts const auto nx = udata.nx; @@ -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_SYCL) +#elif defined(USE_DPCPP) sunrealtype* uarray = N_VGetDeviceArrayPointer(u); if (check_ptr(uarray, "N_VGetDeviceArrayPointer")) return -1; std::dynamic_pointer_cast<const gko::DpcppExecutor>(udata.exec) @@ -206,7 +206,7 @@ static int Solution(sunrealtype t, N_Vector u, UserData& udata) } // Compute the solution error -static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) +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 @@ static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) } // Print command line options -static void InputHelp() +void InputHelp() { std::cout << std::endl << "Command line options:\n" @@ -243,7 +243,7 @@ static void InputHelp() } // Read command line inputs -static int ReadInputs(std::vector<std::string>& args, UserData& udata) +int ReadInputs(std::vector<std::string>& args, UserData& udata) { if (find(args.begin(), args.end(), "--help") != args.end()) { @@ -276,7 +276,7 @@ static int ReadInputs(std::vector<std::string>& args, UserData& udata) } // Print user data -static void PrintUserData(UserData& udata) +void PrintUserData(UserData& udata) { std::cout << std::endl << "2D Heat problem:\n" @@ -303,7 +303,7 @@ static void PrintUserData(UserData& udata) } // Initialize output -static int OpenOutput(UserData& udata) +int OpenOutput(UserData& udata) { // Header for status output std::cout << std::scientific @@ -340,7 +340,7 @@ static int OpenOutput(UserData& udata) } // Write output -static int WriteOutput(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) +int WriteOutput(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) { // Compute the error int flag = SolutionError(t, u, e, udata); @@ -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_SYCL) +#elif defined(USE_DPCPP) N_VCopyFromDevice_Sycl(u); N_VCopyFromDevice_Sycl(e); #endif @@ -398,7 +398,7 @@ static int WriteOutput(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) } // Finalize output -static int CloseOutput(UserData& udata) +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 6186d73f95..557b544885 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 -static void InputHelp() +void InputHelp() { std::cout << std::endl; std::cout << "Command line options:" << std::endl; @@ -94,7 +94,7 @@ static void InputHelp() std::cout << " --nout : number of outputs\n"; } -static int ReadInputs(std::vector<std::string>& args, Options& opts) +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 3e9d0b6acb..f2a72da5c3 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 %ld time %g norm %g\n", step, + ierr = PetscPrintf(PETSC_COMM_WORLD, "timestep %D time %g norm %g\n", step, (double)ptime, (double)norm); CHKERRQ(ierr); PetscFunctionReturn(0); diff --git a/examples/cvodes/F2003_serial/CMakeLists.txt b/examples/cvodes/F2003_serial/CMakeLists.txt index 5e5bac8953..517d64133c 100644 --- a/examples/cvodes/F2003_serial/CMakeLists.txt +++ b/examples/cvodes/F2003_serial/CMakeLists.txt @@ -16,10 +16,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(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) @@ -37,9 +40,6 @@ 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/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 b/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 index e42e33e0b8..8f47e8a72b 100644 --- a/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 +++ b/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 @@ -56,36 +56,26 @@ 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 ! 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 - integer(kind=myindextype), parameter :: NEQ = MX + 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(c_long), parameter :: MX = 10 + integer(c_long), 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 @@ -100,7 +90,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 @@ -113,7 +103,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(:) @@ -133,28 +123,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 - end if + endif if (i /= NEQ) then - urt = u(i + 1) + urt = u(i+1) else urt = ZERO - end if + endif ! 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 @@ -179,7 +169,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 @@ -203,15 +193,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) :: is - real(c_double) :: pbar(0:NS - 1) + real(c_double) :: pbar(0:NS-1) + integer(c_int) :: plist(0:NS-1) ! Command line arguments integer(c_int) :: sensi, err_con @@ -223,21 +213,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 - end if + endif call SetIC(u) ! Set integration tolerances @@ -247,9 +237,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 - end if + endif ! Initialize CVode retval = FCVodeInit(cvodes_mem, c_funloc(RhsFn), T0, u) @@ -262,37 +252,37 @@ 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 - end if + endif ! 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 - plist(is) = int(is, 4) - pbar(is) = p(plist(is)) + do is=0, NS-1 + plist(is) = 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 - end if + endif - do is = 0, NS - 1 + do is=0, NS-1 uiS => FN_VGetVecAtIndexVectorArray(uS, is) call FN_VConst(ZERO, uiS) end do - retval = FCVodeSensInit1(cvodes_mem, int(NS, 4), sensi_meth, c_null_funptr, uS) + retval = FCVodeSensInit1(cvodes_mem, NS, sensi_meth, c_null_funptr, uS) call check_retval(retval, "FCVodeSensInit1") retval = FCVodeSensEEtolerances(cvodes_mem) @@ -309,17 +299,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) - end if + endif if (.not. associated(NLSsens)) then - write (*, *) 'ERROR: FSUNNonlinSol_FixedPointSens returned NULL' + write(*,*) 'ERROR: FSUNNonlinSol_FixedPointSens returned NULL' stop 1 - end if + endif ! attach nonlinear solver object to CVode if (sensi_meth == CV_SIMULTANEOUS) then @@ -328,40 +318,40 @@ program main retval = FCVodeSetNonlinearSolverSensStg(cvodes_mem, NLSsens) else retval = FCVodeSetNonlinearSolverSensStg1(cvodes_mem, NLSsens) - end if + endif 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 +" - end if - end if + write(*,'(A)',advance="no") "( STAGGERED1 +" + endif + endif 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 )" - end if + write(*,'(A)',advance="no") " PARTIAL ERROR CONTROL )" + endif else - write (*, '(A)') "Sensitivity: NO " + write(*,'(A)') "Sensitivity: NO " - end if + endif ! 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 @@ -374,9 +364,9 @@ program main retval = FCVodeGetSens(cvodes_mem, t, uS) call check_retval(retval, "FCVodeGetSens") call PrintOutputS(uS) - end if + endif - write (*, *) "------------------------------------------------------------" + write(*,*) "------------------------------------------------------------" tout = tout + DTOUT end do @@ -388,13 +378,13 @@ program main call FN_VDestroy(u) if (sensi /= 0) then call FN_VDestroyVectorArray(uS, NS) - end if + endif call FCVodeFree(cvodes_mem) retval = FSUNNonlinSolFree(NLS) if (associated(NLSsens)) then retval = FSUNNonlinSolFree(NLSsens) - end if + endif retval = FSUNContext_Free(ctx) @@ -410,14 +400,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() - end if + endif call get_command_argument(1, arg) if (arg == "-nosensi") then @@ -426,13 +416,13 @@ subroutine ProcessArgs(sensi, sensi_meth, err_con) sensi = 1 else call WrongArgs() - end if + endif if (sensi /= 0) then if (argc /= 3) then call WrongArgs() - end if + endif call get_command_argument(2, arg) if (arg == "sim") then @@ -443,7 +433,7 @@ subroutine ProcessArgs(sensi, sensi_meth, err_con) sensi_meth = CV_STAGGERED1 else call WrongArgs() - end if + endif call get_command_argument(3, arg) if (arg == "t") then @@ -452,18 +442,18 @@ subroutine ProcessArgs(sensi, sensi_meth, err_con) err_con = 0 else call WrongArgs() - end if + endif - end if + endif 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 @@ -491,10 +481,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 @@ -511,10 +501,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 @@ -549,32 +539,32 @@ subroutine PrintFinalStats(cvodes_mem, sensi, err_con, sensi_meth) retval = FCVodeGetSensNumErrTestFails(cvodes_mem, netfS) else netfS = 0 - end if + endif 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 - end if + endif - end if + endif - 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 - end if + 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 end subroutine @@ -585,7 +575,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 3087baab20..705d111a5b 100644 --- a/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.f90 +++ b/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.f90 @@ -33,18 +33,8 @@ 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(kind=myindextype), parameter :: neq = 1 + integer(c_long), parameter :: neq = 1 ! ODE parameters double precision, parameter :: lamda = -100.0d0 @@ -61,7 +51,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 @@ -86,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 @@ -96,6 +86,7 @@ end function RhsFn end module ode_mod + program main !======= Inclusions =========== @@ -134,11 +125,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 @@ -146,22 +137,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 @@ -170,15 +161,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 @@ -195,20 +186,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 - end if + ! 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 - ! output current solution - print '(2x,2(es12.5,1x))', tcur, yvec(1) + ! output current solution + print '(2x,2(es12.5,1x))', tcur, yvec(1) - end do + enddo ! diagnostics output call CVodeStats(cvodes_mem) @@ -221,6 +212,7 @@ program main end program main + ! ---------------------------------------------------------------- ! CVodeStats ! @@ -259,33 +251,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/CMakeLists.txt b/examples/ida/F2003_openmp/CMakeLists.txt index 63fb888572..215563c7a4 100644 --- a/examples/ida/F2003_openmp/CMakeLists.txt +++ b/examples/ida/F2003_openmp/CMakeLists.txt @@ -18,13 +18,11 @@ # 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" - ) -endif() +# 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) diff --git a/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003.f90 b/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003.f90 index 3dc08bc7e9..790b62326c 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_long), 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,22 +78,22 @@ 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 + integer(c_long) :: i, j !======= 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,6 +219,7 @@ end function PSolveHeat end module idaHeat2DKryOMP_mod ! ------------------------------------------------------------------ + program main !======= Inclusions =========== @@ -237,11 +238,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 @@ -249,7 +250,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) @@ -257,40 +258,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 - end if + nthreads = 6 + endif 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 @@ -300,64 +301,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 @@ -381,33 +382,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 *, " " @@ -427,14 +428,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 @@ -450,34 +451,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 *, " " @@ -497,6 +498,7 @@ program main end program main ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! SetInitialProfile: routine to initialize u and up vectors. ! ---------------------------------------------------------------- @@ -515,12 +517,12 @@ 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 + integer(c_long) :: i, j real(c_double) :: xfact, yfact integer(c_int) :: retval @@ -529,18 +531,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 @@ -548,7 +550,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 @@ -556,15 +558,16 @@ 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) ! ---------------------------------------------------------------- @@ -587,11 +590,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." @@ -599,6 +602,7 @@ subroutine PrintHeader(rtol, atol) end subroutine PrintHeader ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -614,7 +618,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) @@ -627,66 +631,67 @@ 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/CMakeLists.txt b/examples/ida/F2003_parallel/CMakeLists.txt index af50a152e3..908a89cc9b 100644 --- a/examples/ida/F2003_parallel/CMakeLists.txt +++ b/examples/ida/F2003_parallel/CMakeLists.txt @@ -17,11 +17,12 @@ # 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") +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 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 de8b11e835..b3ee8dbff4 100644 --- a/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 +++ b/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 @@ -54,7 +54,8 @@ module Heat2DKryBBD_mod !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fsundials_core_mod + + use fsundials_nvector_mod !======= Declarations ========= implicit none @@ -76,13 +77,13 @@ module Heat2DKryBBD_mod integer :: je integer :: nxl ! local number of x grid points integer :: nyl ! local number of y grid points - integer(c_int64_t) :: N, Ntot + 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 + 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 @@ -93,7 +94,7 @@ module Heat2DKryBBD_mod real(c_double), dimension(:), allocatable :: Ssend ! Problem parameters - integer(c_int64_t) :: mudq, mldq, mu, ml + 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 @@ -136,17 +137,18 @@ 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 ! -------------------------------------------------------------- @@ -163,61 +165,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 @@ -231,21 +233,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 @@ -254,53 +256,50 @@ 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 + type(c_ptr), value :: 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 - 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 @@ -313,74 +312,74 @@ subroutine getStats(ida_mem, retval, ierr) !======= Inclusions =========== use, intrinsic :: iso_c_binding use fida_mod - use fsundials_core_mod + use fsundials_futils_mod !======= Declarations ========= 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 @@ -390,11 +389,11 @@ 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 - use fsundials_core_mod + use fsundials_nvector_mod !======= Declarations ========= implicit none @@ -404,21 +403,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 @@ -426,203 +425,204 @@ 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 - use fsundials_core_mod + use fsundials_nvector_mod !======= Declarations ========= implicit none ! calling variables - integer(c_int64_t), value :: Nloc - real(c_double), value :: t ! current time + 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 + 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 @@ -630,31 +630,32 @@ 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 - use fsundials_core_mod + use fsundials_nvector_mod !======= Declarations ========= implicit none ! calling variables - integer(c_int64_t), value :: Nloc - real(c_double), value :: t ! current time + 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 + 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 @@ -663,9 +664,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 @@ -676,45 +677,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) + 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 - 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 + res(i,j) = ydot(i,j) - res(i,j) + end do end do ierr = 0 ! Return with success @@ -725,6 +726,7 @@ end function LocalFn end module Heat2DKryBBD_mod ! ------------------------------------------------------------------ + ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -732,10 +734,16 @@ program driver ! inclusions use, intrinsic :: iso_c_binding - use fsundials_core_mod + 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 ========= @@ -759,27 +767,28 @@ 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 + 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(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), tout, ymax + real(c_double) :: t(1), dTout, tout, ymax integer :: i, j, ioutput - character(100) :: outname + character*100 :: outname ! 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 @@ -788,75 +797,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 @@ -865,159 +874,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 + 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 - ! 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) + ! 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 - end do - write (101, *) " " + 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 + end do + if (outproc) then + write(6,*) " ------------------------------------------------------------------------------------" + end if + close(101) - retval = FIDAGetNumNonlinSolvConvFails(ida_mem, nncf) - if (retval /= 0) then - print *, "Error: FIDAInit 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 = FIDAGetNumLinConvFails(ida_mem, nlcf) - 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 - ! 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_parallel/ida_heat2D_kry_bbd_f2003.out b/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.out deleted file mode 100644 index 393585907b..0000000000 --- a/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.out +++ /dev/null @@ -1,68 +0,0 @@ - - 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 107b423e41..637c5c2139 100644 --- a/examples/ida/F2003_serial/CMakeLists.txt +++ b/examples/ida/F2003_serial/CMakeLists.txt @@ -19,15 +19,9 @@ # 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/idaHeat2D_kry_f2003.f90 b/examples/ida/F2003_serial/idaHeat2D_kry_f2003.f90 index 80fd7fdc00..22c7d2d691 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_long), 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,31 +76,31 @@ 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 + integer(c_long) :: i, j !======= 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,11 +164,12 @@ 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 @@ -181,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 ============ @@ -194,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 @@ -205,6 +206,7 @@ end function PSolveHeat end module dae_mod ! ------------------------------------------------------------------ + program main !======= Inclusions =========== @@ -224,48 +226,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 @@ -275,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 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 @@ -356,33 +358,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 *, " " @@ -402,14 +404,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 @@ -425,34 +427,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 *, " " @@ -471,6 +473,7 @@ program main end program main + ! ---------------------------------------------------------------- ! SetInitialProfile: routine to initialize u and up vectors. ! ---------------------------------------------------------------- @@ -490,12 +493,12 @@ 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 + integer(c_long) :: i, j real(c_double) :: xfact, yfact integer(c_int) :: retval @@ -504,37 +507,38 @@ 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) ! ---------------------------------------------------------------- @@ -557,15 +561,16 @@ 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 ! ---------------------------------------------------------------- @@ -581,7 +586,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) @@ -594,65 +599,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,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 96b0122858..c424d7acd3 100644 --- a/examples/ida/F2003_serial/idaRoberts_dns_f2003.f90 +++ b/examples/ida/F2003_serial/idaRoberts_dns_f2003.f90 @@ -40,18 +40,8 @@ module dae_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 - - integer(kind=myindextype), parameter :: neq = 3 - integer(kind=myindextype), parameter :: nout = 12 + integer(c_long), parameter :: neq = 3 + integer(c_long), parameter :: nout = 12 contains @@ -64,7 +54,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 +69,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 +79,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 +104,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 +119,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 +148,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,14 +166,15 @@ 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 ============ @@ -192,15 +183,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 @@ -232,16 +223,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 >= 1.d0) then - passfail = 1 - print *, " " - print *, "SUNDIALS_WARNING: check_ans error=", err - print *, " " + if (err .ge. 1.d0) then + passfail = 1 + print *, " " + print *, "SUNDIALS_WARNING: check_ans error=", err + print *, " " end if return @@ -251,6 +242,7 @@ end function check_ans end module dae_mod ! ------------------------------------------------------------------ + program main !======= Inclusions =========== @@ -270,11 +262,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 @@ -304,20 +296,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 @@ -329,57 +321,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 @@ -388,15 +380,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. @@ -406,29 +398,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 - end if + 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 - call PrintOutput(ida_mem, tret(1), yval) + call PrintOutput(ida_mem, tret(1), yval) - 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_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_SUCCESS) then - iout = iout + 1 - tout = tout*10.d0 - end if + if (retval .eq. IDA_SUCCESS) then + iout = iout+1 + tout = tout*10.d0 + end if - if (iout == NOUT) exit + if (iout .eq. NOUT) exit end do @@ -448,6 +440,7 @@ program main end program main + ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -472,8 +465,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 *, "-----------------------------------------------------------------------" @@ -483,6 +476,7 @@ subroutine PrintHeader(rtol, avtol, y) return end subroutine PrintHeader + ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -509,27 +503,28 @@ 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 ! @@ -552,56 +547,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/ida/trilinos/idaHeat2D_kry_tpetra.cpp b/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp index d3f5cbf27b..2b67775408 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; + sunindextype mm, mm1, i, j; 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 (sunindextype j = 0; j < mm; j++) + for (j = 0; j < mm; j++) { yfact = data->dx * j; - for (sunindextype i = 0; i < mm; i++) + for (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/idas/F2003_serial/CMakeLists.txt b/examples/idas/F2003_serial/CMakeLists.txt index d66b309729..6d409c2857 100644 --- a/examples/idas/F2003_serial/CMakeLists.txt +++ b/examples/idas/F2003_serial/CMakeLists.txt @@ -16,17 +16,13 @@ # 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 7f2d4b80d4..c0e64c78e1 100644 --- a/examples/idas/F2003_serial/idasAkzoNob_ASAi_dns_f2003.f90 +++ b/examples/idas/F2003_serial/idasAkzoNob_ASAi_dns_f2003.f90 @@ -33,36 +33,26 @@ 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(kind=myindextype), parameter :: NEQ = 6 + integer(c_long), 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 @@ -71,7 +61,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 @@ -87,8 +77,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) @@ -104,12 +94,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 @@ -123,7 +113,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 @@ -137,7 +127,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 @@ -145,7 +135,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 @@ -161,7 +151,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) @@ -190,27 +180,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 @@ -227,19 +217,20 @@ 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 @@ -259,11 +250,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'. @@ -273,23 +264,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) @@ -300,40 +291,40 @@ 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) ! Create and initialize q0 for quadratures. - nv_q => FN_VNew_Serial(1_myindextype, sunctx) + nv_q => FN_VNew_Serial(1_8, 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 @@ -347,14 +338,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 @@ -378,34 +369,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) @@ -417,20 +408,20 @@ program main retval = FIDASStolerancesB(mem, indexB(1), RTOLB, ATOLB) call check_retval(retval, "FIDASStolerancesB") - retval = FIDASetMaxNumStepsB(mem, indexB(1), 1000_c_long) + retval = FIDASetMaxNumStepsB(mem, indexB(1), 1000_8) call check_retval(retval, "FIDASetMaxNumStepsB") ! 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 @@ -439,12 +430,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 @@ -472,7 +463,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 4a5f9ea763..2c06761340 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_long), 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,31 +76,31 @@ 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 + integer(c_long) :: i, j !======= 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,11 +165,12 @@ 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 +183,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 +196,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,6 +207,7 @@ end function PSolveHeat end module dae_mod ! ------------------------------------------------------------------ + program main use, intrinsic :: iso_c_binding use fsundials_core_mod @@ -221,22 +223,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) @@ -248,26 +250,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 @@ -277,64 +279,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 @@ -358,33 +360,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 *, " " @@ -404,14 +406,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 @@ -427,34 +429,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 *, " " @@ -473,6 +475,7 @@ program main end program main + ! ---------------------------------------------------------------- ! SetInitialProfile: routine to initialize u and up vectors. ! ---------------------------------------------------------------- @@ -492,12 +495,12 @@ 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 + integer(c_long) :: i, j real(c_double) :: xfact, yfact integer(c_int) :: retval @@ -506,17 +509,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 @@ -529,14 +532,15 @@ 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) ! ---------------------------------------------------------------- @@ -559,15 +563,16 @@ 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 ! ---------------------------------------------------------------- @@ -583,7 +588,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) @@ -596,65 +601,66 @@ 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/CMakeLists.txt b/examples/kinsol/CMakeLists.txt index 67657f9399..c41e93d845 100644 --- a/examples/kinsol/CMakeLists.txt +++ b/examples/kinsol/CMakeLists.txt @@ -47,7 +47,5 @@ endif() # Fortran examples if(BUILD_FORTRAN_MODULE_INTERFACE AND EXAMPLES_ENABLE_F2003) add_subdirectory(F2003_serial) - if(ENABLE_MPI) - add_subdirectory(F2003_parallel) - endif() + add_subdirectory(F2003_parallel) endif() diff --git a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp index 35de74bfff..cdd0c6b72c 100644 --- a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp +++ b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp @@ -236,68 +236,62 @@ static int check_retval(void* flagvalue, const string funcname, int opt); // ----------------------------------------------------------------------------- // c(u) = u -static sunrealtype c1(sunrealtype u_val) { return u_val; } +sunrealtype c1(sunrealtype u_val) { return u_val; } // c(u) = u^3 - u -static sunrealtype c2(sunrealtype u_val) -{ - return u_val * u_val * u_val - u_val; -} +sunrealtype c2(sunrealtype u_val) { return u_val * u_val * u_val - u_val; } // c(u) = u - u^2 -static sunrealtype c3(sunrealtype u_val) { return u_val - u_val * u_val; } +sunrealtype c3(sunrealtype u_val) { return u_val - u_val * u_val; } // c(u) = e^u -static sunrealtype c4(sunrealtype u_val) { return exp(u_val); } +sunrealtype c4(sunrealtype u_val) { return exp(u_val); } // c(u) = u^4 -static sunrealtype c5(sunrealtype u_val) -{ - return u_val * u_val * u_val * u_val; -} +sunrealtype c5(sunrealtype u_val) { return u_val * u_val * u_val * u_val; } // c(u) = cos^2(u) - sin^2(u) -static sunrealtype c6(sunrealtype u_val) +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 -static sunrealtype c7(sunrealtype u_val) +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)} -static sunrealtype c8(sunrealtype u_val) +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)) -static sunrealtype c9(sunrealtype u_val) +sunrealtype c9(sunrealtype u_val) { sunrealtype cos2u = cos(u_val) * cos(u_val); return exp(cos2u); } // c(u) = 10(u - u^2) -static sunrealtype c10(sunrealtype u_val) +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 -static sunrealtype c11(sunrealtype u_val) +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) -static sunrealtype c12(sunrealtype u_val) +sunrealtype c12(sunrealtype u_val) { sunrealtype temp = sqrt(5); sunrealtype u2 = u_val * u_val; @@ -305,7 +299,7 @@ static sunrealtype c12(sunrealtype u_val) } // c(u) = (u - e^u)^2 + (u + u * sin(u) - cos(u))^2 -static sunrealtype c13(sunrealtype u_val) +sunrealtype c13(sunrealtype u_val) { sunrealtype eu = u_val - exp(u_val); sunrealtype usin = u_val * sin(u_val); @@ -314,7 +308,7 @@ static sunrealtype c13(sunrealtype u_val) } // c(u) = u + ue^u + ue^{-u} -static sunrealtype c14(sunrealtype u_val) +sunrealtype c14(sunrealtype u_val) { sunrealtype ueu = u_val * exp(u_val); sunrealtype ue_u = u_val * exp(-u_val); @@ -322,7 +316,7 @@ static sunrealtype c14(sunrealtype u_val) } // c(u) = u + ue^u + ue^{-u} + (u - e^u)^2 -static sunrealtype c15(sunrealtype u_val) +sunrealtype c15(sunrealtype u_val) { sunrealtype ueu = u_val * exp(u_val); sunrealtype ue_u = u_val * exp(-u_val); @@ -331,7 +325,7 @@ static sunrealtype c15(sunrealtype u_val) } // c(u) = u + ue^u + ue^{-u} + (u - e^u)^2 + (u + usin(u) - cos(u))^2 -static sunrealtype c16(sunrealtype u_val) +sunrealtype c16(sunrealtype u_val) { sunrealtype ueu = u_val * exp(u_val); sunrealtype ue_u = u_val * exp(-u_val); @@ -341,7 +335,7 @@ static sunrealtype c16(sunrealtype u_val) } // c(u) = u + ue^{-u} + e^u*(u + sin(u) - cos(u))^3 -static sunrealtype c17(sunrealtype u_val) +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 05d6f6d09c..f14c6871c5 100644 --- a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp +++ b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp @@ -293,68 +293,62 @@ static int check_retval(void* flagvalue, const string funcname, int opt); // ----------------------------------------------------------------------------- // c(u) = u -static sunrealtype c1(sunrealtype u_val) { return u_val; } +sunrealtype c1(sunrealtype u_val) { return u_val; } // c(u) = u^3 - u -static sunrealtype c2(sunrealtype u_val) -{ - return u_val * u_val * u_val - u_val; -} +sunrealtype c2(sunrealtype u_val) { return u_val * u_val * u_val - u_val; } // c(u) = u - u^2 -static sunrealtype c3(sunrealtype u_val) { return u_val - u_val * u_val; } +sunrealtype c3(sunrealtype u_val) { return u_val - u_val * u_val; } // c(u) = e^u -static sunrealtype c4(sunrealtype u_val) { return exp(u_val); } +sunrealtype c4(sunrealtype u_val) { return exp(u_val); } // c(u) = u^4 -static sunrealtype c5(sunrealtype u_val) -{ - return u_val * u_val * u_val * u_val; -} +sunrealtype c5(sunrealtype u_val) { return u_val * u_val * u_val * u_val; } // c(u) = cos^2(u) - sin^2(u) -static sunrealtype c6(sunrealtype u_val) +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 -static sunrealtype c7(sunrealtype u_val) +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)} -static sunrealtype c8(sunrealtype u_val) +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)) -static sunrealtype c9(sunrealtype u_val) +sunrealtype c9(sunrealtype u_val) { sunrealtype cos2u = cos(u_val) * cos(u_val); return exp(cos2u); } // c(u) = 10(u - u^2) -static sunrealtype c10(sunrealtype u_val) +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 -static sunrealtype c11(sunrealtype u_val) +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) -static sunrealtype c12(sunrealtype u_val) +sunrealtype c12(sunrealtype u_val) { sunrealtype temp = sqrt(5); sunrealtype u2 = u_val * u_val; @@ -362,7 +356,7 @@ static sunrealtype c12(sunrealtype u_val) } // c(u) = (u - e^u)^2 + (u + u * sin(u) - cos(u))^2 -static sunrealtype c13(sunrealtype u_val) +sunrealtype c13(sunrealtype u_val) { sunrealtype eu = u_val - exp(u_val); sunrealtype usin = u_val * sin(u_val); @@ -371,7 +365,7 @@ static sunrealtype c13(sunrealtype u_val) } // c(u) = u + ue^u + ue^{-u} -static sunrealtype c14(sunrealtype u_val) +sunrealtype c14(sunrealtype u_val) { sunrealtype ueu = u_val * exp(u_val); sunrealtype ue_u = u_val * exp(-u_val); @@ -379,7 +373,7 @@ static sunrealtype c14(sunrealtype u_val) } // c(u) = u + ue^u + ue^{-u} + (u - e^u)^2 -static sunrealtype c15(sunrealtype u_val) +sunrealtype c15(sunrealtype u_val) { sunrealtype ueu = u_val * exp(u_val); sunrealtype ue_u = u_val * exp(-u_val); @@ -388,7 +382,7 @@ static sunrealtype c15(sunrealtype u_val) } // c(u) = u + ue^u + ue^{-u} + (u - e^u)^2 + (u + usin(u) - cos(u))^2 -static sunrealtype c16(sunrealtype u_val) +sunrealtype c16(sunrealtype u_val) { sunrealtype ueu = u_val * exp(u_val); sunrealtype ue_u = u_val * exp(-u_val); @@ -398,7 +392,7 @@ static sunrealtype c16(sunrealtype u_val) } // c(u) = u + ue^{-u} + e^u*(u + sin(u) - cos(u))^3 -static sunrealtype c17(sunrealtype u_val) +sunrealtype c17(sunrealtype u_val) { sunrealtype ue_u = u_val * exp(-u_val); sunrealtype eu = exp(u_val); diff --git a/examples/kinsol/F2003_parallel/CMakeLists.txt b/examples/kinsol/F2003_parallel/CMakeLists.txt index d6ea17cb03..8ba5706a32 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(SUNDIALS_INDEX_SIZE MATCHES "64") +if(MPI_ENABLED) 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 9233fe7b4c..dcc6b09bbb 100644 --- a/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 +++ b/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 @@ -36,18 +36,18 @@ module kinDiagonKry_mod ! With MPI-3 use mpi_f08 is preferred include "mpif.h" - integer(c_int64_t), parameter :: neq = 128 + integer(c_long), parameter :: neq = 128 integer(c_int) :: ierr, retval, nprint - integer(c_int64_t) :: i, nlocal + 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_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 @@ -62,7 +62,7 @@ module kinDiagonKry_mod subroutine init(sunvec_u, sunvec_s, sunvec_c) !======= Inclusions =========== - use fsundials_core_mod + use fsundials_nvector_mod !======= Declarations ========= implicit none @@ -73,18 +73,18 @@ subroutine init(sunvec_u, sunvec_s, sunvec_c) type(N_Vector) :: sunvec_c ! constraint N_Vector ! local variables - integer(c_int64_t) :: ii + integer(c_long) :: 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,10 +101,10 @@ 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 + use fsundials_nvector_mod !======= Declarations ========= implicit none @@ -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_int64_t) :: ii + integer(c_long) :: ii !======= Internals ============ @@ -127,14 +127,15 @@ 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 @@ -151,10 +152,10 @@ 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 + use fsundials_nvector_mod !======= Declarations ========= implicit none @@ -175,12 +176,13 @@ 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 @@ -197,10 +199,10 @@ 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 + use fsundials_nvector_mod !======= Declarations ========= implicit none @@ -221,12 +223,13 @@ 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 @@ -237,29 +240,33 @@ end function kpsolve end module kinDiagonKry_mod ! ------------------------------------------------------------------ + ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ program main !======= Inclusions =========== - use fsundials_core_mod + 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 + 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(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 @@ -276,22 +283,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) @@ -299,27 +306,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) @@ -332,16 +339,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 ! ------------------------- @@ -349,27 +356,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 ! ------------------------- @@ -377,8 +384,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 ! ------------------------- @@ -388,8 +395,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 ! ------------------------- @@ -397,8 +404,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 ! ------------------------- @@ -406,8 +413,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 ! ------------------------- @@ -421,21 +428,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) @@ -453,6 +460,7 @@ program main end program main ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintOutput: prints solution at selected points ! ---------------------------------------------------------------- @@ -466,13 +474,13 @@ subroutine PrintOutput(uu) ! calling variable real(c_double), dimension(neq) :: uu - integer(c_int64_t) :: ii + 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) + 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 @@ -480,6 +488,7 @@ subroutine PrintOutput(uu) end subroutine PrintOutput ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -495,7 +504,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) @@ -506,47 +515,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_parallel/kin_diagon_kry_f2003.out b/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.out deleted file mode 100644 index 0eb25a14dc..0000000000 --- a/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.out +++ /dev/null @@ -1,48 +0,0 @@ - - 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 1bca9e8dd3..8908285b85 100644 --- a/examples/kinsol/F2003_serial/CMakeLists.txt +++ b/examples/kinsol/F2003_serial/CMakeLists.txt @@ -16,16 +16,14 @@ # 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" - ) -endif() +# 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" + ) # 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 43eab280d1..83cdef8caa 100644 --- a/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 @@ -34,28 +34,18 @@ module kinDiagonKry_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 - - integer(kind=myindextype), parameter :: neq = 128 + integer(c_long), parameter :: neq = 128 integer(c_int) :: ierr, retval - integer(c_int64_t) :: i + 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_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 +62,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 +87,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,12 +107,13 @@ 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 @@ -139,7 +130,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 @@ -160,12 +151,13 @@ 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 @@ -182,7 +174,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 @@ -203,12 +195,13 @@ 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 @@ -219,6 +212,7 @@ end function kpsolve end module kinDiagonKry_mod ! ------------------------------------------------------------------ + ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -237,10 +231,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 @@ -262,8 +256,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 ! ------------------------- @@ -280,16 +274,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 ! ------------------------- @@ -297,27 +291,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 ! ------------------------- @@ -325,8 +319,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 ! ------------------------- @@ -336,8 +330,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 ! ------------------------- @@ -345,8 +339,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 ! ------------------------- @@ -354,8 +348,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 ! ------------------------- @@ -369,8 +363,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 ! ------------------------- @@ -391,6 +385,7 @@ program main end program main ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintOutput: prints solution at selected points ! ---------------------------------------------------------------- @@ -407,8 +402,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 @@ -416,6 +411,7 @@ subroutine PrintOutput(uu) end subroutine PrintOutput ! ---------------------------------------------------------------- + ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -441,46 +437,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 ccd4510591..823015cf9c 100644 --- a/examples/kinsol/F2003_serial/kinLaplace_bnd_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinLaplace_bnd_f2003.f90 @@ -31,11 +31,11 @@ module prob_mod !======= Declarations ========= implicit none - 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 + 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 + 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,13 +60,13 @@ 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 + integer(c_long) :: i, j real(c_double) :: dx, dy, hdiff, vdiff, hdc, vdc, uij, udn, uup, ult, urt !======= Internals ============ @@ -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,6 +113,7 @@ end function func end module prob_mod + program main !======= Inclusions =========== @@ -133,15 +134,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 ============ @@ -174,14 +175,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 ! ------------------------- @@ -189,16 +190,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 ! ------------------------- @@ -207,8 +208,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 ! ------------------------- @@ -216,8 +217,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 ! ------------------------- @@ -225,8 +226,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 ! ------------------------- @@ -234,8 +235,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 ! ------------------------- @@ -245,16 +246,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 ! ------------------------- @@ -268,8 +269,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 ! ------------------------- @@ -278,11 +279,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) @@ -297,6 +298,7 @@ program main end program main + ! ---------------------------------------------------------------- ! PrintOutput: prints solution at selected points ! ---------------------------------------------------------------- @@ -310,38 +312,39 @@ 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 + integer(c_long) :: i, j real(c_double) :: dx, dy, x, y !======= 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 ! @@ -368,69 +371,73 @@ 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 875359e19e..e96dc3c5f0 100644 --- a/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 @@ -34,11 +34,11 @@ module prob_mod !======= Declarations ========= implicit none - 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 + 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 + real(c_double), parameter :: ftol = 1.d-12 contains @@ -47,24 +47,25 @@ 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 + integer(c_long) :: i, j real(c_double) :: dx, dy, hdiff, vdiff, hdc, vdc, uij, udn, uup, ult, urt !======= Internals ============ @@ -74,34 +75,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 @@ -110,16 +111,18 @@ 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 @@ -128,50 +131,50 @@ 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 + integer(c_long) :: i, j real(c_double) :: dx, dy, hdiff, vdiff, hdc, vdc, vij, vdn, vup, vlt, vrt !======= 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 @@ -182,6 +185,7 @@ end function jactimes end module prob_mod + program main !======= Inclusions =========== @@ -201,15 +205,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 ============ @@ -228,7 +232,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 @@ -241,14 +245,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 ! ------------------------- @@ -256,23 +260,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 ! ------------------------- @@ -283,8 +287,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 ! ------------------------- @@ -292,8 +296,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 ! ------------------------- @@ -303,17 +307,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 ! ------------------------- @@ -327,8 +331,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 ! ------------------------- @@ -337,11 +341,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) @@ -355,6 +359,7 @@ program main end program main + ! ---------------------------------------------------------------- ! PrintOutput: prints solution at selected points ! ---------------------------------------------------------------- @@ -368,38 +373,39 @@ 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 + integer(c_long) :: i, j real(c_double) :: dx, dy, x, y !======= 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 ! @@ -426,79 +432,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 509d3df13c..e9f56c6a3a 100644 --- a/examples/kinsol/F2003_serial/kinRoboKin_dns_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinRoboKin_dns_f2003.f90 @@ -34,10 +34,10 @@ module prob_mod !======= Declarations ========= implicit none - 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 + integer(c_long), parameter :: nvar = 8 + integer(c_long), parameter :: neq = 3*nvar + 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,6 +172,7 @@ integer(c_int) function func(sunvec_y, sunvec_f, user_data) & end function func + ! ---------------------------------------------------------------- ! jac: The nonlinear system Jacobian ! @@ -181,11 +182,12 @@ 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 @@ -196,13 +198,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 @@ -228,57 +230,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 @@ -289,6 +291,7 @@ end function jac end module prob_mod + program main !======= Inclusions =========== @@ -309,10 +312,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 @@ -337,7 +340,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 @@ -348,20 +351,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 ! ------------------------- @@ -369,14 +372,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 ! ------------------------- @@ -384,22 +387,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 ! ------------------------- @@ -407,8 +410,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 ! ------------------------- @@ -416,8 +419,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 ! ------------------------- @@ -425,8 +428,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 ! ------------------------- @@ -434,8 +437,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 ! ------------------------- @@ -444,8 +447,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 ! ------------------------- @@ -462,14 +465,15 @@ 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 @@ -484,6 +488,7 @@ program main end program main + ! ---------------------------------------------------------------- ! PrintOutput: prints solution at selected points ! ---------------------------------------------------------------- @@ -507,13 +512,14 @@ 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 ! @@ -537,33 +543,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/CMakeLists.txt b/examples/nvector/C_openmp/CMakeLists.txt index b332f20064..cfdc518d93 100644 --- a/examples/nvector/C_openmp/CMakeLists.txt +++ b/examples/nvector/C_openmp/CMakeLists.txt @@ -108,9 +108,6 @@ 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 @@ -118,6 +115,7 @@ 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/C_openmp/test_fnvector_openmp_mod.f90 b/examples/nvector/C_openmp/test_fnvector_openmp_mod.f90 index 971f0b2c08..a4b7648839 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(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 + 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 -contains + contains integer function smoke_tests() result(ret) implicit none - integer(kind=myindextype) :: lenrw(1), leniw(1) ! real and int work space size + 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 @@ -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 ===== @@ -94,16 +94,16 @@ integer function smoke_tests() result(ret) rval = FN_VMinQuotient_OpenMP(x, y) ! test fused vector operations - 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) + 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) ! test vector array operations - 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) + 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) !==== Cleanup ===== call FN_VDestroy_OpenMP(x) @@ -141,16 +141,17 @@ end function unit_tests end module + integer(C_INT) 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(kind=myindextype) :: local_length, i - real(C_DOUBLE), pointer :: Xdata(:) + real(C_DOUBLE) :: ans + type(N_Vector) :: X + integer(C_LONG) :: local_length, i + real(C_DOUBLE), pointer :: Xdata(:) failure = 0 @@ -162,6 +163,7 @@ 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 @@ -175,6 +177,7 @@ 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/CMakeLists.txt b/examples/nvector/manyvector/CMakeLists.txt index a43d1e4c15..e76cd90cd9 100644 --- a/examples/nvector/manyvector/CMakeLists.txt +++ b/examples/nvector/manyvector/CMakeLists.txt @@ -105,9 +105,6 @@ 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 @@ -115,6 +112,7 @@ 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/manyvector/test_fnvector_manyvector_mod.f90 b/examples/nvector/manyvector/test_fnvector_manyvector_mod.f90 index b6b99d480a..d87b6747b0 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_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_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 contains integer function smoke_tests() result(ret) implicit none - integer(kind=myindextype) :: ival ! integer work value - integer(kind=myindextype) :: lenrw(1), leniw(1) ! real and int work space size + 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 @@ -46,12 +46,12 @@ 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) + x => FN_VNew_ManyVector(int(nsubvecs,8), subvecs, sunctx) call FN_VConst(ONE, x) y => FN_VClone_ManyVector(x) call FN_VConst(ONE, y) @@ -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,12 +135,12 @@ 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) + x => FN_VNew_ManyVector(int(nsubvecs,8), subvecs, sunctx) call FN_VConst(ONE, x) !==== tests ==== @@ -156,22 +156,24 @@ end function unit_tests end module -function check_ans(ans, X, local_length) result(failure) + +integer(C_INT) 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(kind=myindextype) :: failure, 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(C_LONG) :: local_length, i, x0len, x1len + real(C_DOUBLE), pointer :: x0data(:), x1data(:) failure = 0 - X0 => FN_VGetSubvector_ManyVector(X, 0_myindextype) - X1 => FN_VGetSubvector_ManyVector(X, 1_myindextype) + X0 => FN_VGetSubvector_ManyVector(X, 0_8) + X1 => FN_VGetSubvector_ManyVector(X, 1_8) x0len = FN_VGetLength(X0) x1len = FN_VGetLength(X1) x0data => FN_VGetArrayPointer(X0) @@ -180,13 +182,13 @@ function check_ans(ans, X, local_length) result(failure) if (local_length /= (x0len + x1len)) then failure = 1 return - end if + endif do i = 1, x0len if (FNEQ(x0data(i), ans) > 0) then failure = failure + 1 end if - end do + enddo do i = 1, x1len if (FNEQ(x1data(i), ans) > 0) then @@ -195,6 +197,7 @@ 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 @@ -206,6 +209,7 @@ 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/CMakeLists.txt b/examples/nvector/mpimanyvector/CMakeLists.txt index 66c7253bc9..32765aa29a 100644 --- a/examples/nvector/mpimanyvector/CMakeLists.txt +++ b/examples/nvector/mpimanyvector/CMakeLists.txt @@ -146,9 +146,6 @@ 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 @@ -156,6 +153,7 @@ 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/mpimanyvector/test_fnvector_mpimanyvector_mod.f90 b/examples/nvector/mpimanyvector/test_fnvector_mpimanyvector_mod.f90 index 94d18d00ec..0e9f02f6aa 100644 --- a/examples/nvector/mpimanyvector/test_fnvector_mpimanyvector_mod.f90 +++ b/examples/nvector/mpimanyvector/test_fnvector_mpimanyvector_mod.f90 @@ -18,43 +18,44 @@ module test_nvector_mpimanyvector use, intrinsic :: iso_c_binding + use fnvector_mpimanyvector_mod use fnvector_serial_mod use test_utilities implicit none include "mpif.h" - 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 + 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 contains integer function smoke_tests() result(ret) implicit none - 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 + 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 !===== 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) + x => FN_VMake_MPIManyVector(comm, int(nsubvecs,8), subvecs, sunctx) call FN_VConst(ONE, x) y => FN_VClone_MPIManyVector(x) call FN_VConst(ONE, y) @@ -63,7 +64,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 ===== @@ -95,23 +96,23 @@ integer function smoke_tests() result(ret) rval = FN_VMinQuotientLocal_MPIManyVector(x, y) ! test fused vector operations - 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) + 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) ! test vector array operations - 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) + 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) ! 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) @@ -145,15 +146,15 @@ integer function unit_tests() result(fails) if (fails /= 0) then print *, ' FAILURE - MPI_COMM_RANK returned nonzero' stop 1 - end if + endif 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) + x => FN_VMake_MPIManyVector(comm, int(nsubvecs,8), subvecs, sunctx) call FN_VConst(ONE, x) !==== tests ==== @@ -172,22 +173,24 @@ 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 implicit none - 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(:) + 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(:) failure = 0 - X0 => FN_VGetSubvector_MPIManyVector(X, 0_myindextype) - X1 => FN_VGetSubvector_MPIManyVector(X, 1_myindextype) + X0 => FN_VGetSubvector_MPIManyVector(X, 0_8) + X1 => FN_VGetSubvector_MPIManyVector(X, 1_8) x0len = FN_VGetLength(X0) x1len = FN_VGetLength(X1) x0data => FN_VGetArrayPointer(X0) @@ -196,13 +199,13 @@ integer(C_INT) function check_ans(ans, X, local_length) result(failure) if (local_length /= (x0len + x1len)) then failure = 1 return - end if + endif do i = 1, x0len if (FNEQ(x0data(i), ans) > 0) then failure = failure + 1 end if - end do + enddo do i = 1, x1len if (FNEQ(x1data(i), ans) > 0) then @@ -211,6 +214,7 @@ 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 @@ -222,6 +226,7 @@ logical function has_data(X) result(failure) failure = .true. end function has_data + program main !======== Inclusions ========== use, intrinsic :: iso_c_binding @@ -237,13 +242,13 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_INIT returned nonzero' stop 1 - end if + endif call MPI_Comm_rank(comm, myid, fails) if (fails /= 0) then print *, 'FAILURE: MPI_COMM_RANK returned nonzero, proc', myid stop 1 - end if + endif !============== Introduction ============= if (myid == 0) print *, 'MPIManyVector N_Vector Fortran 2003 interface test' @@ -254,7 +259,7 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_COMM_SIZE returned nonzero, proc', myid stop 1 - end if + endif fails = smoke_tests() if (fails /= 0) then @@ -268,14 +273,14 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_BARRIER returned nonzero, proc', myid stop 1 - end if + endif 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() @@ -284,5 +289,5 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_FINALIZE returned nonzero, proc ', myid stop 1 - end if + endif end program main diff --git a/examples/nvector/mpiplusx/CMakeLists.txt b/examples/nvector/mpiplusx/CMakeLists.txt index 195bcb6868..9b2c733540 100644 --- a/examples/nvector/mpiplusx/CMakeLists.txt +++ b/examples/nvector/mpiplusx/CMakeLists.txt @@ -144,9 +144,6 @@ 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 @@ -154,6 +151,7 @@ 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/mpiplusx/test_fnvector_mpiplusx_mod.f90 b/examples/nvector/mpiplusx/test_fnvector_mpiplusx_mod.f90 index ac2f3f75f1..cc194d7840 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(kind=myindextype), parameter :: N = 100 ! overall manyvector length + integer(c_long), 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 @@ -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 - end if + endif - 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,6 +95,7 @@ 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 @@ -102,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(kind=myindextype) :: local_length, i, x0len - real(C_DOUBLE), pointer :: x0data(:) + 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(:) failure = 0 @@ -117,16 +118,17 @@ integer(C_INT) function check_ans(ans, X, local_length) result(failure) if (local_length /= x0len) then failure = 1 return - end if + endif do i = 1, x0len if (FNEQ(x0data(i), ans) > 0) then failure = failure + 1 end if - end do + enddo end function check_ans + logical function has_data(X) result(failure) use, intrinsic :: iso_c_binding @@ -138,6 +140,7 @@ logical function has_data(X) result(failure) failure = .true. end function has_data + program main !======== Inclusions ========== use, intrinsic :: iso_c_binding @@ -153,13 +156,13 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_INIT returned nonzero' stop 1 - end if + endif call MPI_Comm_rank(comm, myid, fails) if (fails /= 0) then print *, 'FAILURE: MPI_COMM_RANK returned nonzero, proc', myid stop 1 - end if + endif !============== Introduction ============= if (myid == 0) print *, 'MPIPlusX N_Vector Fortran 2003 interface test' @@ -170,7 +173,7 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_COMM_SIZE returned nonzero, proc', myid stop 1 - end if + endif fails = smoke_tests() if (fails /= 0) then @@ -184,14 +187,14 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_BARRIER returned nonzero, proc', myid stop 1 - end if + endif 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() @@ -200,5 +203,5 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_FINALIZE returned nonzero, proc ', myid stop 1 - end if + endif end program main diff --git a/examples/nvector/parallel/CMakeLists.txt b/examples/nvector/parallel/CMakeLists.txt index bfdf74eec8..ff13f85ce5 100644 --- a/examples/nvector/parallel/CMakeLists.txt +++ b/examples/nvector/parallel/CMakeLists.txt @@ -133,9 +133,6 @@ 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 @@ -143,6 +140,7 @@ 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/parallel/test_fnvector_parallel_mod.f90 b/examples/nvector/parallel/test_fnvector_parallel_mod.f90 index e473e0fa61..59f4d16968 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(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_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(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(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 + contains integer function smoke_tests() result(ret) implicit none - 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 + 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 !===== Setup ==== x => FN_VMake_Parallel(comm, local_length, global_length, xdata, sunctx) @@ -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 ===== @@ -98,16 +98,16 @@ integer function smoke_tests() result(ret) rval = FN_VMinQuotient_Parallel(x, y) ! test fused vector operations - 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) + 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) ! test vector array operations - 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) + 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) !==== Cleanup ===== call FN_VDestroy_Parallel(x) @@ -136,7 +136,7 @@ integer function unit_tests() result(fails) if (fails /= 0) then print *, ' FAILURE - MPI_COMM_RANK returned nonzero' stop 1 - end if + endif x => FN_VMake_Parallel(comm, local_length, global_length, xdata, sunctx) call FN_VConst(ONE, x) @@ -153,16 +153,17 @@ end function unit_tests end module + integer(C_INT) 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(kind=myindextype) :: local_length, i - real(C_DOUBLE), pointer :: Xdata(:) + real(C_DOUBLE) :: ans + type(N_Vector) :: X + integer(C_LONG) :: local_length, i + real(C_DOUBLE), pointer :: Xdata(:) failure = 0 @@ -174,6 +175,7 @@ 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 @@ -187,6 +189,7 @@ logical function has_data(X) result(failure) failure = associated(xptr) end function has_data + program main !======== Inclusions ========== use, intrinsic :: iso_c_binding @@ -202,13 +205,13 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_INIT returned nonzero' stop 1 - end if + endif call MPI_Comm_rank(comm, myid, fails) if (fails /= 0) then print *, 'FAILURE: MPI_COMM_RANK returned nonzero, proc', myid stop 1 - end if + endif !============== Introduction ============= if (myid == 0) print *, 'Parallel N_Vector Fortran 2003 interface test' @@ -219,7 +222,7 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_COMM_SIZE returned nonzero, proc', myid stop 1 - end if + endif global_length = nprocs*local_length fails = smoke_tests() @@ -234,14 +237,14 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_BARRIER returned nonzero, proc', myid stop 1 - end if + endif 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() @@ -250,6 +253,6 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_FINALIZE returned nonzero, proc ', myid stop 1 - end if + endif end program main diff --git a/examples/nvector/pthreads/CMakeLists.txt b/examples/nvector/pthreads/CMakeLists.txt index e9fefd7191..586e1c3f06 100644 --- a/examples/nvector/pthreads/CMakeLists.txt +++ b/examples/nvector/pthreads/CMakeLists.txt @@ -108,9 +108,6 @@ 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 @@ -118,6 +115,7 @@ 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/pthreads/test_fnvector_pthreads_mod.f90 b/examples/nvector/pthreads/test_fnvector_pthreads_mod.f90 index c8223103d2..13b3429927 100644 --- a/examples/nvector/pthreads/test_fnvector_pthreads_mod.f90 +++ b/examples/nvector/pthreads/test_fnvector_pthreads_mod.f90 @@ -17,20 +17,21 @@ module test_nvector_pthreads use, intrinsic :: iso_c_binding + use fnvector_pthreads_mod use test_utilities implicit none - 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 + 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 -contains + contains integer function smoke_tests() result(ret) implicit none - integer(kind=myindextype) :: lenrw(1), leniw(1) ! real and int work space size + 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 @@ -49,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 ===== @@ -93,16 +94,16 @@ integer function smoke_tests() result(ret) rval = FN_VMinQuotient_Pthreads(x, y) ! test fused vector operations - 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) + 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) ! test vector array operations - 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) + 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) !==== Cleanup ===== call FN_VDestroy_Pthreads(x) @@ -140,16 +141,17 @@ end function unit_tests end module + integer(C_INT) 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(kind=myindextype) :: local_length, i - real(C_DOUBLE), pointer :: Xdata(:) + real(C_DOUBLE) :: ans + type(N_Vector) :: X + integer(C_LONG) :: local_length, i + real(C_DOUBLE), pointer :: Xdata(:) failure = 0 @@ -161,6 +163,7 @@ 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 @@ -174,6 +177,7 @@ 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/CMakeLists.txt b/examples/nvector/serial/CMakeLists.txt index 6807562188..ef92e58040 100644 --- a/examples/nvector/serial/CMakeLists.txt +++ b/examples/nvector/serial/CMakeLists.txt @@ -100,9 +100,6 @@ 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 @@ -111,6 +108,9 @@ 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/nvector/serial/test_fnvector_serial_mod.f90 b/examples/nvector/serial/test_fnvector_serial_mod.f90 index 4f0daf3921..eb958fb6ea 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(kind=myindextype), parameter :: N = 100 ! vector length - integer(c_int), parameter :: nv = 3 ! length of vector arrays + integer(c_long), 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(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 + 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 !===== Setup ==== x => FN_VMake_Serial(N, xdata, sunctx) @@ -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,16 +140,17 @@ end function unit_tests end module -function check_ans(ans, X, local_length) result(failure) + +integer(C_INT) function check_ans(ans, X, local_length) result(failure) use, intrinsic :: iso_c_binding + use test_utilities implicit none - integer(kind=myindextype) :: failure - real(C_DOUBLE) :: ans - type(N_Vector) :: X - integer(kind=myindextype) :: local_length, i - real(C_DOUBLE), pointer :: Xdata(:) + real(C_DOUBLE) :: ans + type(N_Vector) :: X + integer(C_LONG) :: local_length, i + real(C_DOUBLE), pointer :: Xdata(:) failure = 0 @@ -161,8 +162,10 @@ 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 implicit none @@ -173,6 +176,7 @@ 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 855d0d6dd1..c4465f6c46 100644 --- a/examples/nvector/test_nvector.f90 +++ b/examples/nvector/test_nvector.f90 @@ -22,6 +22,8 @@ module test_fnvector use, intrinsic :: iso_c_binding + + use test_utilities implicit none @@ -30,148 +32,152 @@ 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 + implicit none - type(N_Vector) :: X - integer(kind=myindextype) :: local_length - integer(C_INT) :: myid + type(N_Vector) :: X + integer(C_LONG) :: local_length + integer(C_INT) :: myid - 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 + 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 - if (myid == 0) then - print *, 'PASSED test -- FN_VMake' - end if + if (myid == 0) then + print *, 'PASSED test -- FN_VMake' + end if + + failure = 0 +end function Test_FN_VMake - 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(C_LONG) :: 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(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) + + 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/CMakeLists.txt b/examples/sunlinsol/band/CMakeLists.txt index 8a6d09997e..1dd10759f5 100644 --- a/examples/sunlinsol/band/CMakeLists.txt +++ b/examples/sunlinsol/band/CMakeLists.txt @@ -97,9 +97,6 @@ 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 @@ -108,6 +105,9 @@ 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/band/test_fsunlinsol_band_mod.f90 b/examples/sunlinsol/band/test_fsunlinsol_band_mod.f90 index 0f238725e7..48c66684a0 100644 --- a/examples/sunlinsol/band/test_fsunlinsol_band_mod.f90 +++ b/examples/sunlinsol/band/test_fsunlinsol_band_mod.f90 @@ -20,14 +20,17 @@ module test_fsunlinsol_band use test_utilities implicit none - integer(kind=myindextype), parameter :: N = 10 - integer(kind=myindextype), parameter :: mu = 2 - integer(kind=myindextype), parameter :: ml = 3 + integer(C_LONG), parameter :: N = 10 + integer(C_LONG), parameter :: mu = 2 + integer(C_LONG), parameter :: ml = 3 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 use fsunlinsol_band_mod @@ -36,13 +39,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(kind=myindextype) :: j, k - integer(kind=myindextype) :: 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(C_LONG) :: j, k + integer(C_LONG) :: smu, kstart, kend, offset + integer(C_INT) :: tmp fails = 0 smu = 0 @@ -54,25 +57,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,15 +119,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 + implicit none type(N_Vector) :: x, y - real(c_double) :: tol, maxerr - integer(kind=myindextype) :: 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 @@ -147,9 +151,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 @@ -162,7 +166,7 @@ program main !======== Declarations ======== implicit none - integer(c_int) :: fails = 0 + integer(C_INT) :: fails = 0 !============== Introduction ============= print *, 'Band SUNLinearSolver Fortran 2003 interface test' @@ -174,7 +178,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/CMakeLists.txt b/examples/sunlinsol/dense/CMakeLists.txt index 03b6155811..f751cd4760 100644 --- a/examples/sunlinsol/dense/CMakeLists.txt +++ b/examples/sunlinsol/dense/CMakeLists.txt @@ -97,9 +97,6 @@ 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 @@ -108,6 +105,9 @@ 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/dense/test_fsunlinsol_dense_mod.f90 b/examples/sunlinsol/dense/test_fsunlinsol_dense_mod.f90 index 728a746bd3..a06d69eeb5 100644 --- a/examples/sunlinsol/dense/test_fsunlinsol_dense_mod.f90 +++ b/examples/sunlinsol/dense/test_fsunlinsol_dense_mod.f90 @@ -20,12 +20,15 @@ module test_fsunlinsol_dense use test_utilities implicit none - integer(kind=myindextype), private, parameter :: N = 100 + integer(C_LONG), 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_dense_mod @@ -34,13 +37,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 - integer(kind=myindextype) :: j, k - integer(c_int) :: tmp + 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(C_LONG) :: j, k + integer(C_INT) :: tmp fails = 0 @@ -50,34 +53,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 @@ -115,15 +118,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(kind=myindextype) :: i, xlen, ylen - real(c_double), pointer :: xdata(:), ydata(:) + implicit none + type(N_Vector) :: x, y + real(C_DOUBLE) :: tol, maxerr + integer(C_LONG) :: i, xlen, ylen + real(C_DOUBLE), pointer :: xdata(:), ydata(:) failure = 0 @@ -146,9 +150,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 @@ -161,7 +165,7 @@ program main !======== Declarations ======== implicit none - integer(c_int) :: fails = 0 + integer(C_INT) :: fails = 0 !============== Introduction ============= print *, 'Dense SUNLinearSolver Fortran 2003 interface test' @@ -173,7 +177,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/ginkgo/CMakeLists.txt b/examples/sunlinsol/ginkgo/CMakeLists.txt index 6d3cae204f..2633fd7751 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 SYCL + BACKENDS REF OMP CUDA HIP DPCPP 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 "SYCL") + if(SUNDIALS_GINKGO_BACKENDS MATCHES "DPCPP") 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 9a979b2c9a..a1b00950c0 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_SYCL) +#elif defined(USE_DPCPP) #include <nvector/nvector_sycl.h> #define HIP_OR_CUDA_OR_SYCL(a, b, c) c constexpr auto N_VNew = N_VNew_Sycl; @@ -143,15 +143,10 @@ __global__ void fill_kernel(sunindextype mat_rows, sunindextype mat_cols, } #endif -#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 +void fill_matrix(gko::matrix::Csr<sunrealtype, sunindextype>* matrix) { - sunindextype mat_rows = static_cast<sunindextype>(matrix->get_size()[0]); - sunindextype mat_cols = static_cast<sunindextype>(matrix->get_size()[1]); + sunindextype mat_rows = matrix->get_size()[0]; + sunindextype mat_cols = matrix->get_size()[1]; sunindextype* row_ptrs = matrix->get_row_ptrs(); sunindextype* col_idxs = matrix->get_col_idxs(); sunrealtype* mat_data = matrix->get_values(); @@ -163,7 +158,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_SYCL) +#elif defined(USE_DPCPP) std::dynamic_pointer_cast<const gko::DpcppExecutor>(matrix->get_executor()) ->get_queue() ->submit( @@ -234,14 +229,10 @@ static void fill_matrix( #endif } -#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 +void fill_matrix(gko::matrix::Dense<sunrealtype>* matrix) { - sunindextype mat_rows = static_cast<sunindextype>(matrix->get_size()[0]); - sunindextype mat_cols = static_cast<sunindextype>(matrix->get_size()[1]); + sunindextype mat_rows = matrix->get_size()[0]; + sunindextype mat_cols = matrix->get_size()[1]; sunrealtype* mat_data = matrix->get_values(); #if defined(USE_CUDA) || defined(USE_HIP) @@ -250,7 +241,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_SYCL) +#elif defined(USE_DPCPP) std::dynamic_pointer_cast<const gko::DpcppExecutor>(matrix->get_executor()) ->get_queue() ->submit( @@ -355,7 +346,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_SYCL) +#elif defined(USE_DPCPP) auto gko_exec{gko::DpcppExecutor::create(0, gko::ReferenceExecutor::create())}; #elif defined(USE_OMP) auto gko_exec{gko::OmpExecutor::create()}; @@ -443,7 +434,7 @@ int main(int argc, char* argv[]) * Create solution and RHS vectors * * ------------------------------- */ -#if defined(USE_SYCL) +#if defined(USE_DPCPP) N_Vector x{N_VNew(matcols, gko_exec->get_queue(), sunctx)}; #else N_Vector x{N_VNew(matcols, sunctx)}; @@ -480,7 +471,7 @@ int main(int argc, char* argv[]) auto gko_matrix = gko::share(GkoMatrixType::create(gko_exec, matrix_dim, matrix_nnz)); - if (matcond > 0) + if (matcond) { auto gko_matdata{gko::matrix_data< sunrealtype, sunindextype>::cond(matrows, @@ -489,14 +480,7 @@ int main(int argc, char* argv[]) gko_matdata.remove_zeros(); gko_matrix->read(gko_matdata); } - else - { -#if (GKO_VERSION_MAJOR == 1) && (GKO_VERSION_MINOR < 6) - fill_matrix(gko::lend(gko_matrix)); -#else - fill_matrix(gko_matrix); -#endif - } + else { fill_matrix(gko::lend(gko_matrix)); } A = std::make_unique<sundials::ginkgo::Matrix<GkoMatrixType>>(std::move( gko_matrix), sunctx); @@ -505,7 +489,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 > 0) + if (matcond) { auto gko_matdata{gko::matrix_data< sunrealtype, sunindextype>::cond(matrows, @@ -517,11 +501,7 @@ 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/klu/CMakeLists.txt b/examples/sunlinsol/klu/CMakeLists.txt index 664ec266a1..5932da7b07 100644 --- a/examples/sunlinsol/klu/CMakeLists.txt +++ b/examples/sunlinsol/klu/CMakeLists.txt @@ -98,9 +98,6 @@ 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 @@ -109,6 +106,9 @@ 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/klu/test_fsunlinsol_klu_mod.f90 b/examples/sunlinsol/klu/test_fsunlinsol_klu_mod.f90 index a5392d0e6e..360e3c73d8 100644 --- a/examples/sunlinsol/klu/test_fsunlinsol_klu_mod.f90 +++ b/examples/sunlinsol/klu/test_fsunlinsol_klu_mod.f90 @@ -20,13 +20,15 @@ module test_fsunlinsol_klu use test_utilities implicit none - integer(kind=myindextype), private, parameter :: N = 300 + integer(C_LONG), private, parameter :: N = 300 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 @@ -36,13 +38,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 - integer(kind=myindextype) :: j, k, i - integer(c_int) :: tmp + 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(C_LONG) :: j, k, i + integer(C_INT) :: tmp fails = 0 @@ -51,14 +53,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 @@ -72,7 +74,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 @@ -112,16 +114,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 @@ -144,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)), 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 @@ -159,7 +161,7 @@ program main !======== Declarations ======== implicit none - integer(c_int) :: fails = 0 + integer(C_INT) :: fails = 0 !============== Introduction ============= print *, 'KLU SUNLinearSolver Fortran 2003 interface test' @@ -171,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/kokkos/test_sunlinsol_kokkosdense.cpp b/examples/sunlinsol/kokkos/test_sunlinsol_kokkosdense.cpp index 5099ff8044..cc42870024 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 -static int CompareTol(sunrealtype a, sunrealtype b, sunrealtype tol) +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/sunlinsol/lapackdense/CMakeLists.txt b/examples/sunlinsol/lapackdense/CMakeLists.txt index 0dd6ea947e..ce5739b1b5 100644 --- a/examples/sunlinsol/lapackdense/CMakeLists.txt +++ b/examples/sunlinsol/lapackdense/CMakeLists.txt @@ -103,9 +103,6 @@ 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 @@ -114,6 +111,9 @@ 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/lapackdense/test_fsunlinsol_lapackdense_mod.f90 b/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 index 0088ca8418..3751dd2a76 100644 --- a/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 +++ b/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 @@ -20,13 +20,15 @@ module test_fsunlinsol_lapackdense use test_utilities implicit none - integer(kind=myindextype), private, parameter :: N = 100 + integer(C_LONG), 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 @@ -35,13 +37,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 - integer(kind=myindextype) :: j, k - integer(c_int) :: tmp + 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(C_LONG) :: j, k + integer(C_INT) :: tmp fails = 0 @@ -51,34 +53,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 @@ -116,15 +118,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 @@ -147,9 +149,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 @@ -162,7 +164,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' @@ -174,7 +176,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/CMakeLists.txt b/examples/sunlinsol/pcg/serial/CMakeLists.txt index 4d6be609ee..4a014d11e7 100644 --- a/examples/sunlinsol/pcg/serial/CMakeLists.txt +++ b/examples/sunlinsol/pcg/serial/CMakeLists.txt @@ -104,9 +104,6 @@ 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 @@ -115,6 +112,9 @@ 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/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 b/examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 index b5bad44d77..e874047354 100644 --- a/examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 +++ b/examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 @@ -25,21 +25,23 @@ 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_LONG), 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(kind=myindextype) :: N + integer(C_LONG) :: N type(N_Vector), pointer :: d, s end type 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 @@ -47,33 +49,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 - integer(kind=myindextype) :: j - integer(c_int) :: tmp + 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(C_LONG) :: j + 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 @@ -86,14 +88,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) @@ -121,13 +123,14 @@ 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 @@ -151,13 +154,14 @@ 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 @@ -169,7 +173,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 @@ -185,13 +189,14 @@ 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 @@ -206,22 +211,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) @@ -234,37 +239,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) @@ -274,8 +279,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 @@ -283,16 +288,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 @@ -315,9 +320,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 @@ -330,7 +335,7 @@ program main !======== Declarations ======== implicit none - integer(c_int) :: fails = 0 + integer(C_INT) :: fails = 0 !============== Introduction ============= print *, 'PCG SUNLinearSolver Fortran 2003 interface test' @@ -343,7 +348,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/CMakeLists.txt b/examples/sunlinsol/spbcgs/serial/CMakeLists.txt index 005f743cdf..81a7330259 100644 --- a/examples/sunlinsol/spbcgs/serial/CMakeLists.txt +++ b/examples/sunlinsol/spbcgs/serial/CMakeLists.txt @@ -104,9 +104,6 @@ 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 @@ -115,6 +112,9 @@ 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/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 b/examples/sunlinsol/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 index 7d5d2dfae6..5e44e48df2 100644 --- a/examples/sunlinsol/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 +++ b/examples/sunlinsol/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 @@ -25,21 +25,23 @@ 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_LONG), 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(kind=myindextype) :: N + integer(C_LONG) :: N type(N_Vector), pointer :: d, s1, s2 end type 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 @@ -47,32 +49,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 - integer(kind=myindextype) :: j - integer(c_int) :: tmp + 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(C_LONG) :: j + 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 @@ -85,14 +87,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) @@ -117,13 +119,14 @@ 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 @@ -144,13 +147,14 @@ 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 @@ -162,7 +166,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 @@ -175,13 +179,14 @@ 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 @@ -197,66 +202,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) @@ -265,8 +270,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 @@ -274,16 +279,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 @@ -306,9 +311,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 @@ -321,7 +326,7 @@ program main !======== Declarations ======== implicit none - integer(c_int) :: fails = 0 + integer(C_INT) :: fails = 0 !============== Introduction ============= print *, 'SPBCGS SUNLinearSolver Fortran 2003 interface test' @@ -334,7 +339,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/CMakeLists.txt b/examples/sunlinsol/spfgmr/serial/CMakeLists.txt index daa7d9fca3..beba6889fd 100644 --- a/examples/sunlinsol/spfgmr/serial/CMakeLists.txt +++ b/examples/sunlinsol/spfgmr/serial/CMakeLists.txt @@ -103,9 +103,6 @@ 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 @@ -114,6 +111,9 @@ 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/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 b/examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 index 0a14009745..9a1792a7f1 100644 --- a/examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 +++ b/examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 @@ -21,24 +21,28 @@ module test_fsunlinsol_spfgmr_serial use, intrinsic :: iso_c_binding + 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_LONG), 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(kind=myindextype) :: N + integer(C_LONG) :: N type(N_Vector), pointer :: d, s1, s2 end type 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 use test_sunlinsol @@ -46,32 +50,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 - integer(kind=myindextype) :: j - integer(c_int) :: tmp + 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(C_LONG) :: j + 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 @@ -84,14 +88,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) @@ -117,13 +121,14 @@ 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 @@ -144,13 +149,14 @@ 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 @@ -162,7 +168,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 @@ -175,13 +181,14 @@ 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 @@ -197,66 +204,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) @@ -265,8 +272,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 @@ -274,16 +281,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 @@ -306,9 +313,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 @@ -321,7 +328,7 @@ program main !======== Declarations ======== implicit none - integer(c_int) :: fails = 0 + integer(C_INT) :: fails = 0 !============== Introduction ============= print *, 'SPFGMR SUNLinearSolver Fortran 2003 interface test' @@ -334,7 +341,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/CMakeLists.txt b/examples/sunlinsol/spgmr/serial/CMakeLists.txt index 3353f2a829..0ad67ecec1 100644 --- a/examples/sunlinsol/spgmr/serial/CMakeLists.txt +++ b/examples/sunlinsol/spgmr/serial/CMakeLists.txt @@ -106,9 +106,6 @@ 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 @@ -117,6 +114,9 @@ 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/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 b/examples/sunlinsol/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 index 0f9dec6568..e0de52a8bd 100644 --- a/examples/sunlinsol/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 +++ b/examples/sunlinsol/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 @@ -21,24 +21,28 @@ module test_fsunlinsol_spgmr_serial use, intrinsic :: iso_c_binding + 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_LONG), 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(kind=myindextype) :: N + integer(C_LONG) :: N type(N_Vector), pointer :: d, s1, s2 end type 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 use test_sunlinsol @@ -46,32 +50,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 - integer(kind=myindextype) :: j - integer(c_int) :: tmp + 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(C_LONG) :: j + 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 @@ -84,14 +88,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) @@ -117,13 +121,14 @@ 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 @@ -144,13 +149,14 @@ 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 @@ -162,7 +168,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 @@ -175,13 +181,14 @@ 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 @@ -197,66 +204,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(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 + 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 call c_f_pointer(udata, probdata) @@ -265,8 +272,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 @@ -274,16 +281,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 + implicit none type(N_Vector) :: x, y - real(c_double) :: tol, maxerr - integer(kind=myindextype) :: 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 @@ -306,9 +313,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 @@ -321,7 +328,7 @@ program main !======== Declarations ======== implicit none - integer(c_int) :: fails = 0 + integer(C_INT) :: fails = 0 !============== Introduction ============= print *, 'SPGMR SUNLinearSolver Fortran 2003 interface test' @@ -334,7 +341,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/CMakeLists.txt b/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt index c985445c51..2d3543ed5c 100644 --- a/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt +++ b/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt @@ -104,9 +104,6 @@ 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 @@ -115,6 +112,9 @@ 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/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 b/examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 index 85c89199f2..055809c074 100644 --- a/examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 +++ b/examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 @@ -25,21 +25,23 @@ 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_LONG), 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(kind=myindextype) :: N + integer(C_LONG) :: N type(N_Vector), pointer :: d, s1, s2 end type 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 @@ -47,32 +49,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 - integer(kind=myindextype) :: j - integer(c_int) :: tmp + 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(C_LONG) :: j + 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 @@ -85,14 +87,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) @@ -117,13 +119,14 @@ 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 @@ -144,13 +147,14 @@ 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 @@ -162,7 +166,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 @@ -175,13 +179,14 @@ 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 @@ -197,66 +202,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) @@ -265,8 +270,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 @@ -274,16 +279,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 @@ -306,9 +311,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 @@ -321,7 +326,7 @@ program main !======== Declarations ======== implicit none - integer(c_int) :: fails = 0 + integer(C_INT) :: fails = 0 !============== Introduction ============= print *, 'SPTFQMR SUNLinearSolver Fortran 2003 interface test' @@ -334,7 +339,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 584d4162ae..ffdb50250c 100644 --- a/examples/sunlinsol/test_sunlinsol.f90 +++ b/examples/sunlinsol/test_sunlinsol.f90 @@ -26,36 +26,37 @@ 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 @@ -63,38 +64,40 @@ 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 @@ -102,107 +105,116 @@ 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 @@ -210,54 +222,55 @@ 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 @@ -270,7 +283,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 @@ -278,8 +291,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 @@ -290,7 +303,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 @@ -300,9 +313,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/CMakeLists.txt b/examples/sunmatrix/band/CMakeLists.txt index 1db5a837a3..2502ecf508 100644 --- a/examples/sunmatrix/band/CMakeLists.txt +++ b/examples/sunmatrix/band/CMakeLists.txt @@ -98,9 +98,6 @@ 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 @@ -109,6 +106,9 @@ 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/band/test_fsunmatrix_band_mod.f90 b/examples/sunmatrix/band/test_fsunmatrix_band_mod.f90 index f7c7e00bca..8ebc559680 100644 --- a/examples/sunmatrix/band/test_fsunmatrix_band_mod.f90 +++ b/examples/sunmatrix/band/test_fsunmatrix_band_mod.f90 @@ -20,17 +20,18 @@ module test_fsunmatrix_band use test_utilities implicit none - integer(kind=myindextype), parameter :: N = 10 - integer(kind=myindextype), parameter :: mu = 2 - integer(kind=myindextype), parameter :: ml = 2 + integer(C_LONG), parameter :: N = 10 + integer(C_LONG), parameter :: mu = 2 + integer(C_LONG), 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 @@ -39,11 +40,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) @@ -54,7 +55,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 @@ -68,18 +69,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) @@ -93,9 +94,10 @@ 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 @@ -103,15 +105,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(kind=myindextype) :: 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(C_LONG) :: ii, jj, smu, istart, iend, offset fails = 0 A => FSUNBandMatrix(N, mu, ml, sunctx) - I => FSUNBandMatrix(N, 0_myindextype, 0_myindextype, sunctx) + I => FSUNBandMatrix(N, 0_8, 0_8, sunctx) x => FN_VNew_Serial(N, sunctx) y => FN_VNew_Serial(N, sunctx) @@ -122,14 +124,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 @@ -137,15 +139,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_c_long, 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 @@ -175,7 +177,7 @@ program main !======== Declarations ======== implicit none - integer(c_int) :: fails = 0 + integer(C_INT) :: fails = 0 !============== Introduction ============= print *, 'Band SUNMatrix Fortran 2003 interface test' @@ -195,7 +197,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 @@ -204,16 +206,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 @@ -248,17 +250,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 @@ -267,27 +269,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/CMakeLists.txt b/examples/sunmatrix/dense/CMakeLists.txt index e5e5f9a346..48365ac059 100644 --- a/examples/sunmatrix/dense/CMakeLists.txt +++ b/examples/sunmatrix/dense/CMakeLists.txt @@ -97,15 +97,13 @@ 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/dense/test_fsunmatrix_dense_mod.f90 b/examples/sunmatrix/dense/test_fsunmatrix_dense_mod.f90 index 2a8a39ebbb..35ecd897e7 100644 --- a/examples/sunmatrix/dense/test_fsunmatrix_dense_mod.f90 +++ b/examples/sunmatrix/dense/test_fsunmatrix_dense_mod.f90 @@ -20,15 +20,16 @@ module test_fsunmatrix_dense use test_utilities implicit none - integer(kind=myindextype), parameter :: N = 4 + integer(C_LONG), parameter :: N = 4 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 @@ -37,10 +38,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 @@ -52,7 +53,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 @@ -62,16 +63,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) @@ -85,9 +86,10 @@ 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 @@ -95,9 +97,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 @@ -108,30 +110,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) @@ -160,7 +162,7 @@ program main !======== Declarations ======== implicit none - integer(c_int) :: fails = 0 + integer(C_INT) :: fails = 0 !============== Introduction ============= print *, 'Dense SUNMatrix Fortran 2003 interface test' @@ -180,7 +182,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 @@ -189,9 +191,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(:) - integer(kind=myindextype) :: Aldata, Bldata, i + real(C_DOUBLE) :: tol + real(C_DOUBLE), pointer :: Adata(:), Bdata(:) + integer(C_LONG) :: Aldata, Bldata, i fails = 0 @@ -210,13 +212,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 @@ -225,9 +227,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 @@ -238,16 +240,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/dreadrb.c b/examples/sunmatrix/dreadrb.c index 9d24da993a..86ab792353 100644 --- a/examples/sunmatrix/dreadrb.c +++ b/examples/sunmatrix/dreadrb.c @@ -120,8 +120,6 @@ * </pre> */ -#include "dreadrb.h" - #include <stdio.h> #include <stdlib.h> #include <sundials/sundials_types.h> diff --git a/examples/sunmatrix/ginkgo/CMakeLists.txt b/examples/sunmatrix/ginkgo/CMakeLists.txt index 0e17ab0821..cf19355e45 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 SYCL + BACKENDS REF OMP CUDA HIP DPCPP 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 "SYCL") + if(SUNDIALS_GINKGO_BACKENDS MATCHES "DPCPP") 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 b29ac171aa..f7381b7f17 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_SYCL) +#elif defined(USE_DPCPP) #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_SYCL) +#elif defined(USE_DPCPP) #include <nvector/nvector_sycl.h> #else #include <nvector/nvector_serial.h> @@ -213,8 +213,7 @@ 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 (sunindextype irow = 0; - irow < static_cast<sunindextype>(gko_matrix->get_size()[0]); irow++) + for (auto irow = 0; irow < 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++) @@ -300,7 +299,7 @@ int main(int argc, char* argv[]) /* ---------------------------------------------------------------------- * Check matrix * --------------------------------------------------------------------*/ -static int check_matrix_csr(SUNMatrix A, SUNMatrix B, sunrealtype tol) +int check_matrix_csr(SUNMatrix A, SUNMatrix B, sunrealtype tol) { int failure{0}; auto Amat{ @@ -310,7 +309,10 @@ static 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 */ @@ -321,8 +323,7 @@ static int check_matrix_csr(SUNMatrix A, SUNMatrix B, sunrealtype tol) } /* compare data */ - for (sunindextype irow = 0; - irow < static_cast<sunindextype>(Amat_ref->get_size()[0]); irow++) + for (sunindextype irow = 0; irow < Amat_ref->get_size()[0]; irow++) { for (sunindextype inz = Arowptrs[irow]; inz < Arowptrs[irow + 1]; inz++) { @@ -333,7 +334,7 @@ static int check_matrix_csr(SUNMatrix A, SUNMatrix B, sunrealtype tol) return failure > 0; } -static int check_matrix_dense(SUNMatrix A, SUNMatrix B, sunrealtype tol) +int check_matrix_dense(SUNMatrix A, SUNMatrix B, sunrealtype tol) { int failure{0}; auto Amat{ @@ -353,9 +354,9 @@ static int check_matrix_dense(SUNMatrix A, SUNMatrix B, sunrealtype tol) } /* compare data */ - for (sunindextype i = 0; i < static_cast<sunindextype>(rows); i++) + for (sunindextype i = 0; i < rows; i++) { - for (sunindextype j = 0; j < static_cast<sunindextype>(cols); j++) + for (sunindextype j = 0; j < cols; j++) { failure += SUNRCompareTol(Amat_ref->at(i, j), Bmat_ref->at(i, j), tol); } @@ -371,18 +372,18 @@ extern "C" int check_matrix(SUNMatrix A, SUNMatrix B, sunrealtype tol) else { return 1; } } -static int check_matrix_entry_csr(SUNMatrix A, sunrealtype val, sunrealtype tol) +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 < static_cast<sunindextype>(Amat_ref->get_size()[0]); irow++) + for (sunindextype irow = 0; irow < Amat_ref->get_size()[0]; irow++) { for (sunindextype inz = Arowptrs[irow]; inz < Arowptrs[irow + 1]; inz++) { @@ -399,7 +400,7 @@ static int check_matrix_entry_csr(SUNMatrix A, sunrealtype val, sunrealtype tol) return failure > 0; } -static int check_matrix_entry_dense(SUNMatrix A, sunrealtype val, sunrealtype tol) +int check_matrix_entry_dense(SUNMatrix A, sunrealtype val, sunrealtype tol) { int failure{0}; auto Amat{ @@ -409,9 +410,9 @@ static int check_matrix_entry_dense(SUNMatrix A, sunrealtype val, sunrealtype to auto Amat_ref = Amat->clone(Amat->get_executor()->get_master()); /* compare data */ - for (sunindextype i = 0; i < static_cast<sunindextype>(rows); i++) + for (sunindextype i = 0; i < rows; i++) { - for (sunindextype j = 0; j < static_cast<sunindextype>(cols); j++) + for (sunindextype j = 0; j < cols; j++) { int check = SUNRCompareTol(Amat_ref->at(i, j), val, tol); if (check) @@ -536,4 +537,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 cb0d3374f2..17fbf4d8a6 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 -static int CompareTol(sunrealtype a, sunrealtype b, sunrealtype tol) +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/sparse/CMakeLists.txt b/examples/sunmatrix/sparse/CMakeLists.txt index ee04a96b8d..daff9a61d4 100644 --- a/examples/sunmatrix/sparse/CMakeLists.txt +++ b/examples/sunmatrix/sparse/CMakeLists.txt @@ -102,15 +102,13 @@ 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/sunmatrix/sparse/test_fsunmatrix_sparse_mod.f90 b/examples/sunmatrix/sparse/test_fsunmatrix_sparse_mod.f90 index 03bcff5896..740cc82a39 100644 --- a/examples/sunmatrix/sparse/test_fsunmatrix_sparse_mod.f90 +++ b/examples/sunmatrix/sparse/test_fsunmatrix_sparse_mod.f90 @@ -20,15 +20,16 @@ module test_fsunmatrix_sparse use test_utilities implicit none - integer(kind=myindextype), parameter :: N = 5 + integer(C_LONG), parameter :: N = 5 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 @@ -36,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(kind=myindextype), 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(C_LONG), pointer :: inddat(:) ! indices pointer + integer(C_LONG) :: lenrw(1), leniw(1) ! matrix real and int work space size - integer(kind=myindextype) :: tmp1 - integer(c_int) :: tmp2 + integer(C_LONG) :: tmp1 + integer(C_INT) :: tmp2 fails = 0 @@ -55,7 +56,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 @@ -73,7 +74,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) @@ -91,9 +92,10 @@ 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 @@ -102,9 +104,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 @@ -114,16 +116,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 @@ -136,16 +138,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) @@ -176,7 +178,7 @@ program main !======== Declarations ======== implicit none - integer(c_int) :: fails = 0 + integer(C_INT) :: fails = 0 !============== Introduction ============= print *, 'Sparse SUNMatrix Fortran 2003 interface test' @@ -196,7 +198,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 @@ -204,17 +206,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(:) - integer(kind=myindextype), pointer :: Aidxvals(:), Bidxvals(:) - integer(kind=myindextype), pointer :: Aidxptrs(:), Bidxptrs(:) - integer(kind=myindextype) :: i, np, Annz, Bnnz + 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 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) @@ -222,7 +224,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 @@ -279,9 +281,10 @@ 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 @@ -289,28 +292,29 @@ 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(kind=myindextype), pointer :: Aidxptrs(:) - integer(kind=myindextype) :: i, np + type(SUNMatrix) :: A + real(C_DOUBLE) :: c, tol + real(C_DOUBLE), pointer :: Adata(:) + integer(C_LONG), pointer :: Aidxptrs(:) + integer(C_LONG) :: 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 30c1f5f2ca..1f1cc3319b 100644 --- a/examples/sunmatrix/test_sunmatrix.f90 +++ b/examples/sunmatrix/test_sunmatrix.f90 @@ -23,14 +23,17 @@ 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 @@ -40,12 +43,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 @@ -56,26 +59,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 @@ -97,15 +100,16 @@ 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 @@ -124,15 +128,16 @@ 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 @@ -167,14 +172,15 @@ 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 @@ -191,7 +197,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) @@ -204,14 +210,15 @@ 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 @@ -242,14 +249,15 @@ 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 @@ -290,14 +298,15 @@ 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 @@ -334,13 +343,14 @@ 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 @@ -363,18 +373,20 @@ 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 @@ -413,16 +425,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) @@ -432,13 +444,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 @@ -452,19 +464,20 @@ 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/CMakeLists.txt b/examples/sunnonlinsol/fixedpoint/CMakeLists.txt index 834af69c2e..4906cd1a31 100644 --- a/examples/sunnonlinsol/fixedpoint/CMakeLists.txt +++ b/examples/sunnonlinsol/fixedpoint/CMakeLists.txt @@ -97,9 +97,6 @@ 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 f732b96374..bedf8684c2 100644 --- a/examples/sunnonlinsol/fixedpoint/test_fsunnonlinsol_fixedpoint_mod.f90 +++ b/examples/sunnonlinsol/fixedpoint/test_fsunnonlinsol_fixedpoint_mod.f90 @@ -21,22 +21,20 @@ 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_LONG), 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 - 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 - - type(N_Vector), pointer :: y0 + real(C_DOUBLE) :: Y1 = 0.5d0 + real(C_DOUBLE) :: Y2 = 0.d0 + real(C_DOUBLE) :: Y3 = -PI/6.0d0 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,93 +43,94 @@ 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 - - y0 => FN_VNew_Serial(NEQ, sunctx) - ycor => FN_VClone(y0) - ycur => FN_VClone(y0) - w => FN_VClone(y0) - - ! set initial guess - data => FN_VGetArrayPointer(y0) - data(1) = 0.1d0 - data(2) = 0.1d0 - data(3) = -0.1d0 + type(N_Vector), pointer :: x, y0, y, w ! test vectors + real(C_DOUBLE), pointer :: ydata(:) + integer(C_LONG) :: niters(1) + integer(C_INT) :: tmp - ! set initial correction - call FN_VConst(0.0d0, ycor) + x => FN_VNew_Serial(NEQ, sunctx) + y0 => FN_VClone(x) + y => FN_VClone(x) + w => FN_VClone(x) ! set weights + ydata => FN_VGetArrayPointer(y0) + ydata(1) = 0.1d0 + ydata(2) = 0.1d0 + ydata(3) = -0.1d0 + call FN_VConst(1.0d0, w) ! create and test NLS - NLS => FSUNNonlinsol_FixedPoint(y0, 0, sunctx) + NLS => FSUNNonlinsol_FixedPoint(y, 0, sunctx) 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)) + retval = FSUNNonlinSolSolve(NLS, y0, y, w, TOL, 1, c_loc(x)) 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); - ! print number of iterations - retval = FSUNNonlinSolGetNumIters(NLS, niters) - if (retval /= 0) then - write (*, '(A,I0)') ' >>> FAIL: FSUNNonlinSolGetNumIters returned ', retval - return - end if + ! extract and print solution + ydata => FN_VGetArrayPointer(y) - write (*, '(A,I0)') 'Number of nonlinear iterations: ', niters(1) + write(*,*) 'Solution:' + write(*,'(A,E14.7)') 'y1 = ', ydata(1) + write(*,'(A,E14.7)') 'y2 = ', ydata(2) + write(*,'(A,E14.7)') 'y3 = ', ydata(3) - ! check answer - retval = check_ans(ycur, TOL) + 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: check_ans failed' + write(*,'(A,I0)') ' >>> FAIL: FSUNNonlinSolGetNumIters returned ', retval return end if + write(*,'(A,I0)') 'Number of nonlinear iterations:', niters(1) + ! cleanup + call FN_VDestroy(x) call FN_VDestroy(y0) - call FN_VDestroy(ycor) - call FN_VDestroy(ycur) + call FN_VDestroy(y) call FN_VDestroy(w) tmp = FSUNNonlinSolFree(NLS) 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 + + 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_VMaxNorm(del) @@ -145,85 +144,44 @@ integer(c_int) function ConvTest(NLS, y, del, tol, ewt, mem) & end function ! ----------------------------------------------------------------------------- - ! Nonlinear system F(x,y,z): - ! - ! 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 system ! - ! Nonlinear fixed point function G(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 ! - ! 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 + ! Nonlinear fixed point function ! - ! 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 + ! 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 ! ! ---------------------------------------------------------------------------- - integer(c_int) function FPFunction(ycor, f, mem) & + integer(C_INT) function FPFunction(y, 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 - data => FN_VGetArrayPointer(ycor) - fdata => FN_VGetArrayPointer(f) - - x = data(1) - 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 - - 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) + type(N_Vector) :: y, f + type(C_PTR), value :: mem + real(C_DOUBLE), pointer :: ydata(:), fdata(:) + real(C_DOUBLE) :: y1, y2, y3 - ex = data(1) - XTRUE - ey = data(2) - YTRUE - ez = data(3) - ZTRUE + ydata => FN_VGetArrayPointer(y) + fdata => FN_VGetArrayPointer(f) - write (*, *) 'Solution Error:' - write (*, '(A,E14.7)') ' ex = ', ex - write (*, '(A,E14.7)') ' ey = ', ey - write (*, '(A,E14.7)') ' ez = ', ez + y1 = ydata(1) + y2 = ydata(2) + y3 = ydata(3) - tol = tol*10.0d0 - if (ex > tol .or. ey > tol .or. ez > tol) then - retval = 1 - end if + 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 retval = 0 + end function end module @@ -237,10 +195,10 @@ program main !======== Declarations ======== implicit none - integer(c_int) :: fails = 0 + integer(C_INT) :: fails = 0 !============== Introduction ============= - write (*, *) 'SUNNonlinearSolver_FixedPoint Fortran 2003 interface test' + print *, 'fixedpoint SUNNonlinearSolver Fortran 2003 interface test' call Test_Init(SUN_COMM_NULL) @@ -249,7 +207,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/fixedpoint/test_sunnonlinsol_fixedpoint.c b/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c index 440739e147..511ca7a901 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/damping values were provided */ - if (argc > 1) { maa = atoi(argv[1]); } + /* Check if a acceleration/dampling values were provided */ + if (argc > 1) { maa = (long int)atoi(argv[1]); } if (argc > 2) { damping = (sunrealtype)atof(argv[2]); } /* Print problem description */ diff --git a/examples/sunnonlinsol/newton/CMakeLists.txt b/examples/sunnonlinsol/newton/CMakeLists.txt index 2f3413bd0b..08870d929f 100644 --- a/examples/sunnonlinsol/newton/CMakeLists.txt +++ b/examples/sunnonlinsol/newton/CMakeLists.txt @@ -98,9 +98,6 @@ 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/newton/test_fsunnonlinsol_newton_mod.f90 b/examples/sunnonlinsol/newton/test_fsunnonlinsol_newton_mod.f90 index 9c85724f72..6f9716979c 100644 --- a/examples/sunnonlinsol/newton/test_fsunnonlinsol_newton_mod.f90 +++ b/examples/sunnonlinsol/newton/test_fsunnonlinsol_newton_mod.f90 @@ -17,18 +17,21 @@ module test_fsunnonlinsol_newton use, intrinsic :: iso_c_binding + + + use test_utilities 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_LONG), 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 ! 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 +45,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 +56,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 +83,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 +97,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 +138,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,24 +165,26 @@ 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() @@ -188,7 +193,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 @@ -198,14 +203,16 @@ 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 @@ -216,17 +223,19 @@ 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) @@ -239,16 +248,17 @@ 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 @@ -265,27 +275,28 @@ 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) @@ -295,9 +306,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 @@ -314,7 +325,7 @@ program main !======== Declarations ======== implicit none - integer(c_int) :: retval = 0 + integer(C_INT) :: retval = 0 !============== Introduction ============= print *, 'Newton SUNNonlinearSolver Fortran 2003 interface test' @@ -326,7 +337,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/templates/cmakelists_openmp_F2003_ex.in b/examples/templates/cmakelists_openmp_F2003_ex.in index f8c099048c..cf351be2a7 100644 --- a/examples/templates/cmakelists_openmp_F2003_ex.in +++ b/examples/templates/cmakelists_openmp_F2003_ex.in @@ -33,9 +33,6 @@ 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) @@ -150,8 +147,6 @@ 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 5fc13f1bc0..1d5670752f 100644 --- a/examples/templates/cmakelists_parallel_F2003_ex.in +++ b/examples/templates/cmakelists_parallel_F2003_ex.in @@ -24,9 +24,6 @@ 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@" @@ -109,8 +106,6 @@ 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 fdc2568027..bd59966da3 100644 --- a/examples/templates/cmakelists_serial_F2003_ex.in +++ b/examples/templates/cmakelists_serial_F2003_ex.in @@ -32,9 +32,6 @@ 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) @@ -146,8 +143,6 @@ 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}) @@ -189,8 +184,6 @@ 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 f1f8152e4a..16ca3499cf 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@ -DSUNDIALS_INT@SUNDIALS_INDEX_SIZE@_T @CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON@ +F90FLAGS = @CMAKE_Fortran_FLAGS_RELEASE@ @OpenMP_Fortran_FLAGS@ F90LIBS = @LIBS@ # ----------------------------------------------------------------------------------------- diff --git a/examples/templates/makefile_parallel_F2003_ex.in b/examples/templates/makefile_parallel_F2003_ex.in index 071b0c4cbc..e54328fb74 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@ -DSUNDIALS_INT@SUNDIALS_INDEX_SIZE@_T @CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON@ +F90FLAGS = @CMAKE_Fortran_FLAGS_RELEASE@ 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 d77f5368d1..fb08ffe4d7 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@ -DSUNDIALS_INT@SUNDIALS_INDEX_SIZE@_T @CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON@ +F90FLAGS = @CMAKE_Fortran_FLAGS_RELEASE@ F90LIBS = @LIBS@ # ------------------------------------------------------------------------------ diff --git a/examples/utilities/example_utilities.hpp b/examples/utilities/example_utilities.hpp index 00b4d843fc..e21c762126 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 -static int check_flag(const int flag, const std::string funcname) +int check_flag(const int flag, const std::string funcname) { if (flag < 0) { @@ -32,7 +32,7 @@ static int check_flag(const int flag, const std::string funcname) } // Check if a function returned a NULL pointer -static int check_ptr(const void* ptr, const std::string funcname) +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/examples/utilities/test_utilities.f90 b/examples/utilities/test_utilities.f90 index 54c439dee3..69a0161487 100644 --- a/examples/utilities/test_utilities.f90 +++ b/examples/utilities/test_utilities.f90 @@ -16,42 +16,32 @@ 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. -#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 - 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 + use, intrinsic :: iso_c_binding + use fsundials_core_mod + implicit none + + 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 + + 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 +53,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 +73,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/include/arkode/arkode.h b/include/arkode/arkode.h index f4e0667d72..f0265db008 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) */ @@ -64,7 +64,6 @@ 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 @@ -138,8 +137,6 @@ extern "C" { #define ARK_CONTROLLER_ERR -47 -#define ARK_STEPPER_UNSUPPORTED -48 - #define ARK_UNRECOGNIZED_ERROR -99 /* ------------------------------ @@ -174,9 +171,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 (forward declaration) - * ------------------------------------------------ */ +/* -------------------------- + * MRIStep Inner Stepper Type + * -------------------------- */ typedef _SUNDIALS_STRUCT_ _MRIStepInnerStepper* MRIStepInnerStepper; @@ -190,228 +187,6 @@ 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 (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); -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); -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); -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 ARKodeSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, - void* estab_data); -SUNDIALS_EXPORT int ARKodeSetMaxErrTestFails(void* arkode_mem, int maxnef); -SUNDIALS_EXPORT int ARKodeSetConstraints(void* arkode_mem, N_Vector constraints); -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 ARKodeSetMaxNumConstrFails(void* arkode_mem, int maxfails); - -/* 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 (general) */ -SUNDIALS_EXPORT int ARKodeGetNumStepAttempts(void* arkode_mem, - long int* step_attempts); -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 ARKodeGetLastStep(void* arkode_mem, sunrealtype* hlast); -SUNDIALS_EXPORT int ARKodeGetCurrentStep(void* arkode_mem, sunrealtype* hcur); -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); -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); - -/* 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); - -/* 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, - 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); -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 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); -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); - -/* 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 f7a6f112f5..5881ed7759 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 @@ -23,6 +23,7 @@ #include <arkode/arkode_ls.h> #include <sunadaptcontroller/sunadaptcontroller_imexgus.h> #include <sunadaptcontroller/sunadaptcontroller_soderlind.h> +#include <sundials/sundials_stepper.h> #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { @@ -35,7 +36,6 @@ 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; @@ -46,7 +46,6 @@ 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; @@ -66,16 +65,58 @@ static const int ARKSTEP_DEFAULT_ARK_ITABLE_5 = ARKODE_ARK548L2SA_DIRK_8_4_5; * Exported Functions * ------------------- */ -/* Creation and Reinitialization functions */ +/* Create, Resize, and Reinitialization functions */ 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_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); + +/* 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); + +/* 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); + +/* 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); + +/* Rootfinding initialization */ +SUNDIALS_EXPORT 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_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_EXPORT int ARKStepSetTables(void* arkode_mem, int q, int p, ARKodeButcherTable Bi, ARKodeButcherTable Be); @@ -84,352 +125,252 @@ 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 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 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); + +/* 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); + +/* Integrate the ODE over an interval in t */ +SUNDIALS_EXPORT 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); + +/* Utility function to update/compute y based on zcor */ +SUNDIALS_EXPORT 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_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_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); + +/* 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); + +/* 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); + +/* 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); + +/* Free function */ +SUNDIALS_EXPORT void ARKStepFree(void** arkode_mem); + +/* Output the ARKStep memory structure (useful when debugging) */ +SUNDIALS_EXPORT void ARKStepPrintMem(void* arkode_mem, FILE* outfile); /* 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_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") -int ARKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); -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); -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); -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); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") -int ARKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); -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_DEPRECATED_EXPORT_MSG("use ARKodeSetDeduceImplicitRhs instead") -int ARKStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce); -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_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_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); -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); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") -int ARKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") -int ARKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeComputeState instead") -int ARKStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z); -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_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_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); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetStepStats instead") -int ARKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, - sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur); -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); -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); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") -void ARKStepFree(void** arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintMem instead") -void ARKStepPrintMem(void* arkode_mem, FILE* outfile); -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); +/* SUNStepper interface functions */ +SUNDIALS_EXPORT int ARKStepCreateSUNStepper(void* arkode_mem, + SUNStepper* 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); #ifdef __cplusplus } diff --git a/include/arkode/arkode_butcher_dirk.h b/include/arkode/arkode_butcher_dirk.h index c89ea0594f..fa60103e89 100644 --- a/include/arkode/arkode_butcher_dirk.h +++ b/include/arkode/arkode_butcher_dirk.h @@ -51,10 +51,7 @@ typedef enum 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 = ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 + ARKODE_MAX_DIRK_NUM = ARKODE_ARK2_DIRK_3_1_2 } ARKODE_DIRKTableID; /* Accessor routine to load built-in DIRK table */ @@ -65,9 +62,6 @@ 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 c6c0373510..bb99368b41 100644 --- a/include/arkode/arkode_butcher_erk.h +++ b/include/arkode/arkode_butcher_erk.h @@ -49,10 +49,7 @@ typedef enum 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 = ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 + ARKODE_MAX_ERK_NUM = ARKODE_VERNER_16_8_9 } ARKODE_ERKTableID; /* Accessor routine to load built-in ERK table */ @@ -62,8 +59,6 @@ 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/include/arkode/arkode_erkstep.h b/include/arkode/arkode_erkstep.h index ed93a240b9..6fc507c4f2 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 @@ -32,7 +32,6 @@ 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; @@ -46,204 +45,170 @@ static const int ERKSTEP_DEFAULT_9 = ARKODE_VERNER_16_8_9; * Exported Functions * ------------------- */ -/* Creation and Reinitialization functions */ +/* Create, Resize, and Reinitialization functions */ 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_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); + +/* 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); + +/* Rootfinding initialization */ +SUNDIALS_EXPORT 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_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 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 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); + +/* Integrate the ODE over an interval in t */ +SUNDIALS_EXPORT 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); /* 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_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_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_EXPORT int ERKStepGetStepStats(void* arkode_mem, long int* nsteps, + sunrealtype* hinused, sunrealtype* hlast, + sunrealtype* hcur, sunrealtype* tcur); -/* -------------------------------------------------------------------------- - * 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_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") -int ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); -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); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") -int ERKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); -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_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_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_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); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") -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") -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_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_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); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") -void ERKStepFree(void** arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintMem instead") -void ERKStepPrintMem(void* arkode_mem, FILE* outfile); -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); +/* Free function */ +SUNDIALS_EXPORT void ERKStepFree(void** arkode_mem); + +/* Output the ERKStep memory structure (useful when debugging) */ +SUNDIALS_EXPORT 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); #ifdef __cplusplus } diff --git a/include/arkode/arkode_ls.h b/include/arkode/arkode_ls.h index ce5a6928fa..8973e53ea5 100644 --- a/include/arkode/arkode_ls.h +++ b/include/arkode/arkode_ls.h @@ -87,42 +87,6 @@ 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 000bae135a..b322ed7819 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 @@ -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" { @@ -52,32 +53,17 @@ typedef enum 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 = ARKODE_IMEX_MRI_GARK_MIDPOINT, + ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_GARK4 } 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_IMPL_SD_1 = ARKODE_MRI_GARK_BACKWARD_EULER; +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_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; @@ -145,232 +131,207 @@ typedef int (*MRIStepPostInnerFn)(sunrealtype t, N_Vector y, void* user_data); * Exported Functions * ------------------- */ -/* Creation and Reinitialization functions */ +/* Create, Resize, and Reinitialization functions */ 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_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); + +/* 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); + +/* Linear solver set function */ +SUNDIALS_EXPORT int MRIStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, + SUNMatrix A); + +/* Rootfinding initialization */ +SUNDIALS_EXPORT 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_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_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); + +/* 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); + +/* Integrate the ODE over an interval in t */ +SUNDIALS_EXPORT 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); + +/* Utility function to update/compute y based on zcor */ +SUNDIALS_EXPORT 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_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_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); + +/* 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); + +/* Free function */ +SUNDIALS_EXPORT void MRIStepFree(void** arkode_mem); + +/* Output the MRIStep memory structure (useful when debugging) */ +SUNDIALS_EXPORT void MRIStepPrintMem(void* arkode_mem, FILE* outfile); /* 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); + 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_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") -int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); -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); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinearSolver instead") -int MRIStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") -int MRIStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); -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_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 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") -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_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); -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); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") -int MRIStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") -int MRIStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeComputeState instead") -int MRIStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z); -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") -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 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_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, - 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); -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); -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); - #ifdef __cplusplus } #endif diff --git a/include/arkode/arkode_sprkstep.h b/include/arkode/arkode_sprkstep.h index 3e4519cd40..a8f6c3a4df 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,91 +41,74 @@ static const int SPRKSTEP_DEFAULT_10 = ARKODE_SPRK_SOFRONIOU_10_36; * Exported Functions * ------------------- */ -/* Creation and Reinitialization functions */ +/* Create, Resize, 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_EXPORT 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); + /* Optional input functions -- must be called AFTER SPRKStepCreate */ +SUNDIALS_EXPORT 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); + +/* Integrate the ODE over an interval in t */ +SUNDIALS_EXPORT 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); /* Optional output functions */ +SUNDIALS_EXPORT 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_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); + +/* Grouped optional output functions */ +SUNDIALS_EXPORT int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, + sunrealtype* hinused, sunrealtype* hlast, + sunrealtype* hcur, sunrealtype* tcur); -/* -------------------------------------------------------------------------- - * 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") -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); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") -int SPRKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") -int SPRKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") -char* SPRKStepGetReturnFlagName(long int flag); -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_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); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetStepStats instead") -int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, - sunrealtype* hinused, sunrealtype* hlast, - sunrealtype* hcur, sunrealtype* tcur); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") -void SPRKStepFree(void** arkode_mem); +/* Free function */ +SUNDIALS_EXPORT void SPRKStepFree(void** arkode_mem); #ifdef __cplusplus } diff --git a/include/arkode/arkode_xbraid.h b/include/arkode/arkode_xbraid.h index 6ce4df639d..e3cf93c213 100644 --- a/include/arkode/arkode_xbraid.h +++ b/include/arkode/arkode_xbraid.h @@ -57,19 +57,13 @@ SUNDIALS_EXPORT int ARKBraid_SetAccessFn(braid_App app, braid_PtFcnAccess access SUNDIALS_EXPORT int ARKBraid_GetVecTmpl(braid_App app, N_Vector* tmpl); -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_GetARKStepMem(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_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_GetLastARKStepFlag(braid_App app, int* last_flag); SUNDIALS_EXPORT int ARKBraid_GetSolution(braid_App app, sunrealtype* tout, N_Vector yout); diff --git a/include/cvodes/cvodes.h b/include/cvodes/cvodes.h index 8af98fc26c..813ded3c7f 100644 --- a/include/cvodes/cvodes.h +++ b/include/cvodes/cvodes.h @@ -579,8 +579,7 @@ SUNDIALS_EXPORT int CVodeGetAdjCheckPointsInfo(void* cvode_mem, CVadjCheckPointRec* ckpnt); /* CVLS interface function that depends on CVRhsFn */ -SUNDIALS_EXPORT int CVodeSetJacTimesRhsFnB(void* cvode_mem, int which, - CVRhsFn jtimesRhsFn); +int CVodeSetJacTimesRhsFnB(void* cvode_mem, int which, CVRhsFn jtimesRhsFn); /* Undocumented Optional Output Functions For Backward Problems */ diff --git a/include/nvector/nvector_parallel.h b/include/nvector/nvector_parallel.h index 385ca528ed..e05e4c7ef8 100644 --- a/include/nvector/nvector_parallel.h +++ b/include/nvector/nvector_parallel.h @@ -117,8 +117,10 @@ void N_VPrint_Parallel(N_Vector v); SUNDIALS_EXPORT void N_VPrintFile_Parallel(N_Vector v, FILE* outfile); -SUNDIALS_EXPORT -N_Vector_ID N_VGetVectorID_Parallel(N_Vector v); +static inline N_Vector_ID N_VGetVectorID_Parallel(N_Vector v) +{ + return SUNDIALS_NVEC_PARALLEL; +} 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 b7f8271fb7..a7c7ced8a1 100644 --- a/include/nvector/nvector_parhyp.h +++ b/include/nvector/nvector_parhyp.h @@ -96,6 +96,8 @@ 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); @@ -212,12 +214,6 @@ 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 8605cb130e..1fa3b536b2 100644 --- a/include/nvector/nvector_petsc.h +++ b/include/nvector/nvector_petsc.h @@ -76,6 +76,8 @@ 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); @@ -91,6 +93,7 @@ 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); @@ -205,12 +208,6 @@ 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 988e090af2..bcbc995f2e 100644 --- a/include/nvector/nvector_serial.h +++ b/include/nvector/nvector_serial.h @@ -102,8 +102,10 @@ void N_VPrint_Serial(N_Vector v); SUNDIALS_EXPORT void N_VPrintFile_Serial(N_Vector v, FILE* outfile); -SUNDIALS_EXPORT -N_Vector_ID N_VGetVectorID_Serial(N_Vector v); +static inline N_Vector_ID N_VGetVectorID_Serial(N_Vector v) +{ + return SUNDIALS_NVEC_SERIAL; +} SUNDIALS_EXPORT N_Vector N_VCloneEmpty_Serial(N_Vector w); diff --git a/include/nvector/trilinos/SundialsTpetraVectorKernels.hpp b/include/nvector/trilinos/SundialsTpetraVectorKernels.hpp index 8b2d68eb08..02779a18e3 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,6 +339,8 @@ 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); } }, @@ -663,6 +665,8 @@ 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/sundials/sundials_adaptcontroller.h b/include/sundials/sundials_adaptcontroller.h index b27d7c73c8..9cde03bfa4 100644 --- a/include/sundials/sundials_adaptcontroller.h +++ b/include/sundials/sundials_adaptcontroller.h @@ -91,10 +91,6 @@ 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/include/sundials/sundials_config.in b/include/sundials/sundials_config.in index def1a87414..b56ae8fa86 100644 --- a/include/sundials/sundials_config.in +++ b/include/sundials/sundials_config.in @@ -60,7 +60,6 @@ #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 @@ -221,7 +220,7 @@ #cmakedefine SUNDIALS_GINKGO_BACKENDS_HIP #cmakedefine SUNDIALS_GINKGO_BACKENDS_OMP #cmakedefine SUNDIALS_GINKGO_BACKENDS_REF -#cmakedefine SUNDIALS_GINKGO_BACKENDS_SYCL +#cmakedefine SUNDIALS_GINKGO_BACKENDS_DPCPP /* MAGMA backends */ #cmakedefine SUNDIALS_MAGMA_BACKENDS_CUDA diff --git a/include/sundials/sundials_stepper.h b/include/sundials/sundials_stepper.h new file mode 100644 index 0000000000..859aa78240 --- /dev/null +++ b/include/sundials/sundials_stepper.h @@ -0,0 +1,104 @@ +/* ----------------------------------------------------------------- + * 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 int (*SUNJacFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, + void* user_data, N_Vector tmp1, N_Vector tmp2, + N_Vector tmp3); + +typedef int (*SUNJacTimesFn)(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 int (*SUNStepperAdvanceFn)(SUNStepper stepper, sunrealtype t0, + sunrealtype tout, N_Vector y, + sunrealtype* tret, int* stop_reason); + +typedef int (*SUNStepperOneStepFn)(SUNStepper stepper, sunrealtype t0, + sunrealtype tout, N_Vector y, + sunrealtype* tret, int* stop_reason); + +typedef int (*SUNStepperTryStepFn)(SUNStepper stepper, sunrealtype t0, + sunrealtype tout, N_Vector y, + sunrealtype* tret, int* stop_reason); + +typedef int (*SUNStepperFullRhsFn)(SUNStepper stepper, sunrealtype t, + N_Vector y, N_Vector f, int mode); + +typedef int (*SUNStepperResetFn)(SUNStepper stepper, sunrealtype tR, N_Vector yR); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_Create(SUNContext sunctx, SUNStepper* stepper); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_Destroy(SUNStepper* stepper); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetContent(SUNStepper stepper, void* content); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_GetContent(SUNStepper stepper, void** content); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetAdvanceFn(SUNStepper stepper, SUNStepperAdvanceFn fn); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetOneStepFn(SUNStepper stepper, SUNStepperOneStepFn fn); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetTryStepFn(SUNStepper stepper, SUNStepperTryStepFn fn); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetFullRhsFn(SUNStepper stepper, SUNStepperFullRhsFn fn); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetResetFn(SUNStepper stepper, SUNStepperResetFn fn); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_AddForcing(SUNStepper stepper, sunrealtype t, N_Vector f); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_GetForcingData(SUNStepper stepper, sunrealtype* tshift, + sunrealtype* tscale, N_Vector** forcing, + int* nforcing); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_Advance(SUNStepper stepper, sunrealtype t0, + sunrealtype tout, N_Vector y, sunrealtype* tret, + int* stop_reason); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_Step(SUNStepper stepper, sunrealtype t0, sunrealtype tout, + N_Vector y, sunrealtype* tret, int* stop_reason); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_TryStep(SUNStepper stepper, sunrealtype t0, + sunrealtype tout, N_Vector y, sunrealtype* tret, + int* stop_reason); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_Reset(SUNStepper stepper, sunrealtype tR, N_Vector yR); + +#ifdef __cplusplus +} +#endif + +#endif /* _SUNDIALS_STEPPER_H */ diff --git a/include/sunlinsol/sunlinsol_ginkgo.hpp b/include/sunlinsol/sunlinsol_ginkgo.hpp index 2817d426a9..d801cb1da9 100644 --- a/include/sunlinsol/sunlinsol_ginkgo.hpp +++ b/include/sunlinsol/sunlinsol_ginkgo.hpp @@ -332,19 +332,11 @@ 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 2fbda953bd..ba109bb2be 100644 --- a/include/sunlinsol/sunlinsol_kokkosdense.hpp +++ b/include/sunlinsol/sunlinsol_kokkosdense.hpp @@ -40,12 +40,12 @@ class DenseLinearSolver; namespace impl { -static SUNLinearSolver_Type SUNLinSolGetType_KokkosDense(SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_KokkosDense(SUNLinearSolver S) { return SUNLINEARSOLVER_DIRECT; } -static SUNLinearSolver_ID SUNLinSolGetID_KokkosDense(SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_KokkosDense(SUNLinearSolver S) { return SUNLINEARSOLVER_KOKKOSDENSE; } diff --git a/include/sunmatrix/sunmatrix_kokkosdense.hpp b/include/sunmatrix/sunmatrix_kokkosdense.hpp index 15bf696dee..d172ba73df 100644 --- a/include/sunmatrix/sunmatrix_kokkosdense.hpp +++ b/include/sunmatrix/sunmatrix_kokkosdense.hpp @@ -46,7 +46,7 @@ inline MatrixType* GetDenseMat(SUNMatrix A) namespace impl { -static SUNMatrix_ID SUNMatGetID_KokkosDense(SUNMatrix A) +SUNMatrix_ID SUNMatGetID_KokkosDense(SUNMatrix A) { return SUNMATRIX_KOKKOSDENSE; } diff --git a/scripts/format.sh b/scripts/format.sh index b145adcfad..21dc930698 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -10,8 +10,7 @@ # 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-tidy and clang-format to format code. # # Usage: # ./format.sh <paths to directories or files to format> @@ -29,5 +28,3 @@ 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/scripts/startReleaseCycle.sh b/scripts/startReleaseCycle.sh index 5e9f9e86b8..042e4a251f 100755 --- a/scripts/startReleaseCycle.sh +++ b/scripts/startReleaseCycle.sh @@ -46,13 +46,9 @@ cat > tmp.txt <<HEREDOC ## Changes to SUNDIALS in release X.Y.Z -### Major Features - -### New Features and Enhancements +### New Features ### Bug Fixes - -### Deprecation Notices HEREDOC sedi -e '/SUNDIALS Changelog/ {' \ @@ -78,13 +74,9 @@ sedi -e '/RecentChanges_link.rst/ {' \ # Clear recent changes file cat > ../doc/shared/RecentChanges.rst <<HEREDOC -**Major Features** - -**New Features and Enhancements** +**New Features** **Bug Fixes** - -**Deprecation Notices** HEREDOC # Add new entry to changelog diff --git a/scripts/sundialsdev/__init__.py b/scripts/sundialsdev/__init__.py deleted file mode 100644 index 87ae34c366..0000000000 --- a/scripts/sundialsdev/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ - -""" -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 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 642dec13aa..8b64d9dd16 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.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 e91e846bde..6089b1b723 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:-1} +sun_minor=${2:-0} sun_patch=${3:-0} sun_label=${4:-""} month=${5:-$(date +"%b")} @@ -327,7 +327,7 @@ done # Update rst documentation # ------------------------------------------------------------------------------ -fn="../doc/shared/sundials_vars.py" +fn="../doc/shared/versions.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 diff --git a/src/arkode/CMakeLists.txt b/src/arkode/CMakeLists.txt index 267bc89a33..f430d53930 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() # Add ARKODE XBraid interface diff --git a/src/arkode/README.md b/src/arkode/README.md index d71f6b43ef..fd825b9dbb 100644 --- a/src/arkode/README.md +++ b/src/arkode/README.md @@ -1,5 +1,5 @@ # ARKODE -### Version 6.1.0 (Jun 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.1.0," LLNL technical report - LLNL-SM-668082, Jun 2024. + "User Documentation for ARKODE v6.0.0," LLNL technical report + LLNL-SM-668082, Feb 2024. -* D. R. Reynolds, "Example Programs for ARKODE v6.1.0," Technical Report, - Southern Methodist University Center for Scientific Computation, Jun 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/arkode/arkode.c b/src/arkode/arkode.c index f21c51d46e..ad7e70e554 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -17,6 +17,9 @@ * use. *--------------------------------------------------------------*/ +/*=============================================================== + Import Header Files + ===============================================================*/ #include "arkode/arkode.h" #include <stdarg.h> @@ -36,19 +39,167 @@ #include "sundials_utils.h" /*=============================================================== - Exported functions + EXPORTED FUNCTIONS ===============================================================*/ /*--------------------------------------------------------------- - ARKodeResize: + 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_mem = NULL; + + /* 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 = 41; /* 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"); + arkFree((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"); + arkFree((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 = arkSetDefaults(ark_mem); + if (iret != ARK_SUCCESS) + { + arkProcessError(NULL, 0, __LINE__, __func__, __FILE__, + "Error setting default solver options"); + arkFree((void**)&ark_mem); + return (NULL); + } + + /* Return pointer to ARKODE memory block */ + return (ark_mem); +} + +/*--------------------------------------------------------------- + arkResize: - ARKodeResize re-initializes ARKODE's memory for a problem with a + arkResize 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 ARKodeResize + all time-stepping heuristics prior to calling arkResize remain valid after the call. If instead the dynamics should be re-calibrated, the ARKODE memory structure should be deleted - with a call to ARKodeFree, and re-created with a call to + with a call to *StepFree, and re-created with a call to *StepCreate. To aid in the vector-resize operation, the user can supply a @@ -76,22 +227,20 @@ The return value is ARK_SUCCESS = 0 if no errors occurred, or a negative value otherwise. ---------------------------------------------------------------*/ -int ARKodeResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data) +int arkResize(ARKodeMem ark_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 (arkode_mem == NULL) + if (ark_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) @@ -178,81 +327,37 @@ int ARKodeResize(void* arkode_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); } /*--------------------------------------------------------------- - 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: + arkSStolerances, arkSVtolerances, arkWFtolerances: These functions specify the integration tolerances. One of them - SHOULD be called before the first call to ARKodeEvolve; otherwise + SHOULD be called before the first call to arkEvolve; otherwise default values of reltol=1e-4 and abstol=1e-9 will be used, which may be entirely incorrect for a specific problem. - ARKodeSStolerances specifies scalar relative and absolute + arkSStolerances specifies scalar relative and absolute tolerances. - ARKodeSVtolerances specifies scalar relative tolerance and a + arkSVtolerances specifies scalar relative tolerance and a vector absolute tolerance (a potentially different absolute tolerance for each vector component). - ARKodeWFtolerances specifies a user-provides function (of type + arkWFtolerances specifies a user-provides function (of type ARKEwtFn) which will be called to set the error weight vector. ---------------------------------------------------------------*/ -int ARKodeSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) +int arkSStolerances(ARKodeMem ark_mem, sunrealtype reltol, sunrealtype abstol) { - /* unpack ark_mem */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) + /* Check inputs */ + if (ark_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__, @@ -288,22 +393,18 @@ int ARKodeSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) return (ARK_SUCCESS); } -int ARKodeSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) +int arkSVtolerances(ARKodeMem ark_mem, sunrealtype reltol, N_Vector abstol) { /* local variables */ sunrealtype abstolmin; - /* unpack ark_mem */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) + /* Check inputs */ + if (ark_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__, @@ -362,18 +463,14 @@ int ARKodeSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) return (ARK_SUCCESS); } -int ARKodeWFtolerances(void* arkode_mem, ARKEwtFn efun) +int arkWFtolerances(ARKodeMem ark_mem, ARKEwtFn efun) { - /* unpack ark_mem */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) + if (ark_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__, @@ -391,7 +488,7 @@ int ARKodeWFtolerances(void* arkode_mem, ARKEwtFn efun) } /*--------------------------------------------------------------- - ARKodeResStolerance, ARKodeResVtolerance, ARKodeResFtolerance: + arkResStolerance, arkResVtolerance, arkResFtolerance: These functions specify the absolute residual tolerance. Specification of the absolute residual tolerance is only @@ -402,37 +499,25 @@ int ARKodeWFtolerances(void* arkode_mem, ARKEwtFn efun) ARKODE; otherwise the default value of rabstol=1e-9 will be used, which may be entirely incorrect for a specific problem. - ARKodeResStolerances specifies a scalar residual tolerance. + arkResStolerances specifies a scalar residual tolerance. - ARKodeResVtolerances specifies a vector residual tolerance + arkResVtolerances specifies a vector residual tolerance (a potentially different absolute residual tolerance for each vector component). - ARKodeResFtolerances specifies a user-provides function (of + arkResFtolerances specifies a user-provides function (of type ARKRwtFn) which will be called to set the residual weight vector. ---------------------------------------------------------------*/ -int ARKodeResStolerance(void* arkode_mem, sunrealtype rabstol) +int arkResStolerance(ARKodeMem ark_mem, sunrealtype rabstol) { - /* unpack ark_mem */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) + /* Check inputs */ + if (ark_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__, @@ -474,30 +559,18 @@ int ARKodeResStolerance(void* arkode_mem, sunrealtype rabstol) return (ARK_SUCCESS); } -int ARKodeResVtolerance(void* arkode_mem, N_Vector rabstol) +int arkResVtolerance(ARKodeMem ark_mem, N_Vector rabstol) { /* local variables */ sunrealtype rabstolmin; - /* unpack ark_mem */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) + /* Check inputs */ + if (ark_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__, @@ -562,26 +635,14 @@ int ARKodeResVtolerance(void* arkode_mem, N_Vector rabstol) return (ARK_SUCCESS); } -int ARKodeResFtolerance(void* arkode_mem, ARKRwtFn rfun) +int arkResFtolerance(ARKodeMem ark_mem, ARKRwtFn rfun) { - /* unpack ark_mem */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) + if (ark_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__, @@ -612,17 +673,17 @@ int ARKodeResFtolerance(void* arkode_mem, ARKRwtFn rfun) } /*--------------------------------------------------------------- - ARKodeEvolve: + arkEvolve: 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 ARKodeEvolve is called for a successfully + The first time that arkEvolve is called for a successfully initialized problem, it computes a tentative initial step size. - ARKodeEvolve supports two modes as specified by itask: ARK_NORMAL and + arkEvolve 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 @@ -633,8 +694,8 @@ int ARKodeResFtolerance(void* arkode_mem, ARKRwtFn rfun) exactly the specified stop time, and hence interpolation of y(tout) is not required. ---------------------------------------------------------------*/ -int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask) +int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask) { long int nstloc; int retval, kflag, istate, ir; @@ -642,23 +703,18 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype troundoff, nrm; sunbooleantype inactive_roots; sunrealtype dsm; - int nflag, ncf, nef, constrfails; + int nflag, attempts, 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 */ - if (arkode_mem == NULL) + if (ark_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) @@ -692,9 +748,6 @@ int ARKodeEvolve(void* arkode_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) { @@ -709,11 +762,7 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, { ark_mem->tretlast = *tret = ark_mem->tcur; retval = arkInitialSetup(ark_mem, tout); - if (retval != ARK_SUCCESS) - { - SUNDIALS_MARK_FUNCTION_END(ARK_PROFILER); - return (retval); - } + if (retval != ARK_SUCCESS) { return (retval); } } /* perform stopping tests */ @@ -721,7 +770,6 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, { if (arkStopTests(ark_mem, tout, yout, tret, itask, &retval)) { - SUNDIALS_MARK_FUNCTION_END(ARK_PROFILER); return (retval); } } @@ -875,7 +923,7 @@ 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", + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkEvolve", "start-step", "step = %li, attempt = %i, h = %" RSYM ", tcur = %" RSYM, @@ -900,7 +948,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); + kflag = arkRelax(ark_mem, &relax_fails, &dsm, &nflag); if (kflag < 0) { break; } } @@ -940,7 +988,6 @@ int ARKodeEvolve(void* arkode_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); } @@ -1023,9 +1070,9 @@ 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 && ark_mem->interp) + if (ark_mem->tstopinterp) { - retval = ARKodeGetDky(ark_mem, ark_mem->tstop, 0, yout); + retval = arkGetDky(ark_mem, ark_mem->tstop, 0, yout); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, @@ -1054,25 +1101,17 @@ 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) { - if (ark_mem->interp) - { - 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; - } - else + retval = arkGetDky(ark_mem, tout, 0, yout); + if (retval != ARK_SUCCESS) { - N_VScale(ONE, ark_mem->yn, yout); - ark_mem->tretlast = *tret = ark_mem->tcur; + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + MSG_ARK_INTERPOLATION_FAIL, tout); + istate = retval; + break; } - ark_mem->next_h = ark_mem->hprime; - istate = ARK_SUCCESS; + ark_mem->tretlast = *tret = tout; + ark_mem->next_h = ark_mem->hprime; + istate = ARK_SUCCESS; break; } @@ -1088,13 +1127,11 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, } /* end looping for internal steps */ - /* stop profiler and return */ - SUNDIALS_MARK_FUNCTION_END(ARK_PROFILER); return (istate); } /*--------------------------------------------------------------- - ARKodeGetDky: + arkGetDky: This routine computes the k-th derivative of the interpolating polynomial at the time t and stores the result in the vector @@ -1106,29 +1143,25 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, the user through deg, unless higher-order derivatives are requested. - This function is called by ARKodeEvolve with k=0 and t=tout to + This function is called by arkEvolve 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 ARKodeGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) +int arkGetDky(ARKodeMem ark_mem, sunrealtype t, int k, N_Vector dky) { sunrealtype s, tfuzz, tp, tn1; int retval; - ARKodeMem ark_mem; - /* Check if ark_mem exists */ - if (arkode_mem == NULL) + /* Check all inputs for legality */ + if (ark_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__, @@ -1170,11 +1203,11 @@ int ARKodeGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) } /*--------------------------------------------------------------- - ARKodeFree: + arkFree: This routine frees the ARKODE infrastructure memory. ---------------------------------------------------------------*/ -void ARKodeFree(void** arkode_mem) +void arkFree(void** arkode_mem) { ARKodeMem ark_mem; @@ -1182,9 +1215,6 @@ void ARKodeFree(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); @@ -1204,13 +1234,14 @@ void ARKodeFree(void** arkode_mem) if (ark_mem->interp != NULL) { arkInterpFree(ark_mem, ark_mem->interp); - ark_mem->interp = NULL; + ark_mem->interp = NULL; + ark_mem->interp_type = -1; } /* free the root-finding module */ if (ark_mem->root_mem != NULL) { - (void)arkRootFree(ark_mem); + (void)arkRootFree(*arkode_mem); ark_mem->root_mem = NULL; } @@ -1225,28 +1256,233 @@ void ARKodeFree(void** arkode_mem) *arkode_mem = NULL; } +/*=============================================================== + Internal functions that may be replaced by the user + ===============================================================*/ + /*--------------------------------------------------------------- - ARKodePrintMem: + arkRwtSet - This routine outputs the ark_mem structure to a specified file - pointer. + 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. + + All the real work is done in the routines arkRwtSetSS, arkRwtSetSV. ---------------------------------------------------------------*/ -void ARKodePrintMem(void* arkode_mem, FILE* outfile) +int arkRwtSet(N_Vector y, N_Vector weight, void* data) { ARKodeMem ark_mem; + N_Vector My; + int flag = 0; - /* Check if ark_mem exists */ - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + /* 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) + { + case ARK_SS: flag = arkRwtSetSS(ark_mem, My, weight); break; + case ARK_SV: flag = arkRwtSetSV(ark_mem, My, weight); break; + } + + 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 arkEvolve 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; + 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; } - ark_mem = (ARKodeMem)arkode_mem; - /* if outfile==NULL, set it to stdout */ - if (outfile == NULL) { outfile = stdout; } + /* Indicate initialization is needed */ + ark_mem->initsetup = SUNTRUE; + ark_mem->init_type = init_type; + ark_mem->firststage = SUNTRUE; + + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + arkPrintMem: + This routine outputs the ark_mem structure to a specified file + pointer. + ---------------------------------------------------------------*/ +void arkPrintMem(ARKodeMem ark_mem, FILE* outfile) +{ /* output general values */ fprintf(outfile, "itol = %i\n", ark_mem->itol); fprintf(outfile, "ritol = %i\n", ark_mem->ritol); @@ -1310,8 +1546,7 @@ void ARKodePrintMem(void* arkode_mem, FILE* outfile) } /* output interpolation quantities */ - if (ark_mem->interp) { arkInterpPrintMem(ark_mem->interp, outfile); } - else { fprintf(outfile, "interpolation = NULL\n"); } + arkInterpPrintMem(ark_mem->interp, outfile); #ifdef SUNDIALS_DEBUG_PRINTVEC /* output vector quantities */ @@ -1338,438 +1573,366 @@ 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 - - /* Call stepper PrintMem function (if provided) */ - if (ark_mem->step_printmem) { ark_mem->step_printmem(ark_mem, outfile); } } -/*=============================================================== - Private internal functions - ===============================================================*/ - /*--------------------------------------------------------------- - arkCreate: + arkCheckTimestepper: - 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. + This routine checks if all required time stepper function + pointers have been supplied. If any of them is missing it + returns SUNFALSE. ---------------------------------------------------------------*/ -ARKodeMem arkCreate(SUNContext sunctx) +sunbooleantype arkCheckTimestepper(ARKodeMem ark_mem) { - int iret; - long int lenrw, leniw; - ARKodeMem ark_mem; - - if (!sunctx) + if ((ark_mem->step_init == NULL) || (ark_mem->step == NULL) || + (ark_mem->step_mem == NULL)) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_NULL_SUNCTX); - return (NULL); + return (SUNFALSE); } + return (SUNTRUE); +} - ark_mem = NULL; - ark_mem = (ARKodeMem)malloc(sizeof(struct ARKodeMemRec)); - if (ark_mem == NULL) +/*--------------------------------------------------------------- + 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)) { - arkProcessError(NULL, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - MSG_ARK_ARKMEM_FAIL); - return (NULL); + return (SUNFALSE); } + else { return (SUNTRUE); } +} - /* 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; +/*--------------------------------------------------------------- + arkAllocVec and arkAllocVecArray: - /* 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_setautonomous = 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; + 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. - /* Initialize root finding variables */ - ark_mem->root_mem = NULL; + This routine also updates the optional outputs lrw and liw, which + are (respectively) the lengths of the overall ARKODE real and + integer work spaces. - /* 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) + 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) { - arkProcessError(NULL, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "Allocation of step controller object failed"); - ARKodeFree((void**)&ark_mem); - return (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; + } } - 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; - ark_mem->interp_degree = ARK_INTERP_MAX_DEGREE; - - /* 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; + return (SUNTRUE); +} - /* Set default values for integrator optional inputs */ - iret = ARKodeSetDefaults(ark_mem); - if (iret != ARK_SUCCESS) +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) { - arkProcessError(NULL, 0, __LINE__, __func__, __FILE__, - "Error setting default solver options"); - ARKodeFree((void**)&ark_mem); - return (NULL); + *v = N_VCloneVectorArray(count, tmpl); + if (*v == NULL) { return (SUNFALSE); } + *lrw += count * lrw1; + *liw += count * liw1; } - - /* Return pointer to ARKODE memory block */ - return (ark_mem); + return (SUNTRUE); } /*--------------------------------------------------------------- - 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. + arkFreeVec and arkFreeVecArray: - All the real work is done in the routines arkRwtSetSS, arkRwtSetSV. + 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. ---------------------------------------------------------------*/ -int arkRwtSet(N_Vector y, N_Vector weight, void* data) +void arkFreeVec(ARKodeMem ark_mem, N_Vector* v) { - 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) + if (*v != 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); + N_VDestroy(*v); + *v = NULL; + ark_mem->lrw -= ark_mem->lrw1; + ark_mem->liw -= ark_mem->liw1; } +} - /* call appropriate routine to fill rwt */ - switch (ark_mem->ritol) +void arkFreeVecArray(int count, N_Vector** v, sunindextype lrw1, long int* lrw, + sunindextype liw1, long int* liw) +{ + if (*v != NULL) { - case ARK_SS: flag = arkRwtSetSS(ark_mem, My, weight); break; - case ARK_SV: flag = arkRwtSetSV(ark_mem, My, weight); break; + N_VDestroyVectorArray(*v, count); + *v = NULL; + *lrw -= count * lrw1; + *liw -= count * liw1; } - - return (flag); } /*--------------------------------------------------------------- - arkInit: + arkResizeVec and arkResizeVecArray: - 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). + 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. ---------------------------------------------------------------*/ -int arkInit(ARKodeMem ark_mem, sunrealtype t0, N_Vector y0, int init_type) +sunbooleantype arkResizeVec(ARKodeMem ark_mem, ARKVecResizeFn resize, + void* resize_data, sunindextype lrw_diff, + sunindextype liw_diff, N_Vector tmpl, N_Vector* v) { - 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) + if (*v != NULL) { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_NULL_Y0); - return (ARK_ILL_INPUT); + 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); +} - /* Check if reset was called before the first Evolve call */ - if (init_type == RESET_INIT && !(ark_mem->initialized)) - { - init_type = FIRST_INIT; - } +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; - /* Check if allocations have been done i.e., is this first init call */ - if (ark_mem->MallocDone == SUNFALSE) + if (*v != NULL) { - /* Test if all required time stepper operations are implemented */ - stepperOK = arkCheckTimestepper(ark_mem); - if (!stepperOK) + if (resize == NULL) { - 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); + N_VDestroyVectorArray(*v, count); + *v = NULL; + *v = N_VCloneVectorArray(count, tmpl); + if (*v == NULL) { return (SUNFALSE); } } - - /* Set space requirements for one N_Vector */ - if (y0->ops->nvspace != NULL) { N_VSpace(y0, &lrw1, &liw1); } else { - lrw1 = 0; - liw1 = 0; + for (i = 0; i < count; i++) + { + if (resize((*v)[i], tmpl, resize_data)) { return (SUNFALSE); } + } } - ark_mem->lrw1 = lrw1; - ark_mem->liw1 = liw1; + *lrw += count * lrw_diff; + *liw += count * liw_diff; + } + return (SUNTRUE); +} - /* 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); - } +/*--------------------------------------------------------------- + arkAllocVectors: - /* All allocations are complete */ - ark_mem->MallocDone = SUNTRUE; - } + 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. - /* All allocation and error checking is complete at this point */ + 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); } - /* Copy the input parameters into ARKODE state */ - ark_mem->tcur = t0; - ark_mem->tn = t0; + /* Set rwt to point at ewt */ + if (ark_mem->rwt_is_ewt) { ark_mem->rwt = ark_mem->ewt; } - /* Initialize yn */ - N_VScale(ONE, y0, ark_mem->yn); - ark_mem->fn_is_current = SUNFALSE; + /* Allocate yn if needed */ + if (!arkAllocVec(ark_mem, tmpl, &ark_mem->yn)) { return (SUNFALSE); } - /* Clear any previous 'tstop' */ - ark_mem->tstopset = SUNFALSE; + /* Allocate tempv1 if needed */ + if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv1)) { return (SUNFALSE); } - /* Initializations on (re-)initialization call, skip on reset */ - if (init_type == FIRST_INIT) + /* Allocate tempv2 if needed */ + if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv2)) { return (SUNFALSE); } + + /* Allocate tempv3 if needed */ + if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv3)) { return (SUNFALSE); } + + /* Allocate tempv4 if needed */ + if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv4)) { return (SUNFALSE); } + + return (SUNTRUE); +} + +/*--------------------------------------------------------------- + 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. + + 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) +{ + /* Vabstol */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->Vabstol)) { - /* 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; + return (SUNFALSE); + } - /* Initial, old, and next step sizes */ - ark_mem->h0u = ZERO; - ark_mem->hold = ZERO; - ark_mem->next_h = ZERO; + /* VRabstol */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->VRabstol)) + { + return (SUNFALSE); + } - /* Tolerance scale factor */ - ark_mem->tolsf = ONE; + /* ewt */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->ewt)) + { + return (SUNFALSE); + } - /* Reset error controller object */ - retval = SUNAdaptController_Reset(ark_mem->hadapt_mem->hcontroller); - if (retval != SUN_SUCCESS) + /* 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)) { - arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, __FILE__, - "Unable to reset error controller object"); - return (ARK_CONTROLLER_ERR); + return (SUNFALSE); } + } - /* Adaptivity counters */ - ark_mem->hadapt_mem->nst_acc = 0; - ark_mem->hadapt_mem->nst_exp = 0; + /* yn */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->yn)) + { + return (SUNFALSE); + } - /* 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; + /* fn */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->fn)) + { + return (SUNFALSE); + } - /* Indicate that initialization has not been done before */ - ark_mem->initialized = SUNFALSE; + /* tempv* */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->tempv1)) + { + return (SUNFALSE); } - /* Indicate initialization is needed */ - ark_mem->initsetup = SUNTRUE; - ark_mem->init_type = init_type; - ark_mem->firststage = SUNTRUE; + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->tempv2)) + { + return (SUNFALSE); + } - return (ARK_SUCCESS); -} + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->tempv3)) + { + return (SUNFALSE); + } -/*--------------------------------------------------------------- - arkCheckTimestepper: + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->tempv4)) + { + return (SUNFALSE); + } - 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)) + /* constraints */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->constraints)) { return (SUNFALSE); } + return (SUNTRUE); } /*--------------------------------------------------------------- - arkCheckNvector: + arkFreeVectors - This routine checks if all required vector operations are - present. If any of them is missing it returns SUNFALSE. + This routine frees the ARKODE vectors allocated in both + arkAllocVectors and arkAllocRKVectors. ---------------------------------------------------------------*/ -sunbooleantype arkCheckNvector(N_Vector tmpl) /* to be updated?? */ +void arkFreeVectors(ARKodeMem ark_mem) { - 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); } + 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); } /*--------------------------------------------------------------- @@ -1896,67 +2059,27 @@ 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)) + /* Fill initial interpolation data (if needed) */ + if (ark_mem->interp != NULL) { - 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; + retval = arkInterpInit(ark_mem, ark_mem->interp, ark_mem->tcur); + if (retval != 0) { return (retval); } } - /* Fill initial interpolation data (if needed) */ - if (ark_mem->interp != NULL) + /* If fullrhs will be called (to estimate initial step, explicit steppers, Hermite + interpolation module, and possibly (but not always) arkRootCheck1), then + ensure that it is provided, and space is allocated for fn. */ + if (ark_mem->call_fullrhs || (ark_mem->h0u == ZERO && ark_mem->hin == ZERO) || + ark_mem->root_mem) { - /* Stepper init may have limited the interpolation degree */ - if (arkInterpSetDegree(ark_mem, ark_mem->interp, ark_mem->interp_degree)) + if (!ark_mem->step_fullrhs) { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Unable to update interpolation polynomial degree"); + MSG_ARK_MISSING_FULLRHS); 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 - interpolation module, and possibly (but not always) arkRootCheck1), then - ensure that it is provided, and space is allocated for fn. */ - if (ark_mem->call_fullrhs || (ark_mem->h0u == ZERO && ark_mem->hin == ZERO) || - ark_mem->root_mem) - { - if (!ark_mem->step_fullrhs) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_MISSING_FULLRHS); - return ARK_ILL_INPUT; - } - - if (!arkAllocVec(ark_mem, ark_mem->yn, &ark_mem->fn)) + if (!arkAllocVec(ark_mem, ark_mem->yn, &ark_mem->fn)) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, MSG_ARK_MEM_FAIL); @@ -2186,9 +2309,9 @@ 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 && ark_mem->interp) + if (ark_mem->tstopinterp) { - *ier = ARKodeGetDky(ark_mem, ark_mem->tstop, 0, yout); + *ier = arkGetDky(ark_mem, ark_mem->tstop, 0, yout); if (*ier != ARK_SUCCESS) { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, @@ -2217,22 +2340,14 @@ 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)) { - if (ark_mem->interp) - { - *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 + ark_mem->tretlast = *tret = tout; + *ier = arkGetDky(ark_mem, tout, 0, yout); + if (*ier != ARK_SUCCESS) { - N_VScale(ONE, ark_mem->yn, yout); - ark_mem->tretlast = *tret = ark_mem->tcur; + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_BAD_TOUT, tout); + *ier = ARK_ILL_INPUT; + return (1); } *ier = ARK_SUCCESS; return (1); @@ -2257,7 +2372,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 ARKodeEvolve at the first call or the + is either the value passed to arkEvolve 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 @@ -2453,6 +2568,13 @@ 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); @@ -2686,814 +2808,487 @@ int arkHandleFailure(ARKodeMem ark_mem, int flag) "this to the Sundials developers at " "sundials-users@llnl.gov"); return (ARK_UNRECOGNIZED_ERROR); - } - - return (flag); -} - -/*--------------------------------------------------------------- - arkEwtSetSS - - This routine is responsible for setting the error weight vector - ewt as follows: - - ewt[i] = 1 / (reltol * SUNRabs(ycur[i]) + abstol), i=0,...,neq-1 - - When the absolute tolerance is zero, it tests for non-positive - components before inverting. arkEwtSetSS returns 0 if ewt is - successfully set to a positive vector and -1 otherwise. In the - latter case, ewt is considered undefined. - ---------------------------------------------------------------*/ -int arkEwtSetSS(N_Vector ycur, N_Vector weight, void* arkode_mem) -{ - ARKodeMem ark_mem = (ARKodeMem)arkode_mem; - N_VAbs(ycur, ark_mem->tempv1); - N_VScale(ark_mem->reltol, ark_mem->tempv1, ark_mem->tempv1); - N_VAddConst(ark_mem->tempv1, ark_mem->Sabstol, ark_mem->tempv1); - if (ark_mem->atolmin0) - { - if (N_VMin(ark_mem->tempv1) <= ZERO) { return (-1); } - } - N_VInv(ark_mem->tempv1, weight); - return (0); -} - -/*--------------------------------------------------------------- - arkEwtSetSV - - This routine is responsible for setting the error weight vector - ewt as follows: - - ewt[i] = 1 / (reltol * SUNRabs(ycur[i]) + abstol[i]), i=0,...,neq-1 - - When any absolute tolerance is zero, it tests for non-positive - components before inverting. arkEwtSetSV returns 0 if ewt is - successfully set to a positive vector and -1 otherwise. In the - latter case, ewt is considered undefined. - ---------------------------------------------------------------*/ -int arkEwtSetSV(N_Vector ycur, N_Vector weight, void* arkode_mem) -{ - ARKodeMem ark_mem = (ARKodeMem)arkode_mem; - N_VAbs(ycur, ark_mem->tempv1); - N_VLinearSum(ark_mem->reltol, ark_mem->tempv1, ONE, ark_mem->Vabstol, - ark_mem->tempv1); - if (ark_mem->atolmin0) - { - if (N_VMin(ark_mem->tempv1) <= ZERO) { return (-1); } - } - N_VInv(ark_mem->tempv1, weight); - return (0); -} - -/*--------------------------------------------------------------- - arkEwtSetSmallReal - - This routine is responsible for setting the error weight vector - ewt as follows: - - ewt[i] = SUN_SMALL_REAL - - This is routine is only used with explicit time stepping with - a fixed step size to avoid a potential too much error return - to the user. - ---------------------------------------------------------------*/ -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); -} - -/*--------------------------------------------------------------- - arkRwtSetSS - - This routine sets rwt as decribed 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 - latter case, rwt is considered undefined. - ---------------------------------------------------------------*/ -int arkRwtSetSS(ARKodeMem ark_mem, N_Vector My, N_Vector weight) -{ - N_VAbs(My, ark_mem->tempv1); - N_VScale(ark_mem->reltol, ark_mem->tempv1, ark_mem->tempv1); - N_VAddConst(ark_mem->tempv1, ark_mem->SRabstol, ark_mem->tempv1); - if (ark_mem->Ratolmin0) - { - if (N_VMin(ark_mem->tempv1) <= ZERO) { return (-1); } - } - N_VInv(ark_mem->tempv1, weight); - return (0); -} - -/*--------------------------------------------------------------- - arkRwtSetSV - - This routine sets rwt as decribed 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 - latter case, rwt is considered undefined. - ---------------------------------------------------------------*/ -int arkRwtSetSV(ARKodeMem ark_mem, N_Vector My, N_Vector weight) -{ - N_VAbs(My, ark_mem->tempv1); - N_VLinearSum(ark_mem->reltol, ark_mem->tempv1, ONE, ark_mem->VRabstol, - ark_mem->tempv1); - if (ark_mem->Ratolmin0) - { - if (N_VMin(ark_mem->tempv1) <= ZERO) { return (-1); } - } - N_VInv(ark_mem->tempv1, weight); - return (0); -} - -/*--------------------------------------------------------------- - arkExpStab is the default explicit stability estimation function - ---------------------------------------------------------------*/ -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 */ - *hstab = SUN_RCONST(0.0); - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - arkPredict_MaximumOrder - - This routine predicts the nonlinear implicit stage solution - using the ARKode interpolation module. This uses the - highest-degree interpolant supported by the module (stored - in the interpolation module). - ---------------------------------------------------------------*/ -int arkPredict_MaximumOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess) -{ - /* 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); - } - - /* call the interpolation module to do the work */ - return (arkInterpEvaluate(ark_mem, ark_mem->interp, tau, 0, - ARK_INTERP_MAX_DEGREE, yguess)); -} - -/*--------------------------------------------------------------- - arkPredict_VariableOrder - - This routine predicts the nonlinear implicit stage solution - using the ARKODE interpolation module. The degree of the - interpolant is based on the level of extrapolation outside the - preceding time step. - ---------------------------------------------------------------*/ -int arkPredict_VariableOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess) -{ - int ord; - sunrealtype tau_tol = HALF; - sunrealtype tau_tol2 = SUN_RCONST(0.75); - - /* 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 = 3; } - else if (tau <= tau_tol2) { ord = 2; } - else { ord = 1; } - - /* call the interpolation module to do the work */ - return (arkInterpEvaluate(ark_mem, ark_mem->interp, tau, 0, ord, yguess)); -} - -/*--------------------------------------------------------------- - arkPredict_CutoffOrder - - This routine predicts the nonlinear implicit stage solution - using the ARKODE interpolation module. If the level of - extrapolation is small enough, it uses the maximum degree - polynomial available (stored in the interpolation module - structure); otherwise it uses a linear polynomial. - ---------------------------------------------------------------*/ -int arkPredict_CutoffOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess) -{ - int ord; - sunrealtype tau_tol = HALF; - - /* 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); + return (flag); } /*--------------------------------------------------------------- - 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); } + arkEwtSetSS - /* The nonlinear soln. failed; increment ncfn */ - ark_mem->ncfn++; + This routine is responsible for setting the error weight vector + ewt as follows: - /* If fixed time stepping, then return with convergence failure */ - if (ark_mem->fixedstep) { return (ARK_CONV_FAILURE); } + ewt[i] = 1 / (reltol * SUNRabs(ycur[i]) + abstol), i=0,...,neq-1 - /* Otherwise, access adaptivity structure */ - if (ark_mem->hadapt_mem == NULL) + When the absolute tolerance is zero, it tests for non-positive + components before inverting. arkEwtSetSS returns 0 if ewt is + successfully set to a positive vector and -1 otherwise. In the + latter case, ewt is considered undefined. + ---------------------------------------------------------------*/ +int arkEwtSetSS(N_Vector ycur, N_Vector weight, void* arkode_mem) +{ + ARKodeMem ark_mem = (ARKodeMem)arkode_mem; + N_VAbs(ycur, ark_mem->tempv1); + N_VScale(ark_mem->reltol, ark_mem->tempv1, ark_mem->tempv1); + N_VAddConst(ark_mem->tempv1, ark_mem->Sabstol, ark_mem->tempv1); + if (ark_mem->atolmin0) { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARKADAPT_NO_MEM); - return (ARK_MEM_NULL); + if (N_VMin(ark_mem->tempv1) <= ZERO) { return (-1); } } - hadapt_mem = ark_mem->hadapt_mem; + N_VInv(ark_mem->tempv1, weight); + return (0); +} - /* 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); } - } +/*--------------------------------------------------------------- + arkEwtSetSV - /* At this point, nflag = CONV_FAIL or RHSFUNC_RECVR; increment ncf */ - (*ncfPtr)++; - hadapt_mem->etamax = ONE; + This routine is responsible for setting the error weight vector + ewt as follows: - /* 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)) + ewt[i] = 1 / (reltol * SUNRabs(ycur[i]) + abstol[i]), i=0,...,neq-1 + + When any absolute tolerance is zero, it tests for non-positive + components before inverting. arkEwtSetSV returns 0 if ewt is + successfully set to a positive vector and -1 otherwise. In the + latter case, ewt is considered undefined. + ---------------------------------------------------------------*/ +int arkEwtSetSV(N_Vector ycur, N_Vector weight, void* arkode_mem) +{ + ARKodeMem ark_mem = (ARKodeMem)arkode_mem; + N_VAbs(ycur, ark_mem->tempv1); + N_VLinearSum(ark_mem->reltol, ark_mem->tempv1, ONE, ark_mem->Vabstol, + ark_mem->tempv1); + if (ark_mem->atolmin0) { - if (*nflagPtr == CONV_FAIL) { return (ARK_CONV_FAILURE); } - if (*nflagPtr == RHSFUNC_RECVR) { return (ARK_REPTD_RHSFUNC_ERR); } + if (N_VMin(ark_mem->tempv1) <= ZERO) { return (-1); } } - - /* 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); + N_VInv(ark_mem->tempv1, weight); + return (0); } /*--------------------------------------------------------------- - 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); } + arkEwtSetSmallReal - /* Constraints not met */ + This routine is responsible for setting the error weight vector + ewt as follows: - /* Update total fails and fails in current step */ - ark_mem->nconstrfails++; - (*constrfails)++; + ewt[i] = SUN_SMALL_REAL - /* Return with error if reached max fails in a step */ - if (*constrfails == ark_mem->maxconstrfails) { return (ARK_CONSTR_FAIL); } + This is routine is only used with explicit time stepping with + 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) +{ + N_VConst(SUN_SMALL_REAL, weight); + return (ARK_SUCCESS); +} - /* Return with error if using fixed step sizes */ - if (ark_mem->fixedstep) { return (ARK_CONSTR_FAIL); } +/*--------------------------------------------------------------- + arkRwtSetSS - /* Return with error if |h| == hmin */ - if (SUNRabs(ark_mem->h) <= ark_mem->hmin * ONEPSM) + This routine sets rwt as decribed 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 + latter case, rwt is considered undefined. + ---------------------------------------------------------------*/ +int arkRwtSetSS(ARKodeMem ark_mem, N_Vector My, N_Vector weight) +{ + N_VAbs(My, ark_mem->tempv1); + N_VScale(ark_mem->reltol, ark_mem->tempv1, ark_mem->tempv1); + N_VAddConst(ark_mem->tempv1, ark_mem->SRabstol, ark_mem->tempv1); + if (ark_mem->Ratolmin0) { - return (ARK_CONSTR_FAIL); + if (N_VMin(ark_mem->tempv1) <= ZERO) { return (-1); } } + N_VInv(ark_mem->tempv1, weight); + return (0); +} - /* 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; +/*--------------------------------------------------------------- + arkRwtSetSV - /* Return to reattempt the step */ - return (CONSTR_RECVR); + This routine sets rwt as decribed 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 + latter case, rwt is considered undefined. + ---------------------------------------------------------------*/ +int arkRwtSetSV(ARKodeMem ark_mem, N_Vector My, N_Vector weight) +{ + N_VAbs(My, ark_mem->tempv1); + N_VLinearSum(ark_mem->reltol, ark_mem->tempv1, ONE, ark_mem->VRabstol, + ark_mem->tempv1); + if (ark_mem->Ratolmin0) + { + if (N_VMin(ark_mem->tempv1) <= ZERO) { return (-1); } + } + N_VInv(ark_mem->tempv1, weight); + return (0); } /*--------------------------------------------------------------- - arkCheckTemporalError + arkExpStab is the default explicit stability estimation function + ---------------------------------------------------------------*/ +int arkExpStab(N_Vector y, sunrealtype t, sunrealtype* hstab, void* data) +{ + /* explicit stability not used by default, + set to zero to disable */ + *hstab = SUN_RCONST(0.0); - 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. + return (ARK_SUCCESS); +} - Returns ARK_SUCCESS if the test passes. +/*--------------------------------------------------------------- + arkPredict_MaximumOrder - 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) + This routine predicts the nonlinear implicit stage solution + using the ARKode interpolation module. This uses the + highest-degree interpolant supported by the module (stored + in the interpolation module). + ---------------------------------------------------------------*/ +int arkPredict_MaximumOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess) { - int retval; - sunrealtype ttmp; - ARKodeHAdaptMem hadapt_mem; - - /* Access hadapt_mem structure */ - if (ark_mem->hadapt_mem == NULL) + /* 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__, - MSG_ARKADAPT_NO_MEM); + "ARKodeInterpMem structure is NULL"); return (ARK_MEM_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; - 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 - 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; + /* call the interpolation module to do the work */ + return (arkInterpEvaluate(ark_mem, ark_mem->interp, tau, 0, + ARK_INTERP_MAX_DEGREE, yguess)); +} - /* At maxnef failures, return ARK_ERR_FAILURE */ - if (*nefPtr == ark_mem->maxnef) { return (ARK_ERR_FAILURE); } +/*--------------------------------------------------------------- + arkPredict_VariableOrder - /* Set etamax=1 to prevent step size increase at end of this step */ - hadapt_mem->etamax = ONE; + This routine predicts the nonlinear implicit stage solution + using the ARKODE interpolation module. The degree of the + interpolant is based on the level of extrapolation outside the + preceding time step. + ---------------------------------------------------------------*/ +int arkPredict_VariableOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess) +{ + int ord; + sunrealtype tau_tol = 0.5; + sunrealtype tau_tol2 = 0.75; - /* Enforce failure bounds on eta */ - if (*nefPtr >= hadapt_mem->small_nef) + /* verify that ark_mem and interpolation structure are provided */ + if (ark_mem == NULL) { - ark_mem->eta = SUNMIN(ark_mem->eta, hadapt_mem->etamxf); + 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); } - /* 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); + /* set the polynomial order based on tau input */ + if (tau <= tau_tol) { ord = 3; } + else if (tau <= tau_tol2) { ord = 2; } + else { ord = 1; } - return (TRY_AGAIN); + /* call the interpolation module to do the work */ + return (arkInterpEvaluate(ark_mem, ark_mem->interp, tau, 0, ord, yguess)); } /*--------------------------------------------------------------- - arkAllocVec and arkAllocVecArray: - - 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. - - This routine also updates the optional outputs lrw and liw, which - are (respectively) the lengths of the overall ARKODE real and - integer work spaces. + arkPredict_CutoffOrder - SUNTRUE is returned if the allocation is successful (or if the - target vector or vector array already exists) otherwise SUNFALSE - is retured. + This routine predicts the nonlinear implicit stage solution + using the ARKODE interpolation module. If the level of + extrapolation is small enough, it uses the maximum degree + polynomial available (stored in the interpolation module + structure); otherwise it uses a linear polynomial. ---------------------------------------------------------------*/ -sunbooleantype arkAllocVec(ARKodeMem ark_mem, N_Vector tmpl, N_Vector* v) +int arkPredict_CutoffOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess) { - /* allocate the new vector if necessary */ - if (*v == NULL) + int ord; + sunrealtype tau_tol = 0.5; + + /* verify that ark_mem and interpolation structure are provided */ + if (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; - } + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "ARKodeMem structure is NULL"); + return (ARK_MEM_NULL); } - return (SUNTRUE); -} - -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) + if (ark_mem->interp == NULL) { - *v = N_VCloneVectorArray(count, tmpl); - if (*v == NULL) { return (SUNFALSE); } - *lrw += count * lrw1; - *liw += count * liw1; + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "ARKodeInterpMem structure is NULL"); + return (ARK_MEM_NULL); } - return (SUNTRUE); + + /* 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)); } /*--------------------------------------------------------------- - arkFreeVec and arkFreeVecArray: + arkPredict_Bootstrap - 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. + 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). ---------------------------------------------------------------*/ -void arkFreeVec(ARKodeMem ark_mem, N_Vector* v) +int arkPredict_Bootstrap(ARKodeMem ark_mem, sunrealtype hj, sunrealtype tau, + int nvec, sunrealtype* cvals, N_Vector* Xvecs, + N_Vector yguess) { - if (*v != NULL) + sunrealtype a0, a1, a2; + int i, retval; + + /* verify that ark_mem and interpolation structure are provided */ + if (ark_mem == NULL) { - N_VDestroy(*v); - *v = NULL; - ark_mem->lrw -= ark_mem->lrw1; - ark_mem->liw -= ark_mem->liw1; + 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); } -} -void arkFreeVecArray(int count, N_Vector** v, sunindextype lrw1, long int* lrw, - sunindextype liw1, long int* liw) -{ - if (*v != 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++) { - N_VDestroyVectorArray(*v, count); - *v = NULL; - *lrw -= count * lrw1; - *liw -= count * liw1; + 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); } /*--------------------------------------------------------------- - arkResizeVec and arkResizeVecArray: + arkCheckConvergence - 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. + This routine checks the return flag from the time-stepper's + "step" routine for algebraic solver convergence issues. - 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) + 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) { - if (*v != NULL) + 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 (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; + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARKADAPT_NO_MEM); + return (ARK_MEM_NULL); } - return (SUNTRUE); -} + hadapt_mem = ark_mem->hadapt_mem; -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 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); } + } - if (*v != NULL) + /* 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 (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; + if (*nflagPtr == CONV_FAIL) { return (ARK_CONV_FAILURE); } + if (*nflagPtr == RHSFUNC_RECVR) { return (ARK_REPTD_RHSFUNC_ERR); } } - return (SUNTRUE); + + /* 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); } /*--------------------------------------------------------------- - arkAllocVectors: + arkCheckConstraints - 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 determines if the constraints of the problem + are satisfied by the proposed step - If all memory allocations are successful, arkAllocVectors - returns SUNTRUE, otherwise it returns SUNFALSE. - ---------------------------------------------------------------*/ -sunbooleantype arkAllocVectors(ARKodeMem ark_mem, N_Vector tmpl) + Returns ARK_SUCCESS if successful, otherwise CONSTR_RECVR + --------------------------------------------------------------*/ +int arkCheckConstraints(ARKodeMem ark_mem, int* constrfails, int* nflag) { - /* Allocate ewt if needed */ - if (!arkAllocVec(ark_mem, tmpl, &ark_mem->ewt)) { return (SUNFALSE); } + sunbooleantype constraintsPassed; + N_Vector mm = ark_mem->tempv4; + N_Vector tmp = ark_mem->tempv3; - /* Set rwt to point at ewt */ - if (ark_mem->rwt_is_ewt) { ark_mem->rwt = ark_mem->ewt; } + /* 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); } - /* Allocate yn if needed */ - if (!arkAllocVec(ark_mem, tmpl, &ark_mem->yn)) { return (SUNFALSE); } + /* Constraints not met */ - /* Allocate tempv1 if needed */ - if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv1)) { return (SUNFALSE); } + /* Update total fails and fails in current step */ + ark_mem->nconstrfails++; + (*constrfails)++; - /* Allocate tempv2 if needed */ - if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv2)) { return (SUNFALSE); } + /* Return with error if reached max fails in a step */ + if (*constrfails == ark_mem->maxconstrfails) { return (ARK_CONSTR_FAIL); } - /* Allocate tempv3 if needed */ - if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv3)) { return (SUNFALSE); } + /* Return with error if using fixed step sizes */ + if (ark_mem->fixedstep) { return (ARK_CONSTR_FAIL); } - /* Allocate tempv4 if needed */ - if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv4)) { return (SUNFALSE); } + /* Return with error if |h| == hmin */ + if (SUNRabs(ark_mem->h) <= ark_mem->hmin * ONEPSM) + { + return (ARK_CONSTR_FAIL); + } - return (SUNTRUE); -} + /* 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); -/*--------------------------------------------------------------- - arkResizeVectors: + /* Signal for Jacobian/preconditioner setup */ + *nflag = PREV_CONV_FAIL; - 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. + /* Return to reattempt the step */ + return (CONSTR_RECVR); +} - 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) -{ - /* Vabstol */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->Vabstol)) - { - return (SUNFALSE); - } +/*--------------------------------------------------------------- + arkCheckTemporalError - /* VRabstol */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->VRabstol)) - { - return (SUNFALSE); - } + 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. - /* ewt */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->ewt)) - { - return (SUNFALSE); - } + Returns ARK_SUCCESS if the test passes. - /* 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 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; - /* yn */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->yn)) + /* Access hadapt_mem structure */ + if (ark_mem->hadapt_mem == NULL) { - return (SUNFALSE); + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARKADAPT_NO_MEM); + return (ARK_MEM_NULL); } + hadapt_mem = ark_mem->hadapt_mem; - /* fn */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->fn)) - { - return (SUNFALSE); - } + /* 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((void*)ark_mem, hadapt_mem, ark_mem->ycur, ttmp, ark_mem->h, + dsm, nsttmp); + if (retval != ARK_SUCCESS) { return (ARK_ERR_FAILURE); } - /* tempv* */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->tempv1)) - { - 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); - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->tempv2)) - { - return (SUNFALSE); - } + /* If est. local error norm dsm passes test, return ARK_SUCCESS */ + if (dsm <= ONE) { return (ARK_SUCCESS); } - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->tempv3)) - { - return (SUNFALSE); - } + /* Test failed; increment counters, set nflag */ + (*nefPtr)++; + ark_mem->netf++; + *nflagPtr = PREV_ERR_FAIL; - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->tempv4)) - { - return (SUNFALSE); - } + /* At maxnef failures, return ARK_ERR_FAILURE */ + if (*nefPtr == ark_mem->maxnef) { return (ARK_ERR_FAILURE); } - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->tempv5)) - { - return (SUNFALSE); - } + /* Set etamax=1 to prevent step size increase at end of this step */ + hadapt_mem->etamax = ONE; - /* constraints */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->constraints)) + /* Enforce failure bounds on eta */ + if (*nefPtr >= hadapt_mem->small_nef) { - return (SUNFALSE); + ark_mem->eta = SUNMIN(ark_mem->eta, hadapt_mem->etamxf); } - return (SUNTRUE); -} - -/*--------------------------------------------------------------- - arkFreeVectors + /* 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); - 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->tempv5); - arkFreeVec(ark_mem, &ark_mem->yn); - arkFreeVec(ark_mem, &ark_mem->fn); - arkFreeVec(ark_mem, &ark_mem->Vabstol); - arkFreeVec(ark_mem, &ark_mem->constraints); + return (TRY_AGAIN); } /*--------------------------------------------------------------- diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index 7fef0ec2ae..e10db72d5a 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 ARKodeSetDefaults) */ + /* initialize values (default parameters are set in arkSetDefaults) */ memset(hadapt_mem, 0, sizeof(struct ARKodeHAdaptMemRec)); hadapt_mem->nst_acc = 0; hadapt_mem->nst_exp = 0; @@ -91,12 +91,20 @@ void arkPrintAdaptMem(ARKodeHAdaptMem hadapt_mem, FILE* outfile) computes and sets the value of ark_eta inside of the ARKodeMem data structure. ---------------------------------------------------------------*/ -int arkAdapt(ARKodeMem ark_mem, ARKodeHAdaptMem hadapt_mem, N_Vector ycur, - sunrealtype tcur, sunrealtype hcur, sunrealtype dsm) +int arkAdapt(void* arkode_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 7dd9460a1e..9f96027ca4 100644 --- a/src/arkode/arkode_adapt_impl.h +++ b/src/arkode/arkode_adapt_impl.h @@ -22,8 +22,6 @@ #include <stdarg.h> #include <sundials/sundials_adaptcontroller.h> -#include "arkode_types_impl.h" - #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { #endif @@ -43,24 +41,26 @@ extern "C" { #define HFIXED_LB SUN_RCONST(1.0) /* CVODE uses 1.0 */ #define HFIXED_UB SUN_RCONST(1.5) /* CVODE uses 1.5 */ -/* 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 +#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 */ /*=============================================================== ARKODE Time Step Adaptivity Data Structure @@ -108,8 +108,8 @@ 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); +int arkAdapt(void* arkode_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 5f91285edb..921f13bf47 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -21,15 +21,22 @@ #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 +/* TryStep step result flags */ +#define TRYSTEP_FAILED -1 +#define TRYSTEP_SUCCESS +0 +#define TRYSTEP_ADAPT +1 + /*=============================================================== - Exported functions + ARKStep Exported functions -- Required ===============================================================*/ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, @@ -89,68 +96,33 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, MSG_ARK_ARKMEM_FAIL); - ARKodeFree((void**)&ark_mem); + ARKStepFree((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_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_setautonomous = arkStep_SetAutonomous; - 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); + 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); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Error setting default solver options"); - ARKodeFree((void**)&ark_mem); + ARKStepFree((void**)&ark_mem); return (NULL); } @@ -165,17 +137,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))) { - ARKodeFree((void**)&ark_mem); + ARKStepFree((void**)&ark_mem); return (NULL); } if (!arkAllocVec(ark_mem, y0, &(step_mem->zpred))) { - ARKodeFree((void**)&ark_mem); + ARKStepFree((void**)&ark_mem); return (NULL); } if (!arkAllocVec(ark_mem, y0, &(step_mem->zcor))) { - ARKodeFree((void**)&ark_mem); + ARKStepFree((void**)&ark_mem); return (NULL); } @@ -196,15 +168,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"); - ARKodeFree((void**)&ark_mem); + ARKStepFree((void**)&ark_mem); return (NULL); } - retval = ARKodeSetNonlinearSolver(ark_mem, NLS); + retval = ARKStepSetNonlinearSolver(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); + ARKStepFree((void**)&ark_mem); return (NULL); } step_mem->ownNLS = SUNTRUE; @@ -250,22 +222,147 @@ 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) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Unable to initialize main ARKODE infrastructure"); - ARKodeFree((void**)&ark_mem); + ARKStepFree((void**)&ark_mem); return (NULL); } return ((void*)ark_mem); } +/*--------------------------------------------------------------- + ARKStepResize: + + 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) +{ + 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); + if (retval != ARK_SUCCESS) { return (retval); } + + /* Determing 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 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)) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Unable to resize vector"); + return (ARK_MEM_FAIL); + } + + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, + &step_mem->zpred)) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Unable to resize vector"); + return (ARK_MEM_FAIL); + } + + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, + &step_mem->zcor)) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Unable to resize vector"); + return (ARK_MEM_FAIL); + } + + /* Resize the ARKStep vectors */ + /* Fe */ + if (step_mem->Fe != NULL) + { + for (i = 0; i < step_mem->stages; i++) + { + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, + &step_mem->Fe[i])) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Unable to resize vector"); + return (ARK_MEM_FAIL); + } + } + } + /* Fi */ + if (step_mem->Fi != NULL) + { + for (i = 0; i < step_mem->stages; i++) + { + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, + &step_mem->Fi[i])) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Unable to resize vector"); + return (ARK_MEM_FAIL); + } + } + } + + /* If a NLS object was previously used, destroy and recreate default Newton + NLS object (can be replaced by user-defined object if desired) */ + if ((step_mem->NLS != NULL) && (step_mem->ownNLS)) + { + /* destroy existing NLS object */ + retval = SUNNonlinSolFree(step_mem->NLS); + if (retval != ARK_SUCCESS) { return (retval); } + step_mem->NLS = NULL; + step_mem->ownNLS = SUNFALSE; + + /* create new Newton NLS object */ + NLS = SUNNonlinSol_Newton(y0, ark_mem->sunctx); + if (NLS == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Error creating default Newton solver"); + return (ARK_MEM_FAIL); + } + + /* attach new Newton NLS object to ARKStep */ + retval = ARKStepSetNonlinearSolver(ark_mem, NLS); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Error attaching default Newton solver"); + return (ARK_MEM_FAIL); + } + step_mem->ownNLS = SUNTRUE; + } + + /* reset nonlinear solver counters */ + if (step_mem->NLS != NULL) { step_mem->nsetups = 0; } + + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- ARKStepReInit: @@ -284,8 +381,8 @@ int ARKStepReInit(void* arkode_mem, ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, ARKodeARKStepMem step_mem; int retval; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Check if ark_mem was allocated */ @@ -341,181 +438,210 @@ int ARKStepReInit(void* arkode_mem, ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, return (ARK_SUCCESS); } -/*------------------------------------------------------------------------------ - ARKStepCreateMRIStepInnerStepper +/*--------------------------------------------------------------- + ARKStepReset: - Wraps an ARKStep memory structure as an MRIStep inner stepper. - ----------------------------------------------------------------------------*/ -int ARKStepCreateMRIStepInnerStepper(void* inner_arkode_mem, - MRIStepInnerStepper* stepper) + 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) { - int retval; ARKodeMem ark_mem; ARKodeARKStepMem step_mem; + int retval; - 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); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - retval = MRIStepInnerStepper_SetFullRhsFn(*stepper, - arkStep_MRIStepInnerFullRhs); - if (retval != ARK_SUCCESS) { return (retval); } + /* Initialize main ARKODE infrastructure */ + retval = arkInit(ark_mem, tR, yR, RESET_INIT); - retval = MRIStepInnerStepper_SetResetFn(*stepper, arkStep_MRIStepInnerReset); - if (retval != ARK_SUCCESS) { return (retval); } + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Unable to initialize main ARKODE infrastructure"); + return (retval); + } return (ARK_SUCCESS); } -/*=============================================================== - Interface routines supplied to ARKODE - ===============================================================*/ - /*--------------------------------------------------------------- - arkStep_Resize: + ARKStepSStolerances, ARKStepSVtolerances, ARKStepWFtolerances, + ARKStepResStolerance, ARKStepResVtolerance, ARKStepResFtolerance: - This routine resizes the memory within the ARKStep module. + These routines set integration tolerances (wrappers for general + ARKODE utility routines) ---------------------------------------------------------------*/ -int arkStep_Resize(ARKodeMem ark_mem, N_Vector y0, - SUNDIALS_MAYBE_UNUSED sunrealtype hscale, - SUNDIALS_MAYBE_UNUSED sunrealtype t0, ARKVecResizeFn resize, - void* resize_data) +int ARKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) { - ARKodeARKStepMem step_mem; - SUNNonlinearSolver NLS; - sunindextype lrw1, liw1, lrw_diff, liw_diff; - int i, retval; - - /* access ARKodeARKStepMem structure */ - retval = arkStep_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; + /* 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)); +} - /* Resize the sdata, zpred and zcor vectors */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, - &step_mem->sdata)) +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(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "Unable to resize vector"); - return (ARK_MEM_FAIL); + 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)); +} - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, - &step_mem->zpred)) +int ARKStepWFtolerances(void* arkode_mem, ARKEwtFn efun) +{ + /* unpack ark_mem, call arkWFtolerances, and return */ + ARKodeMem ark_mem; + if (arkode_mem == NULL) { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "Unable to resize vector"); - return (ARK_MEM_FAIL); + 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)); +} - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, - &step_mem->zcor)) +int ARKStepResStolerance(void* arkode_mem, sunrealtype rabstol) +{ + /* unpack ark_mem, call arkResStolerance, and return */ + ARKodeMem ark_mem; + if (arkode_mem == NULL) { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "Unable to resize vector"); - return (ARK_MEM_FAIL); + 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)); +} - /* Resize the ARKStep vectors */ - /* Fe */ - if (step_mem->Fe != NULL) +int ARKStepResVtolerance(void* arkode_mem, N_Vector rabstol) +{ + /* unpack ark_mem, call arkResVtolerance, and return */ + ARKodeMem ark_mem; + if (arkode_mem == NULL) { - for (i = 0; i < step_mem->stages; i++) - { - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, - &step_mem->Fe[i])) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "Unable to resize vector"); - return (ARK_MEM_FAIL); - } - } + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } - /* Fi */ - if (step_mem->Fi != 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) { - for (i = 0; i < step_mem->stages; i++) - { - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, - &step_mem->Fi[i])) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "Unable to resize vector"); - return (ARK_MEM_FAIL); - } - } + 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)); +} - /* If a NLS object was previously used, destroy and recreate default Newton - NLS object (can be replaced by user-defined object if desired) */ - if ((step_mem->NLS != NULL) && (step_mem->ownNLS)) +/*--------------------------------------------------------------- + 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) { - /* destroy existing NLS object */ - retval = SUNNonlinSolFree(step_mem->NLS); - if (retval != ARK_SUCCESS) { return (retval); } - step_mem->NLS = NULL; - step_mem->ownNLS = SUNFALSE; + 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)); +} - /* create new Newton NLS object */ - NLS = SUNNonlinSol_Newton(y0, ark_mem->sunctx); - if (NLS == NULL) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "Error creating default Newton solver"); - return (ARK_MEM_FAIL); - } +/*--------------------------------------------------------------- + ARKStepEvolve: - /* attach new Newton NLS object */ - retval = ARKodeSetNonlinearSolver(ark_mem, NLS); - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "Error attaching default Newton solver"); - return (ARK_MEM_FAIL); - } - step_mem->ownNLS = SUNTRUE; + 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); +} - /* reset nonlinear solver counters */ - if (step_mem->NLS != NULL) { step_mem->nsetups = 0; } +/*--------------------------------------------------------------- + ARKStepGetDky: - return (ARK_SUCCESS); + 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); } /*--------------------------------------------------------------- - arkStep_ComputeState: + ARKStepComputeState: Computes y based on the current prediction and given correction. ---------------------------------------------------------------*/ -int arkStep_ComputeState(ARKodeMem ark_mem, N_Vector zcor, N_Vector z) +int ARKStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) { int retval; + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } N_VLinearSum(ONE, step_mem->zpred, ONE, zcor, z); @@ -524,18 +650,21 @@ int arkStep_ComputeState(ARKodeMem ark_mem, N_Vector zcor, N_Vector z) } /*--------------------------------------------------------------- - arkStep_Free frees all ARKStep memory. + ARKStepFree frees all ARKStep memory, and then calls an ARKODE + utility routine to free the ARKODE infrastructure memory. ---------------------------------------------------------------*/ -void arkStep_Free(ARKodeMem ark_mem) +void ARKStepFree(void** arkode_mem) { int j; sunindextype Bliw, Blrw; + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; - /* nothing to do if ark_mem is already NULL */ - if (ark_mem == NULL) { return; } + /* nothing to do if arkode_mem is already NULL */ + if (*arkode_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; @@ -665,16 +794,21 @@ void arkStep_Free(ARKodeMem ark_mem) free(ark_mem->step_mem); ark_mem->step_mem = NULL; } + + /* free memory for overall ARKODE infrastructure */ + arkFree(arkode_mem); } /*--------------------------------------------------------------- - arkStep_PrintMem: + ARKStepPrintMem: - This routine outputs the memory from the ARKStep structure to - a specified file pointer (useful when debugging). + This routine outputs the memory from the ARKStep structure and + the main ARKODE infrastructure to a specified file pointer + (useful when debugging). ---------------------------------------------------------------*/ -void arkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) +void ARKStepPrintMem(void* arkode_mem, FILE* outfile) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; @@ -683,9 +817,15 @@ void arkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) #endif /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &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); @@ -756,6 +896,14 @@ void arkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) #endif } +/*=============================================================== + ARKStep Private functions + ===============================================================*/ + +/*--------------------------------------------------------------- + Interface routines supplied to ARKODE + ---------------------------------------------------------------*/ + /*--------------------------------------------------------------- arkStep_AttachLinsol: @@ -763,20 +911,21 @@ void arkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) interface routines, data structure, and solver type to the ARKStep module. ---------------------------------------------------------------*/ -int arkStep_AttachLinsol(ARKodeMem ark_mem, ARKLinsolInitFn linit, +int arkStep_AttachLinsol(void* arkode_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(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* free any existing system solver */ - if (step_mem->lfree != NULL) { step_mem->lfree(ark_mem); } + if (step_mem->lfree != NULL) { step_mem->lfree(arkode_mem); } /* Attach the provided routines, data structure and solve type */ step_mem->linit = linit; @@ -800,21 +949,22 @@ int arkStep_AttachLinsol(ARKodeMem ark_mem, ARKLinsolInitFn linit, interface routines, data structure, and solver type to the ARKStep module. ---------------------------------------------------------------*/ -int arkStep_AttachMasssol(ARKodeMem ark_mem, ARKMassInitFn minit, +int arkStep_AttachMasssol(void* arkode_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(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* free any existing mass matrix solver */ - if (step_mem->mfree != NULL) { step_mem->mfree(ark_mem); } + if (step_mem->mfree != NULL) { step_mem->mfree(arkode_mem); } /* Attach the provided routines, data structure and solve type */ step_mem->minit = minit; @@ -838,11 +988,14 @@ int arkStep_AttachMasssol(ARKodeMem ark_mem, ARKMassInitFn minit, This routine NULLifies the lsetup function pointer in the ARKStep module. ---------------------------------------------------------------*/ -void arkStep_DisableLSetup(ARKodeMem ark_mem) +void arkStep_DisableLSetup(void* arkode_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; @@ -856,11 +1009,14 @@ void arkStep_DisableLSetup(ARKodeMem ark_mem) This routine NULLifies the msetup function pointer in the ARKStep module. ---------------------------------------------------------------*/ -void arkStep_DisableMSetup(ARKodeMem ark_mem) +void arkStep_DisableMSetup(void* arkode_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; @@ -874,13 +1030,14 @@ void arkStep_DisableMSetup(ARKodeMem ark_mem) This routine returns the system linear solver interface memory structure, lmem. ---------------------------------------------------------------*/ -void* arkStep_GetLmem(ARKodeMem ark_mem) +void* arkStep_GetLmem(void* arkode_mem) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure, and return lmem */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (NULL); } return (step_mem->lmem); } @@ -891,13 +1048,14 @@ void* arkStep_GetLmem(ARKodeMem ark_mem) This routine returns the mass matrix solver interface memory structure, mass_mem. ---------------------------------------------------------------*/ -void* arkStep_GetMassMem(ARKodeMem ark_mem) +void* arkStep_GetMassMem(void* arkode_mem) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure, and return mass_mem */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (NULL); } return (step_mem->mass_mem); } @@ -907,13 +1065,14 @@ void* arkStep_GetMassMem(ARKodeMem ark_mem) This routine returns the implicit RHS function pointer, fi. ---------------------------------------------------------------*/ -ARKRhsFn arkStep_GetImplicitRHS(ARKodeMem ark_mem) +ARKRhsFn arkStep_GetImplicitRHS(void* arkode_mem) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure, and return fi */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (NULL); } return (step_mem->fi); } @@ -924,14 +1083,15 @@ ARKRhsFn arkStep_GetImplicitRHS(ARKodeMem ark_mem) This routine fills the current value of gamma, and states whether the gamma ratio fails the dgmax criteria. ---------------------------------------------------------------*/ -int arkStep_GetGammas(ARKodeMem ark_mem, sunrealtype* gamma, sunrealtype* gamrat, +int arkStep_GetGammas(void* arkode_mem, sunrealtype* gamma, sunrealtype* gamrat, sunbooleantype** jcur, sunbooleantype* dgamma_fail) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set outputs */ @@ -978,14 +1138,15 @@ 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(void* arkode_mem, int init_type) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int j, retval; sunbooleantype reset_efun; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* immediately return if reset */ @@ -1156,25 +1317,28 @@ int arkStep_Init(ARKodeMem ark_mem, int init_type) } } - /* Override the interpolant degree (if needed), used in arkInitialSetup */ - if (step_mem->q > 1 && ark_mem->interp_degree > (step_mem->q - 1)) - { - /* 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) + /* Limit max interpolant degree (negative input only overwrites the current + interpolant degree if it is greater than abs(input). */ + if (ark_mem->interp != NULL) { - /* 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 (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)); + } - /* 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; + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Unable to update interpolation polynomial degree"); + return (ARK_ILL_INPUT); + } } } @@ -1288,9 +1452,10 @@ int arkStep_Init(ARKodeMem ark_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(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, +int arkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int nvec, retval; sunbooleantype recomputeRHS; @@ -1299,7 +1464,7 @@ int arkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, sunrealtype stage_coefs = ONE; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* local shortcuts for use with fused vector operations */ @@ -1657,22 +1822,19 @@ int arkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, reduce step and retry (if possible) <0 => step encountered unrecoverable failure ---------------------------------------------------------------*/ -int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) +int arkStep_TakeStep_Z(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr) { int retval, is, is_start, mode; sunbooleantype implicit_stage; 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; + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; N_Vector zcor0; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if problem will involve no algebraic solvers, initialize nflagPtr to success */ @@ -1703,10 +1865,7 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) save_stages = SUNTRUE; } - /* check for an ImEx method */ - imex_method = step_mem->implicit && step_mem->explicit; - - /* check for implicit method with an explicit first stage */ + /* check for implicit method with explicit first stage */ implicit_stage = SUNFALSE; is_start = 1; if (step_mem->implicit) @@ -1737,93 +1896,28 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) if (step_mem->implicit) { if (!ARKodeButcherTable_IsStifflyAccurate(step_mem->Bi)) - { - stiffly_accurate = SUNFALSE; - } - } - - /* 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; } - } + { + stiffly_accurate = SUNFALSE; } } - /* Set alias to implicit RHS evaluation for reuse in residual */ - step_mem->fn_implicit = NULL; - if (save_fn_for_residual) + /* Call the full RHS if needed e.g., an explicit first stage. If this is the + first step then we may need to evaluate or copy the RHS values from an + earlier evaluation (e.g., to compute h0). For subsequent steps treat this + RHS evaluation as an evaluation at the end of the just completed step to + potentially reuse (FSAL methods) or save (stiffly accurate methods with an + implicit first stage using Hermite interpolation) RHS evaluations from the + end of the last step. */ + + if ((!implicit_stage || + (stiffly_accurate && ark_mem->interp_type == ARK_INTERP_HERMITE)) && + !(ark_mem->fn_is_current)) { - 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; - } - } + mode = (ark_mem->initsetup) ? ARK_FULLRHS_START : ARK_FULLRHS_END; + retval = ark_mem->step_fullrhs(ark_mem, ark_mem->tn, ark_mem->yn, + ark_mem->fn, mode); + if (retval) { return ARK_RHSFUNC_FAIL; } + ark_mem->fn_is_current = SUNTRUE; } #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO @@ -1838,20 +1932,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,8 +2013,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", "predictor", - "zpred(:) =", ""); + "ARKODE::arkStep_TakeStep_Z", "predictor", "zpred =", ""); N_VPrintFile(step_mem->zpred, ARK_LOGGER->debug_fp); #endif @@ -1930,8 +2023,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", "rhs data", - "sdata(:) =", ""); + "ARKODE::arkStep_TakeStep_Z", "rhs data", "sdata =", ""); N_VPrintFile(step_mem->sdata, ARK_LOGGER->debug_fp); #endif @@ -1946,7 +2038,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 @@ -1970,7 +2062,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 } @@ -2015,7 +2107,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 @@ -2033,7 +2125,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 @@ -2052,7 +2144,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); } @@ -2064,7 +2156,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); } @@ -2086,7 +2178,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 @@ -2100,18 +2192,18 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) return (ARK_SUCCESS); } -/*=============================================================== +/*--------------------------------------------------------------- Internal utility routines - ===============================================================*/ + ---------------------------------------------------------------*/ /*--------------------------------------------------------------- - arkStep_AccessARKODEStepMem: + 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_AccessARKODEStepMem(void* arkode_mem, const char* fname, - ARKodeMem* ark_mem, ARKodeARKStepMem* step_mem) +int arkStep_AccessStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeARKStepMem* step_mem) { /* access ARKodeMem structure */ if (arkode_mem == NULL) @@ -2121,8 +2213,6 @@ int arkStep_AccessARKODEStepMem(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__, @@ -2133,26 +2223,6 @@ int arkStep_AccessARKODEStepMem(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: @@ -2236,7 +2306,6 @@ 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; @@ -2254,7 +2323,6 @@ 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; @@ -3158,9 +3226,248 @@ int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, sunrealtype* dsmPtr) return (ARK_SUCCESS); } -/*=============================================================== - Internal utility routines for interacting with MRIStep - ===============================================================*/ +/*--------------------------------------------------------------- + Utility routines for interfacing with SUNStepper + ---------------------------------------------------------------*/ + +int ARKStepCreateSUNStepper(void* inner_arkode_mem, SUNStepper* stepper) +{ + int retval; + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + + retval = arkStep_AccessStepMem(inner_arkode_mem, "ARKStepCreateSUNStepper", + &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 = SUNStepper_Create(ark_mem->sunctx, stepper); + if (retval != ARK_SUCCESS) { return (retval); } + + retval = SUNStepper_SetContent(*stepper, inner_arkode_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + retval = SUNStepper_SetAdvanceFn(*stepper, arkStep_SUNStepperAdvance); + if (retval != ARK_SUCCESS) { return (retval); } + + retval = SUNStepper_SetFullRhsFn(*stepper, arkStep_SUNStepperFullRhs); + if (retval != ARK_SUCCESS) { return (retval); } + + retval = SUNStepper_SetResetFn(*stepper, arkStep_SUNStepperReset); + if (retval != ARK_SUCCESS) { return (retval); } + + return (ARK_SUCCESS); +} + +/*------------------------------------------------------------------------------ + arkStep_SUNStepperAdvance + + Implementation of SUNStepperAdvanceFn to advance the inner (fast) + ODE IVP. + ----------------------------------------------------------------------------*/ + +int arkStep_SUNStepperAdvance(SUNStepper stepper, sunrealtype t0, + sunrealtype tout, N_Vector y, sunrealtype* tret, + int* stop_reason) +{ + void* arkode_mem; /* arkode memory */ + 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 = SUNStepper_GetContent(stepper, &arkode_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* get the forcing data */ + retval = SUNStepper_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 = ARKStepSetStopTime(arkode_mem, tout); + if (retval != ARK_SUCCESS) { return (retval); } + + /* evolve inner ODE */ + *stop_reason = ARKStepEvolve(arkode_mem, tout, y, tret, ARK_NORMAL); + if (*stop_reason < 0) { return (*stop_reason); } + + /* disable inner forcing */ + retval = arkStep_SetInnerForcing(arkode_mem, ZERO, ONE, NULL, 0); + if (retval != ARK_SUCCESS) { return (retval); } + + return (ARK_SUCCESS); +} + +int arkStep_SUNStepperOneStep(SUNStepper stepper, sunrealtype t0, + sunrealtype tout, N_Vector y, sunrealtype* tret, + int* stop_reason) +{ + void* arkode_mem; /* arkode memory */ + 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 = SUNStepper_GetContent(stepper, &arkode_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* get the forcing data */ + retval = SUNStepper_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 = ARKStepSetStopTime(arkode_mem, tout); + if (retval != ARK_SUCCESS) { return (retval); } + + /* evolve inner ODE */ + *stop_reason = ARKStepEvolve(arkode_mem, tout, y, tret, ARK_ONE_STEP); + if (*stop_reason < 0) { return (*stop_reason); } + + /* disable inner forcing */ + retval = arkStep_SetInnerForcing(arkode_mem, ZERO, ONE, NULL, 0); + if (retval != ARK_SUCCESS) { return (retval); } + + return (ARK_SUCCESS); +} + +int arkStep_SUNStepperTryStep(SUNStepper stepper, sunrealtype t0, + sunrealtype tout, N_Vector y, sunrealtype* tret, + int* stop_reason) +{ + void* arkode_mem; /* arkode memory */ + 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 = SUNStepper_GetContent(stepper, &arkode_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* get the forcing data */ + retval = SUNStepper_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 = ARKStepSetStopTime(arkode_mem, tout); + if (retval != ARK_SUCCESS) { return (retval); } + + /* try to evolve inner ODE */ + retval = arkStep_TryStep(arkode_mem, t0, tout, y, tret, stop_reason); + if (retval != ARK_SUCCESS) { return (retval); } + + /* disable inner forcing */ + retval = arkStep_SetInnerForcing(arkode_mem, ZERO, ONE, NULL, 0); + if (retval != ARK_SUCCESS) { return (retval); } + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + arkStep_SUNStepperFullRhs + + Implementation of SUNStepperFullRhsFn to compute the full inner + (fast) ODE IVP RHS. + ----------------------------------------------------------------------------*/ + +int arkStep_SUNStepperFullRhs(SUNStepper stepper, sunrealtype t, N_Vector y, + N_Vector f, int mode) +{ + void* arkode_mem; + int retval; + + /* extract the ARKODE memory struct */ + retval = SUNStepper_GetContent(stepper, &arkode_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + return (arkStep_FullRHS(arkode_mem, t, y, f, mode)); +} + +/*------------------------------------------------------------------------------ + arkStep_SUNStepperReset + + Implementation of SUNStepperResetFn to reset the inner (fast) stepper + state. + ----------------------------------------------------------------------------*/ + +int arkStep_SUNStepperReset(SUNStepper stepper, sunrealtype tR, N_Vector yR) +{ + void* arkode_mem; + int retval; + + /* extract the ARKODE memory struct */ + retval = SUNStepper_GetContent(stepper, &arkode_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + return (ARKStepReset(arkode_mem, tR, yR)); +} + +/*--------------------------------------------------------------- + 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_AccessStepMem(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); +} /*------------------------------------------------------------------------------ arkStep_MRIStepInnerEvolve @@ -3169,8 +3476,7 @@ int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, sunrealtype* dsmPtr) ODE IVP. ----------------------------------------------------------------------------*/ -int arkStep_MRIStepInnerEvolve(MRIStepInnerStepper stepper, - SUNDIALS_MAYBE_UNUSED sunrealtype t0, +int arkStep_MRIStepInnerEvolve(MRIStepInnerStepper stepper, sunrealtype t0, sunrealtype tout, N_Vector y) { void* arkode_mem; /* arkode memory */ @@ -3194,11 +3500,11 @@ int arkStep_MRIStepInnerEvolve(MRIStepInnerStepper stepper, if (retval != ARK_SUCCESS) { return (retval); } /* set the stop time */ - retval = ARKodeSetStopTime(arkode_mem, tout); + retval = ARKStepSetStopTime(arkode_mem, tout); if (retval != ARK_SUCCESS) { return (retval); } /* evolve inner ODE */ - retval = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + retval = ARKStepEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); if (retval < 0) { return (retval); } /* disable inner forcing */ @@ -3245,7 +3551,7 @@ int arkStep_MRIStepInnerReset(MRIStepInnerStepper stepper, sunrealtype tR, retval = MRIStepInnerStepper_GetContent(stepper, &arkode_mem); if (retval != ARK_SUCCESS) { return (retval); } - return (ARKodeReset(arkode_mem, tR, yR)); + return (ARKStepReset(arkode_mem, tR, yR)); } /*------------------------------------------------------------------------------ @@ -3331,8 +3637,8 @@ int arkStep_SetInnerForcing(void* arkode_mem, sunrealtype tshift, ARKodeARKStepMem step_mem; int retval; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } if (nvecs > 0) @@ -3406,10 +3712,6 @@ int arkStep_SetInnerForcing(void* arkode_mem, sunrealtype tshift, return (0); } -/*=============================================================== - Internal utility routines for relaxation - ===============================================================*/ - /* ----------------------------------------------------------------------------- * arkStep_RelaxDeltaE * @@ -3428,6 +3730,7 @@ 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) { @@ -3548,12 +3851,70 @@ 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); return step_mem->q; } +/* ----------------------------------------------------------------------------- + * arkStep_TryStep + * + * Attempts one internal time step using ARKStepEvolve + * ---------------------------------------------------------------------------*/ + +int arkStep_TryStep(void* arkode_mem, sunrealtype tstart, sunrealtype tstop, + N_Vector y, sunrealtype* tret, int* ark_flag) +{ + int flag; /* generic return flag */ + int tmp_flag; /* evolve return flag */ + + /* Check inputs */ + if (arkode_mem == NULL) { return ARK_MEM_NULL; } + if (y == NULL) { return ARK_ILL_INPUT; } + + /* Reset ARKStep state */ + flag = ARKStepReset(arkode_mem, tstart, y); + if (flag != ARK_SUCCESS) { return flag; } + + /* Set the time step size */ + flag = ARKStepSetInitStep(arkode_mem, tstop - tstart); + if (flag != ARK_SUCCESS) { return flag; } + + /* Ignore temporal error test result and force step to pass */ + flag = arkSetForcePass(arkode_mem, SUNTRUE); + if (flag != ARK_SUCCESS) { return flag; } + + /* Take step, check flag below */ + tmp_flag = ARKStepEvolve(arkode_mem, tstop, y, tret, ARK_ONE_STEP); + + /* Re-enable temporal error test check */ + flag = arkSetForcePass(arkode_mem, SUNFALSE); + if (flag != ARK_SUCCESS) { return flag; } + + /* Check if evolve call failed */ + if (tmp_flag < 0) + { + *ark_flag = TRYSTEP_FAILED; + return ARK_SUCCESS; + } + + /* Check if temporal error test failed */ + flag = arkGetLastKFlag(arkode_mem, &tmp_flag); + if (flag != ARK_SUCCESS) { return flag; } + + if (tmp_flag > 0) + { + *ark_flag = TRYSTEP_ADAPT; + return ARK_SUCCESS; + } + + /* Step was successful and passed the error test */ + *ark_flag = TRYSTEP_SUCCESS; + return ARK_SUCCESS; +} + /*=============================================================== EOF ===============================================================*/ diff --git a/src/arkode/arkode_arkstep_impl.h b/src/arkode/arkode_arkstep_impl.h index 8af982cd1b..6b1dc660c3 100644 --- a/src/arkode/arkode_arkstep_impl.h +++ b/src/arkode/arkode_arkstep_impl.h @@ -19,6 +19,7 @@ #define _ARKODE_ARKSTEP_IMPL_H #include <arkode/arkode_arkstep.h> +/* access to MRIStepInnerStepper_Create */ #include <arkode/arkode_mristep.h> #include "arkode_impl.h" @@ -32,16 +33,13 @@ extern "C" { ARK time step module constants ===============================================================*/ -/* 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 +#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 */ /* Default solver tolerance factor */ /* #define NLSCOEF SUN_RCONST(0.003) */ /* Hairer & Wanner constant */ @@ -67,15 +65,14 @@ 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 */ @@ -119,9 +116,8 @@ 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? */ - N_Vector fn_implicit; /* alias to saved implicit function evaluation */ + int convfail; /* NLS fail flag (for interface routines) */ + sunbooleantype jcur; /* is Jacobian info for lin solver current? */ /* Linear Solver Data */ ARKLinsolInitFn linit; @@ -170,68 +166,30 @@ typedef struct ARKodeARKStepMemRec ===============================================================*/ /* Interface routines supplied to ARKODE */ -int arkStep_AttachLinsol(ARKodeMem ark_mem, ARKLinsolInitFn linit, +int arkStep_AttachLinsol(void* arkode_mem, ARKLinsolInitFn linit, ARKLinsolSetupFn lsetup, ARKLinsolSolveFn lsolve, ARKLinsolFreeFn lfree, SUNLinearSolver_Type lsolve_type, void* lmem); -int arkStep_AttachMasssol(ARKodeMem ark_mem, ARKMassInitFn minit, +int arkStep_AttachMasssol(void* arkode_mem, ARKMassInitFn minit, ARKMassSetupFn msetup, ARKMassMultFn mmult, ARKMassSolveFn msolve, ARKMassFreeFn lfree, sunbooleantype time_dep, 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); -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, +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, sunbooleantype** jcur, sunbooleantype* dgamma_fail); -int arkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, +int arkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); -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_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); -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); +int arkStep_TakeStep_Z(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr); /* Internal utility routines */ -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); +int arkStep_AccessStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeARKStepMem* step_mem); sunbooleantype arkStep_CheckNVector(N_Vector tmpl); int arkStep_SetButcherTables(ARKodeMem ark_mem); int arkStep_CheckButcherTables(ARKodeMem ark_mem); @@ -239,7 +197,6 @@ 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, @@ -247,20 +204,10 @@ 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); @@ -268,6 +215,20 @@ 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 SUNStepper */ +int arkStep_SUNStepperAdvance(SUNStepper stepper, sunrealtype t0, + sunrealtype tout, N_Vector y, sunrealtype* tret, + int* stop_reason); +int arkStep_SUNStepperOneStep(SUNStepper stepper, sunrealtype t0, + sunrealtype tout, N_Vector y, sunrealtype* tret, + int* stop_reason); +int arkStep_SUNStepperTryStep(SUNStepper stepper, sunrealtype t0, + sunrealtype tout, N_Vector y, sunrealtype* tret, + int* stop_reason); +int arkStep_SUNStepperFullRhs(SUNStepper stepper, sunrealtype t, N_Vector y, + N_Vector f, int mode); +int arkStep_SUNStepperReset(SUNStepper stepper, sunrealtype tR, N_Vector yR); + /* private functions for interfacing with MRIStep */ int arkStep_SetInnerForcing(void* arkode_mem, sunrealtype tshift, sunrealtype tscale, N_Vector* f, int nvecs); @@ -279,11 +240,14 @@ 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); +/* private utility functions */ +int arkStep_TryStep(void* arkode_mem, sunrealtype tstart, sunrealtype tstop, + N_Vector y, sunrealtype* tret, int* ark_flag); + /*=============================================================== Reusable ARKStep Error Messages ===============================================================*/ diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index 7df74cb590..58f78862c3 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -27,2181 +27,2251 @@ #include "arkode_arkstep_impl.h" /*=============================================================== - Exported optional input functions. + ARKStep Optional input functions (wrappers for generic ARKODE + utility routines). All are documented in arkode_io.c. ===============================================================*/ +int ARKStepSetDenseOrder(void* arkode_mem, int dord) +{ + return (ARKStepSetInterpolantDegree(arkode_mem, dord)); +} -/*--------------------------------------------------------------- - ARKStepSetExplicit: +int ARKStepSetInterpolantDegree(void* arkode_mem, int degree) +{ + if (degree < 0) { degree = ARK_INTERP_MAX_DEGREE; } + return (arkSetInterpolantDegree(arkode_mem, degree)); +} - Specifies that the implicit portion of the problem is disabled, - and to use an explicit RK method. - ---------------------------------------------------------------*/ -int ARKStepSetExplicit(void* arkode_mem) +int ARKStepSetInterpolantType(void* arkode_mem, int itype) { - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; + return (arkSetInterpolantType(arkode_mem, itype)); +} - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) +{ + return (arkSetMaxNumSteps(arkode_mem, mxsteps)); +} - /* 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); - } +int ARKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) +{ + return (arkSetMaxHnilWarns(arkode_mem, mxhnil)); +} - /* set the relevant parameters */ - step_mem->explicit = SUNTRUE; - step_mem->implicit = SUNFALSE; +int ARKStepSetInitStep(void* arkode_mem, sunrealtype hin) +{ + return (arkSetInitStep(arkode_mem, hin)); +} - return (ARK_SUCCESS); +int ARKStepSetMinStep(void* arkode_mem, sunrealtype hmin) +{ + return (arkSetMinStep(arkode_mem, hmin)); } -/*--------------------------------------------------------------- - ARKStepSetImplicit: +int ARKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) +{ + return (arkSetMaxStep(arkode_mem, hmax)); +} - Specifies that the explicit portion of the problem is disabled, - and to use an implicit RK method. - ---------------------------------------------------------------*/ -int ARKStepSetImplicit(void* arkode_mem) +int ARKStepSetStopTime(void* arkode_mem, sunrealtype tstop) { - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; + return (arkSetStopTime(arkode_mem, tstop)); +} - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) +{ + return (arkSetInterpolateStopTime(arkode_mem, interp)); +} - /* 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 ARKStepClearStopTime(void* arkode_mem) +{ + return (arkClearStopTime(arkode_mem)); +} - /* set the relevant parameters */ - step_mem->implicit = SUNTRUE; - step_mem->explicit = SUNFALSE; +int ARKStepSetRootDirection(void* arkode_mem, int* rootdir) +{ + return (arkSetRootDirection(arkode_mem, rootdir)); +} - /* 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 ARKStepSetNoInactiveRootWarn(void* arkode_mem) +{ + return (arkSetNoInactiveRootWarn(arkode_mem)); +} - return (ARK_SUCCESS); +int ARKStepSetConstraints(void* arkode_mem, N_Vector constraints) +{ + return (arkSetConstraints(arkode_mem, constraints)); } -/*--------------------------------------------------------------- - ARKStepSetImEx: +int ARKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) +{ + return (arkSetMaxNumConstrFails(arkode_mem, maxfails)); +} - 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) +int ARKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) { - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; + return (arkSetPostprocessStepFn(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 (arkSetPostprocessStageFn(arkode_mem, ProcessStage)); +} - /* 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 ARKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust) +{ + return (arkSetAdaptivityAdjustment(arkode_mem, adjust)); +} - /* set the relevant parameters */ - step_mem->explicit = SUNTRUE; - step_mem->implicit = SUNTRUE; +int ARKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) +{ + return (arkSetCFLFraction(arkode_mem, cfl_frac)); +} - /* 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 ARKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) +{ + return (arkSetSafetyFactor(arkode_mem, safety)); +} - return (ARK_SUCCESS); +int ARKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) +{ + return (arkSetMaxGrowth(arkode_mem, mx_growth)); } -/*--------------------------------------------------------------- - ARKStepSetTables: +int ARKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) +{ + return (arkSetMinReduction(arkode_mem, eta_min)); +} - Specifies to use customized Butcher tables for the system. +int ARKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) +{ + return (arkSetFixedStepBounds(arkode_mem, lb, ub)); +} - If Bi is NULL, then this sets the integrator in 'explicit' mode. +int ARKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) +{ + return (arkSetMaxFirstGrowth(arkode_mem, etamx1)); +} - If Be is NULL, then this sets the integrator in 'implicit' mode. +int ARKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) +{ + return (arkSetMaxEFailGrowth(arkode_mem, etamxf)); +} - 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 ARKStepSetSmallNumEFails(void* arkode_mem, int small_nef) { - int retval; - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - sunindextype Blrw, Bliw; + return (arkSetSmallNumEFails(arkode_mem, small_nef)); +} - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) +{ + return (arkSetMaxCFailGrowth(arkode_mem, etacf)); +} - /* 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 ARKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) +{ + return (arkSetStabilityFn(arkode_mem, EStab, estab_data)); +} - /* 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 ARKStepSetMaxErrTestFails(void* arkode_mem, int maxnef) +{ + return (arkSetMaxErrTestFails(arkode_mem, maxnef)); +} - /* clear any existing parameters and Butcher tables */ - step_mem->stages = 0; - step_mem->q = 0; - step_mem->p = 0; +int ARKStepSetMaxConvFails(void* arkode_mem, int maxncf) +{ + return (arkSetMaxConvFails(arkode_mem, maxncf)); +} - 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 ARKStepSetAdaptController(void* arkode_mem, SUNAdaptController C) +{ + return (arkSetAdaptController(arkode_mem, C)); +} - 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 ARKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) +{ + return (arkSetFixedStep(arkode_mem, hfixed)); +} - /* - * determine mode (implicit/explicit/ImEx), and perform appropriate actions - */ +/*--------------------------------------------------------------- + These wrappers for ARKLs module 'set' routines all are + documented in arkode_arkstep.h. + ---------------------------------------------------------------*/ +int ARKStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) +{ + return (arkLSSetLinearSolver(arkode_mem, LS, A)); +} - /* 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 ARKStepSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, + SUNMatrix M, sunbooleantype time_dep) +{ + return (arkLSSetMassLinearSolver(arkode_mem, LS, M, time_dep)); +} - /* 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 ARKStepSetJacFn(void* arkode_mem, ARKLsJacFn jac) +{ + return (arkLSSetJacFn(arkode_mem, jac)); +} - /* 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; +int ARKStepSetMassFn(void* arkode_mem, ARKLsMassFn mass) +{ + return (arkLSSetMassFn(arkode_mem, mass)); +} - /* 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 ARKStepSetJacEvalFrequency(void* arkode_mem, long int msbj) +{ + return (arkLSSetJacEvalFrequency(arkode_mem, msbj)); +} - /* 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 ARKStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) +{ + return (arkLSSetLinearSolutionScaling(arkode_mem, onoff)); +} - /* 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 ARKStepSetEpsLin(void* arkode_mem, sunrealtype eplifac) +{ + return (arkLSSetEpsLin(arkode_mem, eplifac)); +} - /* 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 ARKStepSetMassEpsLin(void* arkode_mem, sunrealtype eplifac) +{ + return (arkLSSetMassEpsLin(arkode_mem, eplifac)); +} - /* 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 ARKStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) +{ + return (arkLSSetNormFactor(arkode_mem, nrmfac)); +} - /* 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 ARKStepSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac) +{ + return (arkLSSetMassNormFactor(arkode_mem, nrmfac)); +} - /* note Butcher table space requirements */ - ARKodeButcherTable_Space(step_mem->Be, &Bliw, &Blrw); - ark_mem->liw += Bliw; - ark_mem->lrw += Blrw; +int ARKStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, + ARKLsPrecSolveFn psolve) +{ + return (arkLSSetPreconditioner(arkode_mem, psetup, psolve)); +} - ARKodeButcherTable_Space(step_mem->Bi, &Bliw, &Blrw); - ark_mem->liw += Bliw; - ark_mem->lrw += Blrw; +int ARKStepSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, + ARKLsMassPrecSolveFn psolve) +{ + return (arkLSSetMassPreconditioner(arkode_mem, psetup, psolve)); +} - return (ARK_SUCCESS); +int ARKStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, + ARKLsJacTimesVecFn jtimes) +{ + return (arkLSSetJacTimes(arkode_mem, jtsetup, jtimes)); } -/*--------------------------------------------------------------- - ARKStepSetTableNum: +int ARKStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) +{ + return (arkLSSetJacTimesRhsFn(arkode_mem, jtimesRhsFn)); +} - 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 ARKStepSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn msetup, + ARKLsMassTimesVecFn mtimes, void* mtimes_data) +{ + return (arkLSSetMassTimes(arkode_mem, msetup, mtimes, mtimes_data)); +} - If either argument is negative (illegal), then this disables the - corresponding table (e.g. itable = -1 -> explicit) +int ARKStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) +{ + return (arkLSSetLinSysFn(arkode_mem, linsys)); +} - Note: this routine should NOT be used in conjunction with - ARKodeSetOrder. - ---------------------------------------------------------------*/ -int ARKStepSetTableNum(void* arkode_mem, ARKODE_DIRKTableID itable, - ARKODE_ERKTableID etable) +/*=============================================================== + 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) { - int flag, retval; - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - sunindextype Blrw, Bliw; + return (arkGetNumStepAttempts(arkode_mem, nstep_attempts)); +} - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepGetNumSteps(void* arkode_mem, long int* nsteps) +{ + return (arkGetNumSteps(arkode_mem, nsteps)); +} - /* clear any existing parameters and Butcher tables */ - step_mem->stages = 0; - step_mem->q = 0; - step_mem->p = 0; +int ARKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) +{ + return (arkGetActualInitStep(arkode_mem, hinused)); +} - 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 ARKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) +{ + return (arkGetLastStep(arkode_mem, hlast)); +} - 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 ARKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) +{ + return (arkGetCurrentStep(arkode_mem, hcur)); +} - /* determine mode (implicit/explicit/ImEx), and perform - appropriate actions */ +int ARKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) +{ + return (arkGetCurrentTime(arkode_mem, tcur)); +} - /* 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 ARKStepGetCurrentState(void* arkode_mem, N_Vector* state) +{ + return (arkGetCurrentState(arkode_mem, state)); +} - /* 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 ARKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) +{ + return (arkGetTolScaleFactor(arkode_mem, tolsfact)); +} - /* 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; +int ARKStepGetErrWeights(void* arkode_mem, N_Vector eweight) +{ + return (arkGetErrWeights(arkode_mem, eweight)); +} - /* 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 ARKStepGetResWeights(void* arkode_mem, N_Vector rweight) +{ + return (arkGetResWeights(arkode_mem, rweight)); +} - /* 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 ARKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +{ + return (arkGetWorkSpace(arkode_mem, lenrw, leniw)); +} - /* 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 ARKStepGetNumGEvals(void* arkode_mem, long int* ngevals) +{ + return (arkGetNumGEvals(arkode_mem, ngevals)); +} - /* 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 ARKStepGetRootInfo(void* arkode_mem, int* rootsfound) +{ + return (arkGetRootInfo(arkode_mem, rootsfound)); +} - /* 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 ARKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, + sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) +{ + return (arkGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); +} - /* 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 ARKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) +{ + return (arkGetNumConstrFails(arkode_mem, nconstrfails)); +} - /* 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 ARKStepGetNumExpSteps(void* arkode_mem, long int* nsteps) +{ + return (arkGetNumExpSteps(arkode_mem, nsteps)); +} - return (ARK_SUCCESS); +int ARKStepGetNumAccSteps(void* arkode_mem, long int* nsteps) +{ + return (arkGetNumAccSteps(arkode_mem, nsteps)); } -/*--------------------------------------------------------------- - ARKStepSetTableName: +int ARKStepGetNumErrTestFails(void* arkode_mem, long int* netfails) +{ + return (arkGetNumErrTestFails(arkode_mem, netfails)); +} - 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 ARKStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails) +{ + return (arkGetNumStepSolveFails(arkode_mem, nncfails)); +} - 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) +int ARKStepGetUserData(void* arkode_mem, void** user_data) { - return (ARKStepSetTableNum(arkode_mem, arkButcherTableDIRKNameToID(itable), - arkButcherTableERKNameToID(etable))); + return (arkGetUserData(arkode_mem, user_data)); } -/*=============================================================== - Exported optional output functions. - ===============================================================*/ +char* ARKStepGetReturnFlagName(long int flag) +{ + return (arkGetReturnFlagName(flag)); +} /*--------------------------------------------------------------- - ARKStepGetNumRhsEvals: - - Returns the current number of calls to fe and fi + These wrappers for ARKLs module 'get' routines all are + documented in arkode_arkstep.h. ---------------------------------------------------------------*/ -int ARKStepGetNumRhsEvals(void* arkode_mem, long int* fe_evals, long int* fi_evals) +int ARKStepGetJac(void* arkode_mem, SUNMatrix* J) { - 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); } + return arkLSGetJac(arkode_mem, J); +} - /* get values from step_mem */ - *fe_evals = step_mem->nfe; - *fi_evals = step_mem->nfi; +int ARKStepGetJacTime(void* arkode_mem, sunrealtype* t_J) +{ + return arkLSGetJacTime(arkode_mem, t_J); +} - return (ARK_SUCCESS); +int ARKStepGetJacNumSteps(void* arkode_mem, long* nst_J) +{ + return arkLSGetJacNumSteps(arkode_mem, nst_J); } -/*--------------------------------------------------------------- - ARKStepGetCurrentButcherTables: +int ARKStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, long int* leniwLS) +{ + return (arkLSGetWorkSpace(arkode_mem, lenrwLS, leniwLS)); +} - Sets pointers to the explicit and implicit Butcher tables - currently in use. - ---------------------------------------------------------------*/ -int ARKStepGetCurrentButcherTables(void* arkode_mem, ARKodeButcherTable* Bi, - ARKodeButcherTable* Be) +int ARKStepGetNumJacEvals(void* arkode_mem, long int* njevals) { - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; + return (arkLSGetNumJacEvals(arkode_mem, njevals)); +} - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepGetNumPrecEvals(void* arkode_mem, long int* npevals) +{ + return (arkLSGetNumPrecEvals(arkode_mem, npevals)); +} - /* get tables from step_mem */ - *Bi = step_mem->Bi; - *Be = step_mem->Be; - return (ARK_SUCCESS); +int ARKStepGetNumPrecSolves(void* arkode_mem, long int* npsolves) +{ + return (arkLSGetNumPrecSolves(arkode_mem, npsolves)); } -/*--------------------------------------------------------------- - ARKStepGetTimestepperStats: +int ARKStepGetNumLinIters(void* arkode_mem, long int* nliters) +{ + return (arkLSGetNumLinIters(arkode_mem, nliters)); +} - 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 ARKStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails) { - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; + return (arkLSGetNumConvFails(arkode_mem, nlcfails)); +} - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups) +{ + return (arkLSGetNumJTSetupEvals(arkode_mem, njtsetups)); +} - /* set expsteps and accsteps from adaptivity structure */ - *expsteps = ark_mem->hadapt_mem->nst_exp; - *accsteps = ark_mem->hadapt_mem->nst_acc; +int ARKStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals) +{ + return (arkLSGetNumJtimesEvals(arkode_mem, njvevals)); +} - /* 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 ARKStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) +{ + return (arkLSGetNumRhsEvals(arkode_mem, nfevalsLS)); +} - return (ARK_SUCCESS); +int ARKStepGetLastLinFlag(void* arkode_mem, long int* flag) +{ + return (arkLSGetLastFlag(arkode_mem, flag)); } -/*=============================================================== - Private functions attached to ARKODE - ===============================================================*/ +int ARKStepGetMassWorkSpace(void* arkode_mem, long int* lenrwMLS, + long int* leniwMLS) +{ + return (arkLSGetMassWorkSpace(arkode_mem, lenrwMLS, leniwMLS)); +} -/*--------------------------------------------------------------- - arkStep_SetRelaxFn: +int ARKStepGetNumMassSetups(void* arkode_mem, long int* nmsetups) +{ + return (arkLSGetNumMassSetups(arkode_mem, nmsetups)); +} - Sets up the relaxation module using ARKStep's utility routines. - ---------------------------------------------------------------*/ -int arkStep_SetRelaxFn(ARKodeMem ark_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) +int ARKStepGetNumMassMultSetups(void* arkode_mem, long int* nmvsetups) { - return ( - arkRelaxCreate(ark_mem, rfn, rjac, arkStep_RelaxDeltaE, arkStep_GetOrder)); + return (arkLSGetNumMassMatvecSetups(arkode_mem, nmvsetups)); } -/*--------------------------------------------------------------- - arkStep_SetUserData: +int ARKStepGetNumMassMult(void* arkode_mem, long int* nmvevals) +{ + return (arkLSGetNumMassMult(arkode_mem, nmvevals)); +} - Passes user-data pointer to attached linear solver modules. - ---------------------------------------------------------------*/ -int arkStep_SetUserData(ARKodeMem ark_mem, void* user_data) +int ARKStepGetNumMassSolves(void* arkode_mem, long int* nmsolves) { - ARKodeARKStepMem step_mem; - int retval; + return (arkLSGetNumMassSolves(arkode_mem, nmsolves)); +} - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepGetNumMassPrecEvals(void* arkode_mem, long int* nmpevals) +{ + return (arkLSGetNumMassPrecEvals(arkode_mem, nmpevals)); +} - /* 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 ARKStepGetNumMassPrecSolves(void* arkode_mem, long int* nmpsolves) +{ + return (arkLSGetNumMassPrecSolves(arkode_mem, nmpsolves)); +} - /* 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 ARKStepGetNumMassIters(void* arkode_mem, long int* nmiters) +{ + return (arkLSGetNumMassIters(arkode_mem, nmiters)); +} - return (ARK_SUCCESS); +int ARKStepGetNumMassConvFails(void* arkode_mem, long int* nmcfails) +{ + return (arkLSGetNumMassConvFails(arkode_mem, nmcfails)); } -/*--------------------------------------------------------------- - arkStep_SetDefaults: +int ARKStepGetNumMTSetups(void* arkode_mem, long int* nmtsetups) +{ + return (arkLSGetNumMTSetups(arkode_mem, nmtsetups)); +} - 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) +int ARKStepGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M) { - ARKodeARKStepMem step_mem; - int retval; + return (arkLSGetCurrentMassMatrix(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 (arkLSGetLastMassFlag(arkode_mem, flag)); +} - /* 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->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 */ - 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); +char* ARKStepGetLinReturnFlagName(long int flag) +{ + return (arkLSGetReturnFlagName(flag)); } -/*--------------------------------------------------------------- - arkStep_SetOrder: +/* ----------------------------------------------------------------------------- + * Wrappers for the ARKODE relaxation module + * ---------------------------------------------------------------------------*/ - Specifies the method order - ---------------------------------------------------------------*/ -int arkStep_SetOrder(ARKodeMem ark_mem, int ord) +int ARKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) { - 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); + return arkRelaxCreate(arkode_mem, rfn, rjac, arkStep_RelaxDeltaE, + arkStep_GetOrder); } -/*--------------------------------------------------------------- - 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) +int ARKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf) { - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeARKStepMem structure */ - 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); - step_mem->dgmax = SUN_RCONST(100.0) * SUN_UNIT_ROUNDOFF; - - return (ARK_SUCCESS); + return arkRelaxSetEtaFail(arkode_mem, eta_rf); } -/*--------------------------------------------------------------- - arkStep_SetNonlinear: +int ARKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) +{ + return arkRelaxSetLowerBound(arkode_mem, lower); +} - 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) +int ARKStepSetRelaxMaxFails(void* arkode_mem, int max_fails) { - ARKodeARKStepMem step_mem; - int retval; + return arkRelaxSetMaxFails(arkode_mem, max_fails); +} - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetRelaxMaxIters(void* arkode_mem, int max_iters) +{ + return arkRelaxSetMaxIters(arkode_mem, max_iters); +} - /* set parameters */ - step_mem->linear = SUNFALSE; - step_mem->linear_timedep = SUNTRUE; - step_mem->dgmax = DGMAX; +int ARKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver) +{ + return arkRelaxSetSolver(arkode_mem, solver); +} - return (ARK_SUCCESS); +int ARKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol) +{ + return arkRelaxSetResTol(arkode_mem, res_tol); } -/*--------------------------------------------------------------- - arkStep_SetAutonomous: +int ARKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) +{ + return arkRelaxSetTol(arkode_mem, rel_tol, abs_tol); +} - Indicates if the problem is autonomous (True) or non-autonomous - (False). - ---------------------------------------------------------------*/ -int arkStep_SetAutonomous(ARKodeMem ark_mem, sunbooleantype autonomous) +int ARKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) { - ARKodeARKStepMem step_mem; - int retval; + return arkRelaxSetUpperBound(arkode_mem, upper); +} - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return retval; } +int ARKStepGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals) +{ + return arkRelaxGetNumRelaxFnEvals(arkode_mem, r_evals); +} - step_mem->autonomous = autonomous; +int ARKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) +{ + return arkRelaxGetNumRelaxJacEvals(arkode_mem, J_evals); +} - if (autonomous && step_mem->linear) { step_mem->linear_timedep = SUNFALSE; } +int ARKStepGetNumRelaxFails(void* arkode_mem, long int* relax_fails) +{ + return arkRelaxGetNumRelaxFails(arkode_mem, relax_fails); +} - /* 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; - } +int ARKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails) +{ + return arkRelaxGetNumRelaxBoundFails(arkode_mem, fails); +} - /* 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); - } +int ARKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails) +{ + return arkRelaxGetNumRelaxSolveFails(arkode_mem, fails); +} - return ARK_SUCCESS; +int ARKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) +{ + return arkRelaxGetNumRelaxSolveIters(arkode_mem, iters); } -/*--------------------------------------------------------------- - arkStep_SetNonlinCRDown: +/*=============================================================== + DEPRECATED ARKStep optional input/output functions + ===============================================================*/ - Specifies the user-provided nonlinear convergence constant - crdown. Legal values are strictly positive; illegal values - imply a reset to the default. +/*--------------------------------------------------------------- + ARKStepSetAdaptivityMethod: user should create/attach a + specific SUNAdaptController object. ---------------------------------------------------------------*/ -int arkStep_SetNonlinCRDown(ARKodeMem ark_mem, sunrealtype crdown) +int ARKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, + int pq, sunrealtype adapt_params[3]) { - 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); + return (arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); } /*--------------------------------------------------------------- - arkStep_SetNonlinRDiv: - - Specifies the user-provided nonlinear convergence constant - rdiv. Legal values are strictly positive; illegal values - imply a reset to the default. + ARKStepSetAdaptivityFn: user should create/attach a custom + SUNAdaptController object. ---------------------------------------------------------------*/ -int arkStep_SetNonlinRDiv(ARKodeMem ark_mem, sunrealtype rdiv) +int ARKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) { - 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); + return (arkSetAdaptivityFn(arkode_mem, hfun, h_data)); } /*--------------------------------------------------------------- - arkStep_SetDeltaGammaMax: - - Specifies the user-provided linear setup decision constant - dgmax. Legal values are strictly positive; illegal values imply - a reset to the default. + ARKStepSetErrorBias: user should set this value directly in the + SUNAdaptController object. ---------------------------------------------------------------*/ -int arkStep_SetDeltaGammaMax(ARKodeMem ark_mem, sunrealtype dgmax) +int ARKStepSetErrorBias(void* arkode_mem, sunrealtype bias) { - 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; } - - return (ARK_SUCCESS); + return (arkSetErrorBias(arkode_mem, bias)); } +/*=============================================================== + ARKStep optional input functions -- stepper-specific + ===============================================================*/ + /*--------------------------------------------------------------- - arkStep_SetLSetupFrequency: + ARKStepSetUserData: - 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. + Wrapper for generic arkSetUserData and arkLSSetUserData + routines. ---------------------------------------------------------------*/ -int arkStep_SetLSetupFrequency(ARKodeMem ark_mem, int msbp) +int ARKStepSetUserData(void* arkode_mem, void* user_data) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* if argument legal set it, otherwise set default */ - if (msbp == 0) { step_mem->msbp = MSBP; } - else { step_mem->msbp = msbp; } + /* set user_data in ARKODE mem */ + retval = arkSetUserData(arkode_mem, user_data); + if (retval != ARK_SUCCESS) { return (retval); } + + /* set user data in ARKODE LS mem */ + if (step_mem->lmem != NULL) + { + retval = arkLSSetUserData(arkode_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); + if (retval != ARKLS_SUCCESS) { return (retval); } + } return (ARK_SUCCESS); } /*--------------------------------------------------------------- - arkStep_SetPredictorMethod: + ARKStepSetDefaults: - Specifies the method to use for predicting implicit solutions. - Non-default choices are {1,2,3,4}, all others will use default - (trivial) predictor. + 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_SetPredictorMethod(ARKodeMem ark_mem, int pred_method) +int ARKStepSetDefaults(void* arkode_mem) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* 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); + /* Set default ARKODE infrastructure parameters */ + retval = arkSetDefaults(ark_mem); if (retval != ARK_SUCCESS) { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Setting nonlinear system function failed"); - return ARK_ILL_INPUT; + 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 */ + 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); } /*--------------------------------------------------------------- - arkStep_SetMaxNonlinIters: - - Specifies the maximum number of nonlinear iterations during - one solve. A non-positive input implies a reset to the - default value. + 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. ---------------------------------------------------------------*/ -int arkStep_SetMaxNonlinIters(ARKodeMem ark_mem, int maxcor) +int ARKStepSetOptimalParams(void* arkode_mem) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; + ARKodeHAdaptMem hadapt_mem; int retval; + long int lenrw, leniw; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - SUNFunctionBegin(ark_mem->sunctx); - - /* Return error message if no NLS module is present */ - if (step_mem->NLS == NULL) + /* access ARKodeHAdaptMem structure */ + if (ark_mem->hadapt_mem == NULL) { - arkProcessError(ark_mem, ARK_NLS_OP_ERR, __LINE__, __func__, __FILE__, - "No SUNNonlinearSolver object is present"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARKADAPT_NO_MEM); + return (ARK_MEM_NULL); } + hadapt_mem = ark_mem->hadapt_mem; - /* argument <= 0 sets default, otherwise set input */ - if (maxcor <= 0) { step_mem->maxcor = MAXCOR; } - else { step_mem->maxcor = maxcor; } - - /* send argument to NLS structure */ - retval = SUNNonlinSolSetMaxIters(step_mem->NLS, step_mem->maxcor); - if (retval != SUN_SUCCESS) + /* Remove current SUNAdaptController object */ + retval = SUNAdaptController_Space(hadapt_mem->hcontroller, &lenrw, &leniw); + 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); + 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); -} - -/*--------------------------------------------------------------- - 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) -{ - 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; } + /* Choose values based on method, order */ - return (ARK_SUCCESS); -} + /* 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; -/*--------------------------------------------------------------- - 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; + /* 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.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) + { + 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.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) + { + 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(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; + } - /* access ARKodeARKStepMem structure and set function pointer */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } + /* imex */ + } + else + { + switch (step_mem->q) + { + case 2: /* just use standard defaults since better ones unknown */ + hadapt_mem->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __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; - step_mem->stage_predict = PredictStage; + retval = SUNAdaptController_Space(hadapt_mem->hcontroller, &lenrw, &leniw); + if (retval == SUN_SUCCESS) + { + ark_mem->liw += leniw; + ark_mem->lrw += lenrw; + } + } return (ARK_SUCCESS); } /*--------------------------------------------------------------- - arkStep_SetDeduceImplicitRhs: + ARKStepSetOrder: - 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. + Specifies the method order - 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. + ** 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 arkStep_SetDeduceImplicitRhs(ARKodeMem ark_mem, sunbooleantype deduce) +int ARKStepSetOrder(void* arkode_mem, int ord) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; + sunindextype Blrw, Bliw; int retval; - /* access ARKodeARKStepMem structure and set function pointer */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - step_mem->deduce_rhs = deduce; - return (ARK_SUCCESS); -} + /* set user-provided value, or default, depending on argument */ + if (ord <= 0) { step_mem->q = Q_DEFAULT; } + else { step_mem->q = ord; } -/*--------------------------------------------------------------- - arkStep_GetCurrentGamma: Returns the current value of gamma - ---------------------------------------------------------------*/ -int arkStep_GetCurrentGamma(ARKodeMem ark_mem, sunrealtype* gamma) -{ - 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); -} + /* 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; -/*--------------------------------------------------------------- - 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); } + ARKodeButcherTable_Space(step_mem->Be, &Bliw, &Blrw); + ARKodeButcherTable_Free(step_mem->Be); + step_mem->Be = NULL; + ark_mem->liw -= Bliw; + ark_mem->lrw -= Blrw; - /* return an error if local truncation error is not computed */ - if (ark_mem->fixedstep) { return (ARK_STEPPER_UNSUPPORTED); } + ARKodeButcherTable_Space(step_mem->Bi, &Bliw, &Blrw); + ARKodeButcherTable_Free(step_mem->Bi); + step_mem->Bi = NULL; + ark_mem->liw -= Bliw; + ark_mem->lrw -= Blrw; - /* otherwise, copy local truncation error vector to output */ - N_VScale(ONE, ark_mem->tempv1, ele); return (ARK_SUCCESS); } /*--------------------------------------------------------------- - arkStep_GetNumLinSolvSetups: - - Returns the current number of calls to the lsetup routine - ---------------------------------------------------------------*/ -int arkStep_GetNumLinSolvSetups(ARKodeMem ark_mem, long int* nlinsetups) -{ - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* get value from step_mem */ - *nlinsetups = step_mem->nsetups; + ARKStepSetLinear: - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - arkStep_GetNumNonlinSolvIters: + 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. - Returns the current number of nonlinear solver iterations + 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_GetNumNonlinSolvIters(ARKodeMem ark_mem, long int* nniters) +int ARKStepSetLinear(void* arkode_mem, int timedepend) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - *nniters = step_mem->nls_iters; + /* 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_GetNumNonlinSolvConvFails: + ARKStepSetNonlinear: - Returns the current number of nonlinear solver convergence fails + Specifies that the implicit portion of the problem is nonlinear. + Used to undo a previous call to ARKStepSetLinear. Automatically + loosens DeltaGammaMax back to default value. ---------------------------------------------------------------*/ -int arkStep_GetNumNonlinSolvConvFails(ARKodeMem ark_mem, long int* nnfails) +int ARKStepSetNonlinear(void* arkode_mem) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* set output from step_mem */ - *nnfails = step_mem->nls_fails; + /* set parameters */ + step_mem->linear = SUNFALSE; + step_mem->linear_timedep = SUNTRUE; + step_mem->dgmax = DGMAX; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - arkStep_GetNonlinSolvStats: + ARKStepSetExplicit: - Returns nonlinear solver statistics + Specifies that the implicit portion of the problem is disabled, + and to use an explicit RK method. ---------------------------------------------------------------*/ -int arkStep_GetNonlinSolvStats(ARKodeMem ark_mem, long int* nniters, - long int* nnfails) +int ARKStepSetExplicit(void* arkode_mem) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - *nniters = step_mem->nls_iters; - *nnfails = step_mem->nls_fails; + /* 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); } /*--------------------------------------------------------------- - arkStep_PrintAllStats: + ARKStepSetImplicit: - Prints integrator statistics + Specifies that the explicit portion of the problem is disabled, + and to use an implicit RK method. ---------------------------------------------------------------*/ -int arkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) +int ARKStepSetImplicit(void* arkode_mem) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; - ARKLsMem arkls_mem; - ARKLsMassMem arklsm_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - switch (fmt) + /* ensure that fi is defined */ + if (step_mem->fi == 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) - { - fprintf(outfile, "NLS iters per step = %" RSYM "\n", - (sunrealtype)step_mem->nls_iters / (sunrealtype)ark_mem->nst); - } - - /* 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); - } - } - - /* 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) - { - 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"); - } - } - - /* 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."); + 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 = arkSVtolerances(ark_mem, ark_mem->reltol, ark_mem->Vabstol); + } + else + { + retval = arkSStolerances(ark_mem, ark_mem->reltol, ark_mem->Sabstol); + } + if (retval != ARK_SUCCESS) { return (retval); } + } + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - arkStep_WriteParameters: + ARKStepSetImEx: - Outputs all solver parameters to the provided file pointer. + Specifies that the specifies that problem has both implicit and + explicit parts, and to use an ARK method (this is the default). ---------------------------------------------------------------*/ -int arkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) +int ARKStepSetImEx(void* arkode_mem) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &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) + /* ensure that fe and fi are defined */ + if (step_mem->fe == NULL) { - fprintf(fp, " Linear implicit problem"); - if (step_mem->linear_timedep) - { - fprintf(fp, " (time-dependent Jacobian)\n"); - } - else { fprintf(fp, " (time-independent Jacobian)\n"); } + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_MISSING_FE); + return (ARK_ILL_INPUT); } - if (step_mem->explicit && step_mem->implicit) + if (step_mem->fi == NULL) { - fprintf(fp, " ImEx integrator\n"); + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_MISSING_FI); + return (ARK_ILL_INPUT); } - else if (step_mem->implicit) { fprintf(fp, " Implicit integrator\n"); } - else { fprintf(fp, " Explicit integrator\n"); } - if (step_mem->implicit) + /* 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) { - 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); + if (ark_mem->itol == ARK_SV && ark_mem->Vabstol != NULL) + { + retval = arkSVtolerances(ark_mem, ark_mem->reltol, ark_mem->Vabstol); + } + else + { + retval = arkSStolerances(ark_mem, ark_mem->reltol, ark_mem->Sabstol); + } + if (retval != ARK_SUCCESS) { return (retval); } } - fprintf(fp, "\n"); return (ARK_SUCCESS); } -/*=============================================================== - Exported-but-deprecated user-callable functions. - ===============================================================*/ +/*--------------------------------------------------------------- + ARKStepSetTables: -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)); -} + Specifies to use customized Butcher tables for the system. -int ARKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) -{ - return (ARKodeReset(arkode_mem, tR, yR)); -} + If Bi is NULL, then this sets the integrator in 'explicit' mode. -int ARKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) -{ - return (ARKodeSStolerances(arkode_mem, reltol, abstol)); -} + If Be is NULL, then this sets the integrator in 'implicit' mode. -int ARKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) + 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 (ARKodeSVtolerances(arkode_mem, reltol, abstol)); -} + int retval; + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + sunindextype Blrw, Bliw; -int ARKStepWFtolerances(void* arkode_mem, ARKEwtFn efun) -{ - return (ARKodeWFtolerances(arkode_mem, efun)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepResStolerance(void* arkode_mem, sunrealtype rabstol) -{ - return (ARKodeResStolerance(arkode_mem, rabstol)); -} + /* 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 ARKStepResVtolerance(void* arkode_mem, N_Vector rabstol) -{ - return (ARKodeResVtolerance(arkode_mem, rabstol)); -} + /* 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 ARKStepResFtolerance(void* arkode_mem, ARKRwtFn rfun) -{ - return (ARKodeResFtolerance(arkode_mem, rfun)); -} + /* clear any existing parameters and Butcher tables */ + step_mem->stages = 0; + step_mem->q = 0; + step_mem->p = 0; -int ARKStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) -{ - return (ARKodeSetLinearSolver(arkode_mem, LS, A)); -} + 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 ARKStepSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, - SUNMatrix M, sunbooleantype time_dep) -{ - return (ARKodeSetMassLinearSolver(arkode_mem, LS, M, time_dep)); -} + 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 ARKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) -{ - return (ARKodeRootInit(arkode_mem, nrtfn, g)); -} + /* + * determine mode (implicit/explicit/ImEx), and perform appropriate actions + */ -int ARKStepSetDefaults(void* arkode_mem) -{ - return (ARKodeSetDefaults(arkode_mem)); + /* 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); } -int ARKStepSetOptimalParams(void* arkode_mem) +/*--------------------------------------------------------------- + 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) + ---------------------------------------------------------------*/ +int ARKStepSetTableNum(void* arkode_mem, ARKODE_DIRKTableID itable, + ARKODE_ERKTableID etable) { + int flag, retval; ARKodeMem ark_mem; ARKodeARKStepMem step_mem; - ARKodeHAdaptMem hadapt_mem; - int retval; - long int lenrw, leniw; + sunindextype Blrw, Bliw; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* access ARKodeHAdaptMem structure */ - if (ark_mem->hadapt_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->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__, - MSG_ARKADAPT_NO_MEM); - return (ARK_MEM_NULL); - } - hadapt_mem = ark_mem->hadapt_mem; + "At least one valid table number must be supplied"); + return (ARK_ILL_INPUT); - /* Remove current SUNAdaptController object */ - retval = SUNAdaptController_Space(hadapt_mem->hcontroller, &lenrw, &leniw); - if (retval == SUN_SUCCESS) - { - ark_mem->liw -= leniw; - ark_mem->lrw -= lenrw; + /* explicit */ } - if (hadapt_mem->owncontroller) + else if (itable < 0) { - retval = SUNAdaptController_Destroy(hadapt_mem->hcontroller); - ark_mem->hadapt_mem->owncontroller = SUNFALSE; - if (retval != SUN_SUCCESS) + /* check that argument specifies an explicit table */ + if (etable < ARKODE_MIN_ERK_NUM || etable > ARKODE_MAX_ERK_NUM) { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "SUNAdaptController_Destroy failure"); - return (ARK_MEM_FAIL); + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "Illegal ERK table number"); + return (ARK_ILL_INPUT); } - } - hadapt_mem->hcontroller = NULL; - /* Choose values based on method, order */ + /* 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; - /* explicit */ - if (step_mem->explicit && !step_mem->implicit) - { - hadapt_mem->hcontroller = SUNAdaptController_PI(ark_mem->sunctx); - if (hadapt_mem->hcontroller == NULL) + /* set method as purely explicit */ + flag = ARKStepSetExplicit(arkode_mem); + if (flag != ARK_SUCCESS) { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "SUNAdaptController_PI allocation failure"); - return (ARK_MEM_FAIL); + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Error in ARKStepSetExplicit"); + return (flag); } - (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 */ + /* implicit */ } - else if (step_mem->implicit && !step_mem->explicit) + else if (etable < 0) { - switch (step_mem->q) + /* check that argument specifies an implicit table */ + if (itable < ARKODE_MIN_DIRK_NUM || itable > ARKODE_MAX_DIRK_NUM) { - 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.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) - { - 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.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) - { - 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(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; + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "Illegal IRK table number"); + return (ARK_ILL_INPUT); } - /* imex */ + /* 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 */ } else { - switch (step_mem->q) + /* 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) { - 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; + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "Illegal ERK table number"); + return (ARK_ILL_INPUT); } - hadapt_mem->owncontroller = SUNTRUE; + step_mem->stages = step_mem->Bi->stages; + step_mem->q = step_mem->Bi->q; + step_mem->p = step_mem->Bi->p; - retval = SUNAdaptController_Space(hadapt_mem->hcontroller, &lenrw, &leniw); - if (retval == SUN_SUCCESS) + /* set method as ImEx */ + if (ARKStepSetImEx(arkode_mem) != ARK_SUCCESS) { - ark_mem->liw += leniw; - ark_mem->lrw += lenrw; + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_MISSING_F); + return (ARK_ILL_INPUT); } } + return (ARK_SUCCESS); } -int ARKStepSetOrder(void* arkode_mem, int ord) -{ - return (ARKodeSetOrder(arkode_mem, ord)); -} +/*--------------------------------------------------------------- + ARKStepSetTableName: -int ARKStepSetInterpolantType(void* arkode_mem, int itype) -{ - return (ARKodeSetInterpolantType(arkode_mem, itype)); -} + 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 ARKStepSetInterpolantDegree(void* arkode_mem, int degree) + 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 (ARKodeSetInterpolantDegree(arkode_mem, degree)); + return ARKStepSetTableNum(arkode_mem, arkButcherTableDIRKNameToID(itable), + arkButcherTableERKNameToID(etable)); } -int ARKStepSetDenseOrder(void* arkode_mem, int dord) -{ - return (ARKodeSetInterpolantDegree(arkode_mem, dord)); -} +/*--------------------------------------------------------------- + ARKStepSetNonlinCRDown: -int ARKStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) + 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) { - return (ARKodeSetNonlinearSolver(arkode_mem, NLS)); + 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 argument legal set it, otherwise set default */ + if (crdown <= ZERO) { step_mem->crdown = CRDOWN; } + else { step_mem->crdown = crdown; } + + return (ARK_SUCCESS); } -int ARKStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) +/*--------------------------------------------------------------- + ARKStepSetNonlinRDiv: + + 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) { - return (ARKodeSetNlsRhsFn(arkode_mem, 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 argument legal set it, otherwise set default */ + if (rdiv <= ZERO) { step_mem->rdiv = RDIV; } + else { step_mem->rdiv = rdiv; } + + return (ARK_SUCCESS); } -int ARKStepSetLinear(void* arkode_mem, int timedepend) +/*--------------------------------------------------------------- + ARKStepSetDeltaGammaMax: + + 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) { - return (ARKodeSetLinear(arkode_mem, timedepend)); + 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 argument legal set it, otherwise set default */ + if (dgmax <= ZERO) { step_mem->dgmax = DGMAX; } + else { step_mem->dgmax = dgmax; } + + return (ARK_SUCCESS); } -int ARKStepSetNonlinear(void* arkode_mem) +/*--------------------------------------------------------------- + ARKStepSetLSetupFrequency: + + 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) { - return (ARKodeSetNonlinear(arkode_mem)); + 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 argument legal set it, otherwise set default */ + if (msbp == 0) { step_mem->msbp = MSBP; } + else { step_mem->msbp = msbp; } + + return (ARK_SUCCESS); } -int ARKStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) +/*--------------------------------------------------------------- + ARKStepSetPredictorMethod: + + 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) { - return (ARKodeSetDeduceImplicitRhs(arkode_mem, deduce)); + 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 parameter */ + step_mem->predictor = pred_method; + + return (ARK_SUCCESS); } -int ARKStepSetAdaptController(void* arkode_mem, SUNAdaptController C) +/*--------------------------------------------------------------- + ARKStepSetMaxNonlinIters: + + 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) { - return (ARKodeSetAdaptController(arkode_mem, C)); -} + 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); + + /* 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 ARKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust) -{ - return (ARKodeSetAdaptivityAdjustment(arkode_mem, adjust)); -} + /* argument <= 0 sets default, otherwise set input */ + if (maxcor <= 0) { step_mem->maxcor = MAXCOR; } + else { step_mem->maxcor = maxcor; } -int ARKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) -{ - return (ARKodeSetCFLFraction(arkode_mem, cfl_frac)); -} + /* 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 ARKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) -{ - return (ARKodeSetSafetyFactor(arkode_mem, safety)); + return (ARK_SUCCESS); } -int ARKStepSetErrorBias(void* arkode_mem, sunrealtype bias) -{ - return (ARKodeSetErrorBias(arkode_mem, bias)); -} +/*--------------------------------------------------------------- + ARKStepSetNonlinConvCoef: -int ARKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) + 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) { - return (ARKodeSetMaxGrowth(arkode_mem, mx_growth)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) -{ - return (ARKodeSetMinReduction(arkode_mem, eta_min)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) -{ - return (ARKodeSetFixedStepBounds(arkode_mem, lb, ub)); -} + /* argument <= 0 sets default, otherwise set input */ + if (nlscoef <= ZERO) { step_mem->nlscoef = NLSCOEF; } + else { step_mem->nlscoef = nlscoef; } -int ARKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, - int pq, sunrealtype adapt_params[3]) -{ - return (arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); + return (ARK_SUCCESS); } -int ARKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) +/*--------------------------------------------------------------- + ARKStepSetStagePredictFn: 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) { - return (arkSetAdaptivityFn(arkode_mem, hfun, h_data)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) -{ - return (ARKodeSetMaxFirstGrowth(arkode_mem, etamx1)); -} + /* access ARKodeARKStepMem structure and set function pointer */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) -{ - return (ARKodeSetMaxEFailGrowth(arkode_mem, etamxf)); + step_mem->stage_predict = PredictStage; + return (ARK_SUCCESS); } -int ARKStepSetSmallNumEFails(void* arkode_mem, int small_nef) -{ - return (ARKodeSetSmallNumEFails(arkode_mem, small_nef)); -} +/*--------------------------------------------------------------- + ARKStepSetDeduceImplicitRhs: -int ARKStepSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) -{ - return (ARKodeSetMaxCFailGrowth(arkode_mem, etacf)); -} + 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 ARKStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) + 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 ARKStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) { - return (ARKodeSetNonlinCRDown(arkode_mem, crdown)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) -{ - return (ARKodeSetNonlinRDiv(arkode_mem, rdiv)); -} + /* access ARKodeARKStepMem structure and set function pointer */ + retval = arkStep_AccessStepMem(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)); + step_mem->deduce_rhs = deduce; + return (ARK_SUCCESS); } -int ARKStepSetLSetupFrequency(void* arkode_mem, int msbp) -{ - return (ARKodeSetLSetupFrequency(arkode_mem, msbp)); -} +/*=============================================================== + ARKStep optional output functions -- stepper-specific + ===============================================================*/ -int ARKStepSetPredictorMethod(void* arkode_mem, int pred_method) +/*--------------------------------------------------------------- + ARKStepGetCurrentGamma: Returns the current value of gamma + ---------------------------------------------------------------*/ +int ARKStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma) { - return (ARKodeSetPredictorMethod(arkode_mem, pred_method)); + int retval; + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + *gamma = step_mem->gamma; + return (retval); } -int ARKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) -{ - return (ARKodeSetStabilityFn(arkode_mem, EStab, estab_data)); -} +/*--------------------------------------------------------------- + ARKStepGetNumRhsEvals: -int ARKStepSetMaxErrTestFails(void* arkode_mem, int maxnef) + Returns the current number of calls to fe and fi + ---------------------------------------------------------------*/ +int ARKStepGetNumRhsEvals(void* arkode_mem, long int* fe_evals, long int* fi_evals) { - return (ARKodeSetMaxErrTestFails(arkode_mem, maxnef)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepSetMaxNonlinIters(void* arkode_mem, int maxcor) -{ - return (ARKodeSetMaxNonlinIters(arkode_mem, maxcor)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepSetMaxConvFails(void* arkode_mem, int maxncf) -{ - return (ARKodeSetMaxConvFails(arkode_mem, maxncf)); -} + /* get values from step_mem */ + *fe_evals = step_mem->nfe; + *fi_evals = step_mem->nfi; -int ARKStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) -{ - return (ARKodeSetNonlinConvCoef(arkode_mem, nlscoef)); + return (ARK_SUCCESS); } -int ARKStepSetConstraints(void* arkode_mem, N_Vector constraints) -{ - return (ARKodeSetConstraints(arkode_mem, constraints)); -} +/*--------------------------------------------------------------- + ARKStepGetNumLinSolvSetups: -int ARKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) + Returns the current number of calls to the lsetup routine + ---------------------------------------------------------------*/ +int ARKStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) { - 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 ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(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)); -} + /* get value from step_mem */ + *nlinsetups = step_mem->nsetups; -int ARKStepSetMinStep(void* arkode_mem, sunrealtype hmin) -{ - return (ARKodeSetMinStep(arkode_mem, hmin)); + return (ARK_SUCCESS); } -int ARKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) -{ - return (ARKodeSetMaxStep(arkode_mem, hmax)); -} +/*--------------------------------------------------------------- + ARKStepGetCurrentButcherTables: -int ARKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) + Sets pointers to the explicit and implicit Butcher tables + currently in use. + ---------------------------------------------------------------*/ +int ARKStepGetCurrentButcherTables(void* arkode_mem, ARKodeButcherTable* Bi, + ARKodeButcherTable* Be) { - return (ARKodeSetInterpolateStopTime(arkode_mem, interp)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepSetStopTime(void* arkode_mem, sunrealtype tstop) -{ - return (ARKodeSetStopTime(arkode_mem, tstop)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepClearStopTime(void* arkode_mem) -{ - return (ARKodeClearStopTime(arkode_mem)); + /* get tables from step_mem */ + *Bi = step_mem->Bi; + *Be = step_mem->Be; + return (ARK_SUCCESS); } -int ARKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) -{ - return (ARKodeSetFixedStep(arkode_mem, hfixed)); -} +/*--------------------------------------------------------------- + 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) -int ARKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) + Returns an estimate of the local error + ---------------------------------------------------------------*/ +int ARKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele) { - return (ARKodeSetMaxNumConstrFails(arkode_mem, maxfails)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepSetRootDirection(void* arkode_mem, int* rootdir) -{ - return (ARKodeSetRootDirection(arkode_mem, rootdir)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepSetNoInactiveRootWarn(void* arkode_mem) -{ - return (ARKodeSetNoInactiveRootWarn(arkode_mem)); -} + SUNFunctionBegin(ark_mem->sunctx); -int ARKStepSetUserData(void* arkode_mem, void* user_data) -{ - return (ARKodeSetUserData(arkode_mem, user_data)); -} + /* copy vector to output */ + N_VScale(ONE, ark_mem->tempv1, ele); -int ARKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) -{ - return (ARKodeSetPostprocessStepFn(arkode_mem, ProcessStep)); + return (ARK_SUCCESS); } -int ARKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) -{ - return (ARKodeSetPostprocessStageFn(arkode_mem, ProcessStage)); -} +/*--------------------------------------------------------------- + ARKStepGetTimestepperStats: -int ARKStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) + 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 (ARKodeSetStagePredictFn(arkode_mem, PredictStage)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepSetJacFn(void* arkode_mem, ARKLsJacFn jac) -{ - return (ARKodeSetJacFn(arkode_mem, jac)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepSetMassFn(void* arkode_mem, ARKLsMassFn mass) -{ - return (ARKodeSetMassFn(arkode_mem, mass)); -} + /* set expsteps and accsteps from adaptivity structure */ + *expsteps = ark_mem->hadapt_mem->nst_exp; + *accsteps = ark_mem->hadapt_mem->nst_acc; -int ARKStepSetJacEvalFrequency(void* arkode_mem, long int msbj) -{ - return (ARKodeSetJacEvalFrequency(arkode_mem, msbj)); -} + /* 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 ARKStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) -{ - return (ARKodeSetLinearSolutionScaling(arkode_mem, onoff)); + return (ARK_SUCCESS); } -int ARKStepSetEpsLin(void* arkode_mem, sunrealtype eplifac) -{ - return (ARKodeSetEpsLin(arkode_mem, eplifac)); -} +/*--------------------------------------------------------------- + ARKStepGetNumNonlinSolvIters: -int ARKStepSetMassEpsLin(void* arkode_mem, sunrealtype eplifac) + Returns the current number of nonlinear solver iterations + ---------------------------------------------------------------*/ +int ARKStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) { - return (ARKodeSetMassEpsLin(arkode_mem, eplifac)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) -{ - return (ARKodeSetLSNormFactor(arkode_mem, nrmfac)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac) -{ - return (ARKodeSetMassLSNormFactor(arkode_mem, nrmfac)); -} + *nniters = step_mem->nls_iters; -int ARKStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, - ARKLsPrecSolveFn psolve) -{ - return (ARKodeSetPreconditioner(arkode_mem, psetup, psolve)); + return (ARK_SUCCESS); } -int ARKStepSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, - ARKLsMassPrecSolveFn psolve) -{ - return (ARKodeSetMassPreconditioner(arkode_mem, psetup, psolve)); -} +/*--------------------------------------------------------------- + ARKStepGetNumNonlinSolvConvFails: -int ARKStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, - ARKLsJacTimesVecFn jtimes) + Returns the current number of nonlinear solver convergence fails + ---------------------------------------------------------------*/ +int ARKStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) { - return (ARKodeSetJacTimes(arkode_mem, jtsetup, jtimes)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) -{ - return (ARKodeSetJacTimesRhsFn(arkode_mem, jtimesRhsFn)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn msetup, - ARKLsMassTimesVecFn mtimes, void* mtimes_data) -{ - return (ARKodeSetMassTimes(arkode_mem, msetup, mtimes, mtimes_data)); -} + /* set output from step_mem */ + *nnfails = step_mem->nls_fails; -int ARKStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) -{ - return (ARKodeSetLinSysFn(arkode_mem, linsys)); + return (ARK_SUCCESS); } -int ARKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask) -{ - return (ARKodeEvolve(arkode_mem, tout, yout, tret, itask)); -} +/*--------------------------------------------------------------- + ARKStepGetNonlinSolvStats: -int ARKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) + Returns nonlinear solver statistics + ---------------------------------------------------------------*/ +int ARKStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, + long int* nnfails) { - return (ARKodeGetDky(arkode_mem, t, k, dky)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) -{ - return (ARKodeComputeState(arkode_mem, zcor, z)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepGetNumExpSteps(void* arkode_mem, long int* nsteps) -{ - return (ARKodeGetNumExpSteps(arkode_mem, nsteps)); -} + *nniters = step_mem->nls_iters; + *nnfails = step_mem->nls_fails; -int ARKStepGetNumAccSteps(void* arkode_mem, long int* nsteps) -{ - return (ARKodeGetNumAccSteps(arkode_mem, nsteps)); + return (ARK_SUCCESS); } -int ARKStepGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) -{ - return (ARKodeGetNumStepAttempts(arkode_mem, nstep_attempts)); -} +/*--------------------------------------------------------------- + ARKStepPrintAllStats: -int ARKStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) + Prints integrator statistics + ---------------------------------------------------------------*/ +int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) { - return (ARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + ARKLsMem arkls_mem; + ARKLsMassMem arklsm_mem; + int retval; -int ARKStepGetNumErrTestFails(void* arkode_mem, long int* netfails) -{ - return (ARKodeGetNumErrTestFails(arkode_mem, netfails)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele) -{ - return (ARKodeGetEstLocalErrors(arkode_mem, ele)); -} + /* step and rootfinding stats */ + retval = arkPrintAllStats(arkode_mem, outfile, fmt); + 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(arkode_mem)) + { + arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(arkode_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(arkode_mem)) + { + arklsm_mem = (ARKLsMassMem)(ark_mem->step_getmassmem(arkode_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(arkode_mem)) + { + arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(arkode_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(arkode_mem)) + { + arklsm_mem = (ARKLsMassMem)(ark_mem->step_getmassmem(arkode_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)); -} +/*--------------------------------------------------------------- + ARKStepWriteParameters: -int ARKStepGetNumGEvals(void* arkode_mem, long int* ngevals) + Outputs all solver parameters to the provided file pointer. + ---------------------------------------------------------------*/ +int ARKStepWriteParameters(void* arkode_mem, FILE* fp) { - return (ARKodeGetNumGEvals(arkode_mem, ngevals)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int flag, retval; -int ARKStepGetRootInfo(void* arkode_mem, int* rootsfound) -{ - return (ARKodeGetRootInfo(arkode_mem, rootsfound)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) -{ - return (ARKodeGetNumConstrFails(arkode_mem, nconstrfails)); -} + /* 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); + } -int ARKStepGetUserData(void* arkode_mem, void** user_data) -{ - return (ARKodeGetUserData(arkode_mem, user_data)); -} + /* 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 ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) -{ - return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); -} + 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"); -char* ARKStepGetReturnFlagName(long int flag) -{ - return (ARKodeGetReturnFlagName(flag)); + return (ARK_SUCCESS); } -int ARKStepWriteParameters(void* arkode_mem, FILE* fp) -{ - return (ARKodeWriteParameters(arkode_mem, fp)); -} +/*--------------------------------------------------------------- + ARKStepWriteButcher: + Outputs Butcher tables to the provided file pointer. + ---------------------------------------------------------------*/ int ARKStepWriteButcher(void* arkode_mem, FILE* fp) { int retval; ARKodeMem ark_mem; ARKodeARKStepMem step_mem; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* check that Butcher table is non-NULL (otherwise report error) */ @@ -2230,250 +2300,6 @@ 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 939a82ad02..f52325b487 100644 --- a/src/arkode/arkode_arkstep_nls.c +++ b/src/arkode/arkode_arkstep_nls.c @@ -24,22 +24,23 @@ #include "arkode_impl.h" /*=============================================================== - Interface routines supplied to ARKODE + Exported functions ===============================================================*/ /*--------------------------------------------------------------- - arkStep_SetNonlinearSolver: + ARKStepSetNonlinearSolver: This routine attaches a SUNNonlinearSolver object to the ARKStep module. ---------------------------------------------------------------*/ -int arkStep_SetNonlinearSolver(ARKodeMem ark_mem, SUNNonlinearSolver NLS) +int ARKStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Return immediately if NLS input is NULL */ @@ -101,19 +102,20 @@ int arkStep_SetNonlinearSolver(ARKodeMem ark_mem, SUNNonlinearSolver NLS) } /*--------------------------------------------------------------- - arkStep_SetNlsRhsFn: + ARKStepSetNlsRhsFn: 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) +int ARKStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) { + ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + 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; } @@ -123,137 +125,22 @@ int arkStep_SetNlsRhsFn(ARKodeMem ark_mem, ARKRhsFn nls_fi) } /*--------------------------------------------------------------- - 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: + ARKStepGetNonlinearSystemData: 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) +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(ark_mem, __func__, &step_mem); + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } *tcur = ark_mem->tcur; @@ -267,9 +154,9 @@ int arkStep_GetNonlinearSystemData(ARKodeMem ark_mem, sunrealtype* tcur, return (ARK_SUCCESS); } -/*=============================================================== +/*--------------------------------------------------------------- Utility routines called by ARKStep - ===============================================================*/ + ---------------------------------------------------------------*/ /*--------------------------------------------------------------- arkStep_NlsInit: @@ -324,7 +211,58 @@ int arkStep_NlsInit(ARKodeMem ark_mem) return (ARK_NLS_INIT_FAIL); } - retval = arkStep_SetNlsSysFn(ark_mem); + /* 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); + } if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, @@ -425,7 +363,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 @@ -450,9 +388,9 @@ int arkStep_Nls(ARKodeMem ark_mem, int nflag) return (retval); } -/*=============================================================== +/*--------------------------------------------------------------- Interface routines supplied to the SUNNonlinearSolver module - ===============================================================*/ + ---------------------------------------------------------------*/ /*--------------------------------------------------------------- arkStep_NlsLSetup: @@ -466,8 +404,8 @@ int arkStep_NlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* arkode_me ARKodeARKStepMem step_mem; int retval; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update convfail based on jbad flag */ @@ -508,8 +446,8 @@ int arkStep_NlsLSolve(N_Vector b, void* arkode_mem) ARKodeARKStepMem step_mem; int retval, nonlin_iter; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* retrieve nonlinear solver iteration from module */ @@ -528,8 +466,7 @@ int arkStep_NlsLSolve(N_Vector b, void* arkode_mem) } /*--------------------------------------------------------------- - arkStep_NlsResidual_MassIdent - arkStep_NlsResidual_MassIdent_TrivialPredAutonomous + arkStep_NlsResidual_MassIdent: This routine evaluates the nonlinear residual for the additive Runge-Kutta method. It assumes that any data from previous @@ -554,10 +491,6 @@ 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) { @@ -568,66 +501,20 @@ int arkStep_NlsResidual_MassIdent(N_Vector zcor, N_Vector r, void* arkode_mem) sunrealtype c[3]; N_Vector X[3]; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(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 */ 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; @@ -641,8 +528,7 @@ int arkStep_NlsResidual_MassIdent_TrivialPredAutonomous(N_Vector zcor, N_Vector } /*--------------------------------------------------------------- - arkStep_NlsResidual_MassFixed - arkStep_NlsResidual_MassFixed_TrivialPredAutonomous + arkStep_NlsResidual_MassFixed: This routine evaluates the nonlinear residual for the additive Runge-Kutta method. It assumes that any data from previous @@ -667,10 +553,6 @@ int arkStep_NlsResidual_MassIdent_TrivialPredAutonomous(N_Vector zcor, N_Vector 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) { @@ -681,14 +563,14 @@ int arkStep_NlsResidual_MassFixed(N_Vector zcor, N_Vector r, void* arkode_mem) sunrealtype c[3]; N_Vector X[3]; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(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 */ + /* 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++; @@ -711,56 +593,6 @@ 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: @@ -799,8 +631,8 @@ int arkStep_NlsResidual_MassTDep(N_Vector zcor, N_Vector r, void* arkode_mem) ARKodeARKStepMem step_mem; int retval; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update 'ycur' value as stored predictor + current corrector */ @@ -824,8 +656,7 @@ int arkStep_NlsResidual_MassTDep(N_Vector zcor, N_Vector r, void* arkode_mem) } /*--------------------------------------------------------------- - arkStep_NlsFPFunction_MassIdent - arkStep_NlsFPFunction_MassIdent_TrivialPredAutonomous + arkStep_NlsFPFunction_MassIdent: This routine evaluates the fixed point iteration function for the additive Runge-Kutta method. It assumes that any data from @@ -857,10 +688,6 @@ 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) { @@ -869,8 +696,8 @@ int arkStep_NlsFPFunction_MassIdent(N_Vector zcor, N_Vector g, void* arkode_mem) ARKodeARKStepMem step_mem; int retval; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update 'ycur' value as stored predictor + current corrector */ @@ -890,50 +717,8 @@ 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_TrivialPredAutonomous + arkStep_NlsFPFunction_MassFixed: This routine evaluates the fixed point iteration function for the additive Runge-Kutta method. It assumes that any data from @@ -966,10 +751,6 @@ int arkStep_NlsFPFunction_MassIdent_TrivialPredAutonomous(N_Vector zcor, 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) { @@ -978,8 +759,8 @@ int arkStep_NlsFPFunction_MassFixed(N_Vector zcor, N_Vector g, void* arkode_mem) ARKodeARKStepMem step_mem; int retval; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update 'ycur' value as stored predictor + current corrector */ @@ -1004,52 +785,6 @@ 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: @@ -1093,8 +828,8 @@ int arkStep_NlsFPFunction_MassTDep(N_Vector zcor, N_Vector g, void* arkode_mem) ARKodeARKStepMem step_mem; int retval; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update 'ycur' value as stored predictor + current corrector */ @@ -1140,8 +875,7 @@ 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, - SUNDIALS_MAYBE_UNUSED N_Vector y, N_Vector del, +int arkStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, sunrealtype tol, N_Vector ewt, void* arkode_mem) { /* temporary variables */ @@ -1150,8 +884,8 @@ int arkStep_NlsConvTest(SUNNonlinearSolver NLS, sunrealtype delnrm, dcon; int m, retval; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(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 5355311d98..6eb5f576da 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 ARKodeMem and ARKLsMem structures */ - retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Test compatibility of NVECTOR package with the BAND preconditioner */ @@ -187,8 +187,7 @@ int ARKBandPrecInit(void* arkode_mem, sunindextype N, sunindextype mu, arkls_mem->pfree = ARKBandPrecFree; /* Attach preconditioner solve and setup functions */ - retval = ARKodeSetPreconditioner(arkode_mem, ARKBandPrecSetup, - ARKBandPrecSolve); + retval = arkLSSetPreconditioner(arkode_mem, ARKBandPrecSetup, ARKBandPrecSolve); return (retval); } @@ -201,8 +200,8 @@ int ARKBandPrecGetWorkSpace(void* arkode_mem, long int* lenrwBP, long int* leniw long int lrw, liw; int retval; - /* access ARKodeMem and ARKLsMem structures */ - retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Return immediately if ARKBandPrecData is NULL */ @@ -261,8 +260,8 @@ int ARKBandPrecGetNumRhsEvals(void* arkode_mem, long int* nfevalsBP) ARKBandPrecData pdata; int retval; - /* access ARKodeMem and ARKLsMem structures */ - retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Return immediately if ARKBandPrecData is NULL */ @@ -410,12 +409,9 @@ 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(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) +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) { ARKBandPrecData pdata; int retval; diff --git a/src/arkode/arkode_bbdpre.c b/src/arkode/arkode_bbdpre.c index f6445c8ede..52f2ee29d9 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 ARKodeMem and ARKLsMem structure */ - retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKMilsMem structure */ + retval = arkLs_AccessLMem(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 = ARKodeSetPreconditioner(arkode_mem, ARKBBDPrecSetup, ARKBBDPrecSolve); + retval = arkLSSetPreconditioner(arkode_mem, ARKBBDPrecSetup, ARKBBDPrecSolve); return (retval); } @@ -297,8 +297,8 @@ int ARKBBDPrecReInit(void* arkode_mem, sunindextype mudq, sunindextype mldq, sunindextype Nlocal; int retval; - /* access ARKodeMem and ARKLsMem structure */ - retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKMilsMem structure */ + retval = arkLs_AccessLMem(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 ARKodeMem and ARKLsMem structure */ - retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKMilsMem structure */ + retval = arkLs_AccessLMem(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 ARKodeMem and ARKLsMem structure */ - retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKMilsMem structure */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Return immediately if ARKBBDPrecData is NULL */ @@ -426,8 +426,7 @@ 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, - SUNDIALS_MAYBE_UNUSED N_Vector fy, +static int ARKBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, sunbooleantype jok, sunbooleantype* jcurPtr, sunrealtype gamma, void* bbd_data) { @@ -518,12 +517,9 @@ static int ARKBBDPrecSetup(sunrealtype t, N_Vector y, The value returned by the ARKBBDPrecSolve function is the same as the value returned from the linear solver object. ---------------------------------------------------------------*/ -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) +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) { int retval; ARKBBDPrecData pdata; diff --git a/src/arkode/arkode_butcher.c b/src/arkode/arkode_butcher.c index f0d4326d39..0807d05fca 100644 --- a/src/arkode/arkode_butcher.c +++ b/src/arkode/arkode_butcher.c @@ -25,137 +25,102 @@ #define TOL (SUNRsqrt(SUN_UNIT_ROUNDOFF)) /* Private utility functions for checking method order */ -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 __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 __ButcherSimplifyingAssumptions(sunrealtype** A, sunrealtype* b, sunrealtype* c, int s); @@ -488,7 +453,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if (outfile) { fprintf(outfile, "ARKodeButcherTable_CheckOrder:\n"); } /* row sum condition */ - if (arkode_butcher_rowsum(A, c, s)) { (*q) = 0; } + if (__rowsum(A, c, s)) { (*q) = 0; } else { (*q) = -1; @@ -497,7 +462,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, /* order 1 condition */ if ((*q) == 0) { - if (arkode_butcher_order1(b, s)) { (*q) = 1; } + if (__order1(b, s)) { (*q) = 1; } else { if (outfile) { fprintf(outfile, " method fails order 1 condition\n"); } @@ -506,7 +471,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, /* order 2 condition */ if ((*q) == 1) { - if (arkode_butcher_order2(b, c, s)) { (*q) = 2; } + if (__order2(b, c, s)) { (*q) = 2; } else { if (outfile) { fprintf(outfile, " method fails order 2 condition\n"); } @@ -516,12 +481,12 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*q) == 2) { alltrue = SUNTRUE; - if (!arkode_butcher_order3a(b, c, c, s)) + if (!__order3a(b, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 3 condition A\n"); } } - if (!arkode_butcher_order3b(b, A, c, s)) + if (!__order3b(b, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 3 condition B\n"); } @@ -532,22 +497,22 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*q) == 3) { alltrue = SUNTRUE; - if (!arkode_butcher_order4a(b, c, c, c, s)) + if (!__order4a(b, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 4 condition A\n"); } } - if (!arkode_butcher_order4b(b, c, A, c, s)) + if (!__order4b(b, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 4 condition B\n"); } } - if (!arkode_butcher_order4c(b, A, c, c, s)) + if (!__order4c(b, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 4 condition C\n"); } } - if (!arkode_butcher_order4d(b, A, A, c, s)) + if (!__order4d(b, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 4 condition D\n"); } @@ -558,47 +523,47 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*q) == 4) { alltrue = SUNTRUE; - if (!arkode_butcher_order5a(b, c, c, c, c, s)) + if (!__order5a(b, c, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition A\n"); } } - if (!arkode_butcher_order5b(b, c, c, A, c, s)) + if (!__order5b(b, c, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition B\n"); } } - if (!arkode_butcher_order5c(b, A, c, A, c, s)) + if (!__order5c(b, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition C\n"); } } - if (!arkode_butcher_order5d(b, c, A, c, c, s)) + if (!__order5d(b, c, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition D\n"); } } - if (!arkode_butcher_order5e(b, A, c, c, c, s)) + if (!__order5e(b, A, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition E\n"); } } - if (!arkode_butcher_order5f(b, c, A, A, c, s)) + if (!__order5f(b, c, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition F\n"); } } - if (!arkode_butcher_order5g(b, A, c, A, c, s)) + if (!__order5g(b, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition G\n"); } } - if (!arkode_butcher_order5h(b, A, A, c, c, s)) + if (!__order5h(b, A, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition H\n"); } } - if (!arkode_butcher_order5i(b, A, A, A, c, s)) + if (!__order5i(b, A, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition I\n"); } @@ -609,97 +574,97 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*q) == 5) { alltrue = SUNTRUE; - if (!arkode_butcher_order6a(b, c, c, c, c, c, s)) + if (!__order6a(b, c, c, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition A\n"); } } - if (!arkode_butcher_order6b(b, c, c, c, A, c, s)) + if (!__order6b(b, c, c, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition B\n"); } } - if (!arkode_butcher_order6c(b, c, A, c, A, c, s)) + if (!__order6c(b, c, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition C\n"); } } - if (!arkode_butcher_order6d(b, c, c, A, c, c, s)) + if (!__order6d(b, c, c, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition D\n"); } } - if (!arkode_butcher_order6e(b, c, c, A, A, c, s)) + if (!__order6e(b, c, c, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition E\n"); } } - if (!arkode_butcher_order6f(b, A, A, c, A, c, s)) + if (!__order6f(b, A, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition F\n"); } } - if (!arkode_butcher_order6g(b, c, A, c, c, c, s)) + if (!__order6g(b, c, A, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition G\n"); } } - if (!arkode_butcher_order6h(b, c, A, c, A, c, s)) + if (!__order6h(b, c, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition H\n"); } } - if (!arkode_butcher_order6i(b, c, A, A, c, c, s)) + if (!__order6i(b, c, A, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition I\n"); } } - if (!arkode_butcher_order6j(b, c, A, A, A, c, s)) + if (!__order6j(b, c, A, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition J\n"); } } - if (!arkode_butcher_order6k(b, A, c, c, c, c, s)) + if (!__order6k(b, A, c, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition K\n"); } } - if (!arkode_butcher_order6l(b, A, c, c, A, c, s)) + if (!__order6l(b, A, c, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition L\n"); } } - if (!arkode_butcher_order6m(b, A, A, c, A, c, s)) + if (!__order6m(b, A, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition M\n"); } } - if (!arkode_butcher_order6n(b, A, c, A, c, c, s)) + if (!__order6n(b, A, c, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition N\n"); } } - if (!arkode_butcher_order6o(b, A, c, A, A, c, s)) + if (!__order6o(b, A, c, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition O\n"); } } - if (!arkode_butcher_order6p(b, A, A, c, c, c, s)) + if (!__order6p(b, A, A, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition P\n"); } } - if (!arkode_butcher_order6q(b, A, A, c, A, c, s)) + if (!__order6q(b, A, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition Q\n"); } } - if (!arkode_butcher_order6r(b, A, A, A, c, c, s)) + if (!__order6r(b, A, A, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition R\n"); } } - if (!arkode_butcher_order6s(b, A, A, A, A, c, s)) + if (!__order6s(b, A, A, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition S\n"); } @@ -726,7 +691,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, b = d; /* row sum condition */ - if (arkode_butcher_rowsum(A, c, s)) { (*p) = 0; } + if (__rowsum(A, c, s)) { (*p) = 0; } else { (*p) = -1; @@ -738,7 +703,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, /* order 1 condition */ if ((*p) == 0) { - if (arkode_butcher_order1(b, s)) { (*p) = 1; } + if (__order1(b, s)) { (*p) = 1; } else { if (outfile) @@ -750,7 +715,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, /* order 2 condition */ if ((*p) == 1) { - if (arkode_butcher_order2(b, c, s)) { (*p) = 2; } + if (__order2(b, c, s)) { (*p) = 2; } else { if (outfile) @@ -763,7 +728,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*p) == 2) { alltrue = SUNTRUE; - if (!arkode_butcher_order3a(b, c, c, s)) + if (!__order3a(b, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -771,7 +736,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 3 condition A\n"); } } - if (!arkode_butcher_order3b(b, A, c, s)) + if (!__order3b(b, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -785,7 +750,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*p) == 3) { alltrue = SUNTRUE; - if (!arkode_butcher_order4a(b, c, c, c, s)) + if (!__order4a(b, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -793,7 +758,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 4 condition A\n"); } } - if (!arkode_butcher_order4b(b, c, A, c, s)) + if (!__order4b(b, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -801,7 +766,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 4 condition B\n"); } } - if (!arkode_butcher_order4c(b, A, c, c, s)) + if (!__order4c(b, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -809,7 +774,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 4 condition C\n"); } } - if (!arkode_butcher_order4d(b, A, A, c, s)) + if (!__order4d(b, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -823,7 +788,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*p) == 4) { alltrue = SUNTRUE; - if (!arkode_butcher_order5a(b, c, c, c, c, s)) + if (!__order5a(b, c, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -831,7 +796,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition A\n"); } } - if (!arkode_butcher_order5b(b, c, c, A, c, s)) + if (!__order5b(b, c, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -839,7 +804,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition B\n"); } } - if (!arkode_butcher_order5c(b, A, c, A, c, s)) + if (!__order5c(b, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -847,7 +812,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition C\n"); } } - if (!arkode_butcher_order5d(b, c, A, c, c, s)) + if (!__order5d(b, c, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -855,7 +820,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition D\n"); } } - if (!arkode_butcher_order5e(b, A, c, c, c, s)) + if (!__order5e(b, A, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -863,7 +828,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition E\n"); } } - if (!arkode_butcher_order5f(b, c, A, A, c, s)) + if (!__order5f(b, c, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -871,7 +836,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition F\n"); } } - if (!arkode_butcher_order5g(b, A, c, A, c, s)) + if (!__order5g(b, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -879,7 +844,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition G\n"); } } - if (!arkode_butcher_order5h(b, A, A, c, c, s)) + if (!__order5h(b, A, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -887,7 +852,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition H\n"); } } - if (!arkode_butcher_order5i(b, A, A, A, c, s)) + if (!__order5i(b, A, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -901,7 +866,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*p) == 5) { alltrue = SUNTRUE; - if (!arkode_butcher_order6a(b, c, c, c, c, c, s)) + if (!__order6a(b, c, c, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -909,7 +874,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition A\n"); } } - if (!arkode_butcher_order6b(b, c, c, c, A, c, s)) + if (!__order6b(b, c, c, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -917,7 +882,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition B\n"); } } - if (!arkode_butcher_order6c(b, c, A, c, A, c, s)) + if (!__order6c(b, c, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -925,7 +890,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition C\n"); } } - if (!arkode_butcher_order6d(b, c, c, A, c, c, s)) + if (!__order6d(b, c, c, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -933,7 +898,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition D\n"); } } - if (!arkode_butcher_order6e(b, c, c, A, A, c, s)) + if (!__order6e(b, c, c, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -941,7 +906,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition E\n"); } } - if (!arkode_butcher_order6f(b, A, A, c, A, c, s)) + if (!__order6f(b, A, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -949,7 +914,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition F\n"); } } - if (!arkode_butcher_order6g(b, c, A, c, c, c, s)) + if (!__order6g(b, c, A, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -957,7 +922,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition G\n"); } } - if (!arkode_butcher_order6h(b, c, A, c, A, c, s)) + if (!__order6h(b, c, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -965,7 +930,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition H\n"); } } - if (!arkode_butcher_order6i(b, c, A, A, c, c, s)) + if (!__order6i(b, c, A, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -973,7 +938,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition I\n"); } } - if (!arkode_butcher_order6j(b, c, A, A, A, c, s)) + if (!__order6j(b, c, A, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -981,7 +946,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition J\n"); } } - if (!arkode_butcher_order6k(b, A, c, c, c, c, s)) + if (!__order6k(b, A, c, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -989,7 +954,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition K\n"); } } - if (!arkode_butcher_order6l(b, A, c, c, A, c, s)) + if (!__order6l(b, A, c, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -997,7 +962,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition L\n"); } } - if (!arkode_butcher_order6m(b, A, A, c, A, c, s)) + if (!__order6m(b, A, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -1005,7 +970,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition M\n"); } } - if (!arkode_butcher_order6n(b, A, c, A, c, c, s)) + if (!__order6n(b, A, c, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -1013,7 +978,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition N\n"); } } - if (!arkode_butcher_order6o(b, A, c, A, A, c, s)) + if (!__order6o(b, A, c, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -1021,7 +986,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition O\n"); } } - if (!arkode_butcher_order6p(b, A, A, c, c, c, s)) + if (!__order6p(b, A, A, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -1029,7 +994,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition P\n"); } } - if (!arkode_butcher_order6q(b, A, A, c, A, c, s)) + if (!__order6q(b, A, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -1037,7 +1002,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition Q\n"); } } - if (!arkode_butcher_order6r(b, A, A, A, c, c, s)) + if (!__order6r(b, A, A, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -1045,7 +1010,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition R\n"); } } - if (!arkode_butcher_order6s(b, A, A, A, A, c, s)) + if (!__order6s(b, A, A, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -1163,10 +1128,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B if (outfile) { fprintf(outfile, "ARKodeButcherTable_CheckARKOrder:\n"); } /* row sum conditions */ - if (arkode_butcher_rowsum(A[0], c[0], s) && arkode_butcher_rowsum(A[1], c[1], s)) - { - (*q) = 0; - } + if (__rowsum(A[0], c[0], s) && __rowsum(A[1], c[1], s)) { (*q) = 0; } else { (*q) = -1; @@ -1175,10 +1137,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B /* order 1 conditions */ if ((*q) == 0) { - if (arkode_butcher_order1(b[0], s) && arkode_butcher_order1(b[1], s)) - { - (*q) = 1; - } + if (__order1(b[0], s) && __order1(b[1], s)) { (*q) = 1; } else { if (outfile) { fprintf(outfile, " method fails order 1 conditions\n"); } @@ -1192,7 +1151,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (j = 0; j < 2; j++) { - alltrue = (alltrue && arkode_butcher_order2(b[i], c[j], s)); + alltrue = (alltrue && __order2(b[i], c[j], s)); } } if (alltrue) { (*q) = 2; } @@ -1211,7 +1170,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (k = 0; k < 2; k++) { - alltrue = (alltrue && arkode_butcher_order3a(b[i], c[j], c[k], s)); + alltrue = (alltrue && __order3a(b[i], c[j], c[k], s)); } } } @@ -1225,7 +1184,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (k = 0; k < 2; k++) { - alltrue = (alltrue && arkode_butcher_order3b(b[i], A[j], c[k], s)); + alltrue = (alltrue && __order3b(b[i], A[j], c[k], s)); } } } @@ -1247,8 +1206,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && - arkode_butcher_order4a(b[i], c[j], c[k], c[l], s)); + alltrue = (alltrue && __order4a(b[i], c[j], c[k], c[l], s)); } } } @@ -1265,8 +1223,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && - arkode_butcher_order4b(b[i], c[j], A[k], c[l], s)); + alltrue = (alltrue && __order4b(b[i], c[j], A[k], c[l], s)); } } } @@ -1283,8 +1240,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && - arkode_butcher_order4c(b[i], A[j], c[k], c[l], s)); + alltrue = (alltrue && __order4c(b[i], A[j], c[k], c[l], s)); } } } @@ -1301,8 +1257,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && - arkode_butcher_order4d(b[i], A[j], A[k], c[l], s)); + alltrue = (alltrue && __order4d(b[i], A[j], A[k], c[l], s)); } } } @@ -1327,8 +1282,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5a(b[i], c[j], c[k], - c[l], c[m], s)); + alltrue = (alltrue && __order5a(b[i], c[j], c[k], c[l], c[m], s)); } } } @@ -1348,8 +1302,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5b(b[i], c[j], c[k], - A[l], c[m], s)); + alltrue = (alltrue && __order5b(b[i], c[j], c[k], A[l], c[m], s)); } } } @@ -1369,8 +1322,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5c(b[i], A[j], c[k], - A[l], c[m], s)); + alltrue = (alltrue && __order5c(b[i], A[j], c[k], A[l], c[m], s)); } } } @@ -1390,8 +1342,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5d(b[i], c[j], A[k], - c[l], c[m], s)); + alltrue = (alltrue && __order5d(b[i], c[j], A[k], c[l], c[m], s)); } } } @@ -1411,8 +1362,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5e(b[i], A[j], c[k], - c[l], c[m], s)); + alltrue = (alltrue && __order5e(b[i], A[j], c[k], c[l], c[m], s)); } } } @@ -1432,8 +1382,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5f(b[i], c[j], A[k], - A[l], c[m], s)); + alltrue = (alltrue && __order5f(b[i], c[j], A[k], A[l], c[m], s)); } } } @@ -1453,8 +1402,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5g(b[i], A[j], c[k], - A[l], c[m], s)); + alltrue = (alltrue && __order5g(b[i], A[j], c[k], A[l], c[m], s)); } } } @@ -1474,8 +1422,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5h(b[i], A[j], A[k], - c[l], c[m], s)); + alltrue = (alltrue && __order5h(b[i], A[j], A[k], c[l], c[m], s)); } } } @@ -1495,8 +1442,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5i(b[i], A[j], A[k], - A[l], c[m], s)); + alltrue = (alltrue && __order5i(b[i], A[j], A[k], A[l], c[m], s)); } } } @@ -1524,8 +1470,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6a(b[i], c[j], c[k], - c[l], c[m], c[n], s)); + alltrue = (alltrue && + __order6a(b[i], c[j], c[k], c[l], c[m], c[n], s)); } } } @@ -1548,8 +1494,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6b(b[i], c[j], c[k], - c[l], A[m], c[n], s)); + alltrue = (alltrue && + __order6b(b[i], c[j], c[k], c[l], A[m], c[n], s)); } } } @@ -1572,8 +1518,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6c(b[i], c[j], A[k], - c[l], A[m], c[n], s)); + alltrue = (alltrue && + __order6c(b[i], c[j], A[k], c[l], A[m], c[n], s)); } } } @@ -1596,8 +1542,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6d(b[i], c[j], c[k], - A[l], c[m], c[n], s)); + alltrue = (alltrue && + __order6d(b[i], c[j], c[k], A[l], c[m], c[n], s)); } } } @@ -1620,8 +1566,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6e(b[i], c[j], c[k], - A[l], A[m], c[n], s)); + alltrue = (alltrue && + __order6e(b[i], c[j], c[k], A[l], A[m], c[n], s)); } } } @@ -1644,8 +1590,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6f(b[i], A[j], A[k], - c[l], A[m], c[n], s)); + alltrue = (alltrue && + __order6f(b[i], A[j], A[k], c[l], A[m], c[n], s)); } } } @@ -1668,8 +1614,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6g(b[i], c[j], A[k], - c[l], c[m], c[n], s)); + alltrue = (alltrue && + __order6g(b[i], c[j], A[k], c[l], c[m], c[n], s)); } } } @@ -1692,8 +1638,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6h(b[i], c[j], A[k], - c[l], A[m], c[n], s)); + alltrue = (alltrue && + __order6h(b[i], c[j], A[k], c[l], A[m], c[n], s)); } } } @@ -1716,8 +1662,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6i(b[i], c[j], A[k], - A[l], c[m], c[n], s)); + alltrue = (alltrue && + __order6i(b[i], c[j], A[k], A[l], c[m], c[n], s)); } } } @@ -1740,8 +1686,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6j(b[i], c[j], A[k], - A[l], A[m], c[n], s)); + alltrue = (alltrue && + __order6j(b[i], c[j], A[k], A[l], A[m], c[n], s)); } } } @@ -1764,8 +1710,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6k(b[i], A[j], c[k], - c[l], c[m], c[n], s)); + alltrue = (alltrue && + __order6k(b[i], A[j], c[k], c[l], c[m], c[n], s)); } } } @@ -1788,8 +1734,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6l(b[i], A[j], c[k], - c[l], A[m], c[n], s)); + alltrue = (alltrue && + __order6l(b[i], A[j], c[k], c[l], A[m], c[n], s)); } } } @@ -1812,8 +1758,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6m(b[i], A[j], A[k], - c[l], A[m], c[n], s)); + alltrue = (alltrue && + __order6m(b[i], A[j], A[k], c[l], A[m], c[n], s)); } } } @@ -1836,8 +1782,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6n(b[i], A[j], c[k], - A[l], c[m], c[n], s)); + alltrue = (alltrue && + __order6n(b[i], A[j], c[k], A[l], c[m], c[n], s)); } } } @@ -1860,8 +1806,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6o(b[i], A[j], c[k], - A[l], A[m], c[n], s)); + alltrue = (alltrue && + __order6o(b[i], A[j], c[k], A[l], A[m], c[n], s)); } } } @@ -1884,8 +1830,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6p(b[i], A[j], A[k], - c[l], c[m], c[n], s)); + alltrue = (alltrue && + __order6p(b[i], A[j], A[k], c[l], c[m], c[n], s)); } } } @@ -1908,8 +1854,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6q(b[i], A[j], A[k], - c[l], A[m], c[n], s)); + alltrue = (alltrue && + __order6q(b[i], A[j], A[k], c[l], A[m], c[n], s)); } } } @@ -1932,8 +1878,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6r(b[i], A[j], A[k], - A[l], c[m], c[n], s)); + alltrue = (alltrue && + __order6r(b[i], A[j], A[k], A[l], c[m], c[n], s)); } } } @@ -1956,8 +1902,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && arkode_butcher_order6s(b[i], A[j], A[k], - A[l], A[m], c[n], s)); + alltrue = (alltrue && + __order6s(b[i], A[j], A[k], A[l], A[m], c[n], s)); } } } @@ -1977,11 +1923,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B if (outfile) { fprintf(outfile, "\n"); } /* row sum conditions */ - if (arkode_butcher_rowsum(A[0], c[0], s) && - arkode_butcher_rowsum(A[1], c[1], s)) - { - (*p) = 0; - } + if (__rowsum(A[0], c[0], s) && __rowsum(A[1], c[1], s)) { (*p) = 0; } else { (*p) = -1; @@ -1993,10 +1935,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B /* order 1 conditions */ if ((*p) == 0) { - if (arkode_butcher_order1(d[0], s) && arkode_butcher_order1(d[1], s)) - { - (*p) = 1; - } + if (__order1(d[0], s) && __order1(d[1], s)) { (*p) = 1; } else { if (outfile) @@ -2013,7 +1952,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (j = 0; j < 2; j++) { - alltrue = (alltrue && arkode_butcher_order2(d[i], c[j], s)); + alltrue = (alltrue && __order2(d[i], c[j], s)); } } if (alltrue) { (*p) = 2; } @@ -2035,7 +1974,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (k = 0; k < 2; k++) { - alltrue = (alltrue && arkode_butcher_order3a(d[i], c[j], c[k], s)); + alltrue = (alltrue && __order3a(d[i], c[j], c[k], s)); } } } @@ -2049,7 +1988,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (k = 0; k < 2; k++) { - alltrue = (alltrue && arkode_butcher_order3b(d[i], A[j], c[k], s)); + alltrue = (alltrue && __order3b(d[i], A[j], c[k], s)); } } } @@ -2071,8 +2010,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && - arkode_butcher_order4a(d[i], c[j], c[k], c[l], s)); + alltrue = (alltrue && __order4a(d[i], c[j], c[k], c[l], s)); } } } @@ -2089,8 +2027,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && - arkode_butcher_order4b(d[i], c[j], A[k], c[l], s)); + alltrue = (alltrue && __order4b(d[i], c[j], A[k], c[l], s)); } } } @@ -2107,8 +2044,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && - arkode_butcher_order4c(d[i], A[j], c[k], c[l], s)); + alltrue = (alltrue && __order4c(d[i], A[j], c[k], c[l], s)); } } } @@ -2125,8 +2061,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && - arkode_butcher_order4d(d[i], A[j], A[k], c[l], s)); + alltrue = (alltrue && __order4d(d[i], A[j], A[k], c[l], s)); } } } @@ -2151,8 +2086,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5a(d[i], c[j], c[k], - c[l], c[m], s)); + alltrue = (alltrue && __order5a(d[i], c[j], c[k], c[l], c[m], s)); } } } @@ -2172,8 +2106,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5b(d[i], c[j], c[k], - A[l], c[m], s)); + alltrue = (alltrue && __order5b(d[i], c[j], c[k], A[l], c[m], s)); } } } @@ -2193,8 +2126,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5c(d[i], A[j], c[k], - A[l], c[m], s)); + alltrue = (alltrue && __order5c(d[i], A[j], c[k], A[l], c[m], s)); } } } @@ -2214,8 +2146,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5d(d[i], c[j], A[k], - c[l], c[m], s)); + alltrue = (alltrue && __order5d(d[i], c[j], A[k], c[l], c[m], s)); } } } @@ -2235,8 +2166,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5e(d[i], A[j], c[k], - c[l], c[m], s)); + alltrue = (alltrue && __order5e(d[i], A[j], c[k], c[l], c[m], s)); } } } @@ -2256,8 +2186,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5f(d[i], c[j], A[k], - A[l], c[m], s)); + alltrue = (alltrue && __order5f(d[i], c[j], A[k], A[l], c[m], s)); } } } @@ -2277,8 +2206,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5g(d[i], A[j], c[k], - A[l], c[m], s)); + alltrue = (alltrue && __order5g(d[i], A[j], c[k], A[l], c[m], s)); } } } @@ -2298,8 +2226,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5h(d[i], A[j], A[k], - c[l], c[m], s)); + alltrue = (alltrue && __order5h(d[i], A[j], A[k], c[l], c[m], s)); } } } @@ -2319,8 +2246,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && arkode_butcher_order5i(d[i], A[j], A[k], - A[l], c[m], s)); + alltrue = (alltrue && __order5i(d[i], A[j], A[k], A[l], c[m], s)); } } } @@ -2349,8 +2275,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6a(d[i], c[j], c[k], c[l], - c[m], c[n], s)); + __order6a(d[i], c[j], c[k], c[l], c[m], c[n], s)); } } } @@ -2374,8 +2299,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6b(d[i], c[j], c[k], c[l], - A[m], c[n], s)); + __order6b(d[i], c[j], c[k], c[l], A[m], c[n], s)); } } } @@ -2399,8 +2323,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6c(d[i], c[j], A[k], c[l], - A[m], c[n], s)); + __order6c(d[i], c[j], A[k], c[l], A[m], c[n], s)); } } } @@ -2424,8 +2347,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6d(d[i], c[j], c[k], A[l], - c[m], c[n], s)); + __order6d(d[i], c[j], c[k], A[l], c[m], c[n], s)); } } } @@ -2449,8 +2371,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6e(d[i], c[j], c[k], A[l], - A[m], c[n], s)); + __order6e(d[i], c[j], c[k], A[l], A[m], c[n], s)); } } } @@ -2474,8 +2395,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6f(d[i], A[j], A[k], c[l], - A[m], c[n], s)); + __order6f(d[i], A[j], A[k], c[l], A[m], c[n], s)); } } } @@ -2499,8 +2419,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6g(d[i], c[j], A[k], c[l], - c[m], c[n], s)); + __order6g(d[i], c[j], A[k], c[l], c[m], c[n], s)); } } } @@ -2524,8 +2443,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6h(d[i], c[j], A[k], c[l], - A[m], c[n], s)); + __order6h(d[i], c[j], A[k], c[l], A[m], c[n], s)); } } } @@ -2549,8 +2467,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6i(d[i], c[j], A[k], A[l], - c[m], c[n], s)); + __order6i(d[i], c[j], A[k], A[l], c[m], c[n], s)); } } } @@ -2574,8 +2491,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6j(d[i], c[j], A[k], A[l], - A[m], c[n], s)); + __order6j(d[i], c[j], A[k], A[l], A[m], c[n], s)); } } } @@ -2599,8 +2515,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6k(d[i], A[j], c[k], c[l], - c[m], c[n], s)); + __order6k(d[i], A[j], c[k], c[l], c[m], c[n], s)); } } } @@ -2624,8 +2539,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6l(d[i], A[j], c[k], c[l], - A[m], c[n], s)); + __order6l(d[i], A[j], c[k], c[l], A[m], c[n], s)); } } } @@ -2649,8 +2563,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6m(d[i], A[j], A[k], c[l], - A[m], c[n], s)); + __order6m(d[i], A[j], A[k], c[l], A[m], c[n], s)); } } } @@ -2674,8 +2587,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6n(d[i], A[j], c[k], A[l], - c[m], c[n], s)); + __order6n(d[i], A[j], c[k], A[l], c[m], c[n], s)); } } } @@ -2699,8 +2611,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6o(d[i], A[j], c[k], A[l], - A[m], c[n], s)); + __order6o(d[i], A[j], c[k], A[l], A[m], c[n], s)); } } } @@ -2724,8 +2635,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6p(d[i], A[j], A[k], c[l], - c[m], c[n], s)); + __order6p(d[i], A[j], A[k], c[l], c[m], c[n], s)); } } } @@ -2749,8 +2659,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6q(d[i], A[j], A[k], c[l], - A[m], c[n], s)); + __order6q(d[i], A[j], A[k], c[l], A[m], c[n], s)); } } } @@ -2774,8 +2683,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6r(d[i], A[j], A[k], A[l], - c[m], c[n], s)); + __order6r(d[i], A[j], A[k], A[l], c[m], c[n], s)); } } } @@ -2799,8 +2707,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - arkode_butcher_order6s(d[i], A[j], A[k], A[l], - A[m], c[n], s)); + __order6s(d[i], A[j], A[k], A[l], A[m], c[n], s)); } } } @@ -2847,8 +2754,7 @@ 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 arkode_butcher_mv(sunrealtype** A, sunrealtype* x, int s, - sunrealtype* b) +static int __mv(sunrealtype** A, sunrealtype* x, int s, sunrealtype* b) { int i, j; if ((A == NULL) || (x == NULL) || (b == NULL) || (s < 1)) { return (1); } @@ -2866,7 +2772,7 @@ static int arkode_butcher_mv(sunrealtype** A, sunrealtype* x, int s, Here all vectors are (s x 1). Returns 0 on success, nonzero on failure. ---------------------------------------------------------------*/ -static int arkode_butcher_vv(sunrealtype* x, sunrealtype* y, int s, sunrealtype* z) +static int __vv(sunrealtype* x, sunrealtype* y, int s, sunrealtype* z) { int i; if ((x == NULL) || (y == NULL) || (z == NULL) || (s < 1)) { return (1); } @@ -2880,7 +2786,7 @@ static int arkode_butcher_vv(sunrealtype* x, sunrealtype* y, int s, sunrealtype* Here all vectors are (s x 1). Returns 0 on success, nonzero on failure. ---------------------------------------------------------------*/ -static int arkode_butcher_vp(sunrealtype* x, int l, int s, sunrealtype* z) +static int __vp(sunrealtype* x, int l, int s, sunrealtype* z) { int i; if ((x == NULL) || (z == NULL) || (s < 1) || (s < 0)) { return (1); } @@ -2894,8 +2800,7 @@ static int arkode_butcher_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 arkode_butcher_dot(sunrealtype* x, sunrealtype* y, int s, - sunrealtype* d) +static int __dot(sunrealtype* x, sunrealtype* y, int s, sunrealtype* d) { int i; if ((x == NULL) || (y == NULL) || (d == NULL) || (s < 1)) { return (1); } @@ -2907,17 +2812,17 @@ static int arkode_butcher_dot(sunrealtype* x, sunrealtype* y, int s, /*--------------------------------------------------------------- Utility routines to check specific order conditions. Each returns SUNTRUE on success, SUNFALSE on failure. - 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 + 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 ---------------------------------------------------------------*/ /* c(i) = sum(A(i,:)) */ -static sunbooleantype arkode_butcher_rowsum(sunrealtype** A, sunrealtype* c, int s) +static sunbooleantype __rowsum(sunrealtype** A, sunrealtype* c, int s) { int i, j; sunrealtype rsum; @@ -2931,7 +2836,7 @@ static sunbooleantype arkode_butcher_rowsum(sunrealtype** A, sunrealtype* c, int } /* b'*e = 1 */ -static sunbooleantype arkode_butcher_order1(sunrealtype* b, int s) +static sunbooleantype __order1(sunrealtype* b, int s) { int i; sunrealtype err = SUN_RCONST(1.0); @@ -2940,120 +2845,117 @@ static sunbooleantype arkode_butcher_order1(sunrealtype* b, int s) } /* b'*c = 1/2 */ -static sunbooleantype arkode_butcher_order2(sunrealtype* b, sunrealtype* c, int s) +static sunbooleantype __order2(sunrealtype* b, sunrealtype* c, int s) { sunrealtype bc; - if (arkode_butcher_dot(b, c, s, &bc)) { return (SUNFALSE); } + if (__dot(b, c, s, &bc)) { return (SUNFALSE); } return (SUNRabs(bc - SUN_RCONST(0.5)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*(c1.*c2) = 1/3 */ -static sunbooleantype arkode_butcher_order3a(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, int s) +static sunbooleantype __order3a(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, int s) { sunrealtype bcc; sunrealtype* tmp = calloc(s, sizeof(sunrealtype)); - if (arkode_butcher_vv(c1, c2, s, tmp)) + if (__vv(c1, c2, s, tmp)) { free(tmp); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp, s, &bcc)) { return (SUNFALSE); } + if (__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 arkode_butcher_order3b(sunrealtype* b, sunrealtype** A, - sunrealtype* c, int s) +static sunbooleantype __order3b(sunrealtype* b, sunrealtype** A, sunrealtype* c, + int s) { sunrealtype bAc; sunrealtype* tmp = calloc(s, sizeof(sunrealtype)); - if (arkode_butcher_mv(A, c, s, tmp)) + if (__mv(A, c, s, tmp)) { free(tmp); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp, s, &bAc)) { return (SUNFALSE); } + if (__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 arkode_butcher_order4a(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype* c3, - int s) +static sunbooleantype __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 (arkode_butcher_vv(c1, c2, s, tmp1)) + if (__vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c3, tmp1, s, tmp2)) + if (__vv(c3, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bccc)) { return (SUNFALSE); } + if (__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 arkode_butcher_order4b(sunrealtype* b, sunrealtype* c1, - sunrealtype** A, sunrealtype* c2, - int s) +static sunbooleantype __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 (arkode_butcher_vv(b, c1, s, tmp1)) + if (__vv(b, c1, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A, c2, s, tmp2)) + if (__mv(A, c2, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(tmp1, tmp2, s, &bcAc)) { return (SUNFALSE); } + if (__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 arkode_butcher_order4c(sunrealtype* b, sunrealtype** A, - sunrealtype* c1, sunrealtype* c2, - int s) +static sunbooleantype __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 (arkode_butcher_vv(c1, c2, s, tmp1)) + if (__vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A, tmp1, s, tmp2)) + if (__mv(A, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bAcc)) { return (SUNFALSE); } + if (__dot(b, tmp2, s, &bAcc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAcc - SUN_RCONST(1.0) / SUN_RCONST(12.0)) > TOL) ? SUNFALSE @@ -3061,26 +2963,25 @@ static sunbooleantype arkode_butcher_order4c(sunrealtype* b, sunrealtype** A, } /* b'*A1*A2*c = 1/24 */ -static sunbooleantype arkode_butcher_order4d(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c, - int s) +static sunbooleantype __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 (arkode_butcher_mv(A2, c, s, tmp1)) + if (__mv(A2, c, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp1, s, tmp2)) + if (__mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bAAc)) { return (SUNFALSE); } + if (__dot(b, tmp2, s, &bAAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAAc - SUN_RCONST(1.0) / SUN_RCONST(24.0)) > TOL) ? SUNFALSE @@ -3088,100 +2989,97 @@ static sunbooleantype arkode_butcher_order4d(sunrealtype* b, sunrealtype** A1, } /* b'*(c1.*c2.*c3.*c4) = 1/5 */ -static sunbooleantype arkode_butcher_order5a(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype* c3, - sunrealtype* c4, int s) +static sunbooleantype __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 (arkode_butcher_vv(c1, c2, s, tmp1)) + if (__vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c3, tmp1, s, tmp2)) + if (__vv(c3, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c4, tmp2, s, tmp1)) + if (__vv(c4, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp1, s, &bcccc)) { return (SUNFALSE); } + if (__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 arkode_butcher_order5b(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype** A, - sunrealtype* c3, int s) +static sunbooleantype __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 (arkode_butcher_vv(c1, c2, s, tmp1)) + if (__vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(b, tmp1, s, tmp2)) + if (__vv(b, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A, c3, s, tmp1)) + if (__mv(A, c3, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(tmp1, tmp2, s, &bccAc)) { return (SUNFALSE); } + if (__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 arkode_butcher_order5c(sunrealtype* b, sunrealtype** A1, - sunrealtype* c1, sunrealtype** A2, - sunrealtype* c2, int s) +static sunbooleantype __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 (arkode_butcher_mv(A1, c1, s, tmp1)) + if (__mv(A1, c1, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_mv(A2, c2, s, tmp2)) + if (__mv(A2, c2, s, tmp2)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_vv(tmp1, tmp2, s, tmp3)) + if (__vv(tmp1, tmp2, s, tmp3)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp3, s, &bAcAc)) { return (SUNFALSE); } + if (__dot(b, tmp3, s, &bAcAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); free(tmp3); @@ -3189,32 +3087,31 @@ static sunbooleantype arkode_butcher_order5c(sunrealtype* b, sunrealtype** A1, } /* (b.*c1)'*A*(c2.*c3) = 1/15 */ -static sunbooleantype arkode_butcher_order5d(sunrealtype* b, sunrealtype* c1, - sunrealtype** A, sunrealtype* c2, - sunrealtype* c3, int s) +static sunbooleantype __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 (arkode_butcher_vv(c2, c3, s, tmp1)) + if (__vv(c2, c3, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A, tmp1, s, tmp2)) + if (__mv(A, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(b, c1, s, tmp1)) + if (__vv(b, c1, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(tmp1, tmp2, s, &bcAcc)) { return (SUNFALSE); } + if (__dot(tmp1, tmp2, s, &bcAcc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcAcc - SUN_RCONST(1.0) / SUN_RCONST(15.0)) > TOL) ? SUNFALSE @@ -3222,64 +3119,62 @@ static sunbooleantype arkode_butcher_order5d(sunrealtype* b, sunrealtype* c1, } /* b'*A*(c1.*c2.*c3) = 1/20 */ -static sunbooleantype arkode_butcher_order5e(sunrealtype* b, sunrealtype** A, - sunrealtype* c1, sunrealtype* c2, - sunrealtype* c3, int s) +static sunbooleantype __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 (arkode_butcher_vv(c1, c2, s, tmp1)) + if (__vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c3, tmp1, s, tmp2)) + if (__vv(c3, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A, tmp2, s, tmp1)) + if (__mv(A, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp1, s, &bAccc)) { return (SUNFALSE); } + if (__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 arkode_butcher_order5f(sunrealtype* b, sunrealtype* c1, - sunrealtype** A1, sunrealtype** A2, - sunrealtype* c2, int s) +static sunbooleantype __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 (arkode_butcher_mv(A2, c2, s, tmp1)) + if (__mv(A2, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp1, s, tmp2)) + if (__mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(b, c1, s, tmp1)) + if (__vv(b, c1, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(tmp1, tmp2, s, &bcAAc)) { return (SUNFALSE); } + if (__dot(tmp1, tmp2, s, &bcAAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcAAc - SUN_RCONST(1.0) / SUN_RCONST(30.0)) > TOL) ? SUNFALSE @@ -3287,32 +3182,31 @@ static sunbooleantype arkode_butcher_order5f(sunrealtype* b, sunrealtype* c1, } /* b'*A1*(c1.*(A2*c2)) = 1/40 */ -static sunbooleantype arkode_butcher_order5g(sunrealtype* b, sunrealtype** A1, - sunrealtype* c1, sunrealtype** A2, - sunrealtype* c2, int s) +static sunbooleantype __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 (arkode_butcher_mv(A2, c2, s, tmp1)) + if (__mv(A2, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c1, tmp1, s, tmp2)) + if (__vv(c1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp2, s, tmp1)) + if (__mv(A1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp1, s, &bAcAc)) { return (SUNFALSE); } + if (__dot(b, tmp1, s, &bAcAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAcAc - SUN_RCONST(1.0) / SUN_RCONST(40.0)) > TOL) ? SUNFALSE @@ -3320,32 +3214,32 @@ static sunbooleantype arkode_butcher_order5g(sunrealtype* b, sunrealtype** A1, } /* b'*A1*A2*(c1.*c2) = 1/60 */ -static sunbooleantype arkode_butcher_order5h(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c1, - sunrealtype* c2, int s) +static sunbooleantype __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 (arkode_butcher_vv(c1, c2, s, tmp1)) + if (__vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A2, tmp1, s, tmp2)) + if (__mv(A2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp2, s, tmp1)) + if (__mv(A1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp1, s, &bAAcc)) { return (SUNFALSE); } + if (__dot(b, tmp1, s, &bAAcc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAAcc - SUN_RCONST(1.0) / SUN_RCONST(60.0)) > TOL) ? SUNFALSE @@ -3353,32 +3247,32 @@ static sunbooleantype arkode_butcher_order5h(sunrealtype* b, sunrealtype** A1, } /* b'*A1*A2*A3*c = 1/120 */ -static sunbooleantype arkode_butcher_order5i(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype** A3, - sunrealtype* c, int s) +static sunbooleantype __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 (arkode_butcher_mv(A3, c, s, tmp1)) + if (__mv(A3, c, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A2, tmp1, s, tmp2)) + if (__mv(A2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp2, s, tmp1)) + if (__mv(A1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp1, s, &bAAAc)) { return (SUNFALSE); } + if (__dot(b, tmp1, s, &bAAAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAAAc - SUN_RCONST(1.0) / SUN_RCONST(120.0)) > TOL) ? SUNFALSE @@ -3386,39 +3280,38 @@ static sunbooleantype arkode_butcher_order5i(sunrealtype* b, sunrealtype** A1, } /* b'*(c1.*c2.*c3.*c4.*c5) = 1/6 */ -static sunbooleantype arkode_butcher_order6a(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype* c3, - sunrealtype* c4, sunrealtype* c5, - int s) +static sunbooleantype __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 (arkode_butcher_vv(c1, c2, s, tmp1)) + if (__vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c3, tmp1, s, tmp2)) + if (__vv(c3, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c4, tmp2, s, tmp1)) + if (__vv(c4, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c5, tmp1, s, tmp2)) + if (__vv(c5, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bccccc)) { return (SUNFALSE); } + if (__dot(b, tmp2, s, &bccccc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bccccc - SUN_RCONST(1.0) / SUN_RCONST(6.0)) > TOL) ? SUNFALSE @@ -3426,39 +3319,38 @@ static sunbooleantype arkode_butcher_order6a(sunrealtype* b, sunrealtype* c1, } /* (b.*c1.*c2.*c3)'*(A*c4) = 1/12 */ -static sunbooleantype arkode_butcher_order6b(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype* c3, - sunrealtype** A, sunrealtype* c4, - int s) +static sunbooleantype __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 (arkode_butcher_vv(b, c1, s, tmp1)) + if (__vv(b, c1, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c2, tmp1, s, tmp2)) + if (__vv(c2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c3, tmp2, s, tmp1)) + if (__vv(c3, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A, c4, s, tmp2)) + if (__mv(A, c4, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(tmp1, tmp2, s, &bcccAc)) { return (SUNFALSE); } + if (__dot(tmp1, tmp2, s, &bcccAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcccAc - SUN_RCONST(1.0) / SUN_RCONST(12.0)) > TOL) ? SUNFALSE @@ -3466,44 +3358,43 @@ static sunbooleantype arkode_butcher_order6b(sunrealtype* b, sunrealtype* c1, } /* b'*(c1.*(A1*c2).*(A2*c3)) = 1/24 */ -static sunbooleantype arkode_butcher_order6c(sunrealtype* b, sunrealtype* c1, - sunrealtype** A1, sunrealtype* c2, - sunrealtype** A2, sunrealtype* c3, - int s) +static sunbooleantype __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 (arkode_butcher_mv(A2, c3, s, tmp1)) + if (__mv(A2, c3, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_mv(A1, c2, s, tmp2)) + if (__mv(A1, c2, s, tmp2)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_vv(tmp1, tmp2, s, tmp3)) + if (__vv(tmp1, tmp2, s, tmp3)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_vv(c1, tmp3, s, tmp1)) + if (__vv(c1, tmp3, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp1, s, &bcAc2)) { return (SUNFALSE); } + if (__dot(b, tmp1, s, &bcAc2)) { return (SUNFALSE); } free(tmp1); free(tmp2); free(tmp3); @@ -3512,44 +3403,43 @@ static sunbooleantype arkode_butcher_order6c(sunrealtype* b, sunrealtype* c1, } /* (b.*c1.*c2)'*A*(c3.*c4) = 1/18 */ -static sunbooleantype arkode_butcher_order6d(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype** A, - sunrealtype* c3, sunrealtype* c4, - int s) +static sunbooleantype __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 (arkode_butcher_vv(c3, c4, s, tmp1)) + if (__vv(c3, c4, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_mv(A, tmp1, s, tmp2)) + if (__mv(A, tmp1, s, tmp2)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_vv(c1, c2, s, tmp1)) + if (__vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_vv(b, tmp1, s, tmp3)) + if (__vv(b, tmp1, s, tmp3)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_dot(tmp2, tmp3, s, &bccAcc)) { return (SUNFALSE); } + if (__dot(tmp2, tmp3, s, &bccAcc)) { return (SUNFALSE); } free(tmp1); free(tmp2); free(tmp3); @@ -3558,44 +3448,43 @@ static sunbooleantype arkode_butcher_order6d(sunrealtype* b, sunrealtype* c1, } /* (b.*(c1.*c2))'*A1*A2*c3 = 1/36 */ -static sunbooleantype arkode_butcher_order6e(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c3, - int s) +static sunbooleantype __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 (arkode_butcher_vv(c1, c2, s, tmp1)) + if (__vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_vv(b, tmp1, s, tmp2)) + if (__vv(b, tmp1, s, tmp2)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_mv(A2, c3, s, tmp1)) + if (__mv(A2, c3, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp1, s, tmp3)) + if (__mv(A1, tmp1, s, tmp3)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_dot(tmp2, tmp3, s, &bccAAc)) { return (SUNFALSE); } + if (__dot(tmp2, tmp3, s, &bccAAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); free(tmp3); @@ -3604,44 +3493,43 @@ static sunbooleantype arkode_butcher_order6e(sunrealtype* b, sunrealtype* c1, } /* b'*((A1*A2*c1).*(A3*c2)) = 1/72 */ -static sunbooleantype arkode_butcher_order6f(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c1, - sunrealtype** A3, sunrealtype* c2, - int s) +static sunbooleantype __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 (arkode_butcher_mv(A2, c1, s, tmp1)) + if (__mv(A2, c1, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp1, s, tmp2)) + if (__mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_mv(A3, c2, s, tmp1)) + if (__mv(A3, c2, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_vv(tmp1, tmp2, s, tmp3)) + if (__vv(tmp1, tmp2, s, tmp3)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp3, s, &bAAcAc)) { return (SUNFALSE); } + if (__dot(b, tmp3, s, &bAAcAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); free(tmp3); @@ -3650,39 +3538,38 @@ static sunbooleantype arkode_butcher_order6f(sunrealtype* b, sunrealtype** A1, } /* b'*(c1.*(A*(c2.*c3.*c4))) = 1/24 */ -static sunbooleantype arkode_butcher_order6g(sunrealtype* b, sunrealtype* c1, - sunrealtype** A, sunrealtype* c2, - sunrealtype* c3, sunrealtype* c4, - int s) +static sunbooleantype __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 (arkode_butcher_vv(c2, c3, s, tmp1)) + if (__vv(c2, c3, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c4, tmp1, s, tmp2)) + if (__vv(c4, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A, tmp2, s, tmp1)) + if (__mv(A, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c1, tmp1, s, tmp2)) + if (__vv(c1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bcAccc)) { return (SUNFALSE); } + if (__dot(b, tmp2, s, &bcAccc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcAccc - SUN_RCONST(1.0) / SUN_RCONST(24.0)) > TOL) ? SUNFALSE @@ -3690,39 +3577,38 @@ static sunbooleantype arkode_butcher_order6g(sunrealtype* b, sunrealtype* c1, } /* b'*(c1.*(A1*(c2.*(A2*c3)))) = 1/48 */ -static sunbooleantype arkode_butcher_order6h(sunrealtype* b, sunrealtype* c1, - sunrealtype** A1, sunrealtype* c2, - sunrealtype** A2, sunrealtype* c3, - int s) +static sunbooleantype __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 (arkode_butcher_mv(A2, c3, s, tmp1)) + if (__mv(A2, c3, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c2, tmp1, s, tmp2)) + if (__vv(c2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp2, s, tmp1)) + if (__mv(A1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c1, tmp1, s, tmp2)) + if (__vv(c1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bcAcAc)) { return (SUNFALSE); } + if (__dot(b, tmp2, s, &bcAcAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcAcAc - SUN_RCONST(1.0) / SUN_RCONST(48.0)) > TOL) ? SUNFALSE @@ -3730,39 +3616,38 @@ static sunbooleantype arkode_butcher_order6h(sunrealtype* b, sunrealtype* c1, } /* b'*(c1.*(A1*A2*(c2.*c3))) = 1/72 */ -static sunbooleantype arkode_butcher_order6i(sunrealtype* b, sunrealtype* c1, - sunrealtype** A1, sunrealtype** A2, - sunrealtype* c2, sunrealtype* c3, - int s) +static sunbooleantype __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 (arkode_butcher_vv(c2, c3, s, tmp1)) + if (__vv(c2, c3, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A2, tmp1, s, tmp2)) + if (__mv(A2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp2, s, tmp1)) + if (__mv(A1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c1, tmp1, s, tmp2)) + if (__vv(c1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bcAAcc)) { return (SUNFALSE); } + if (__dot(b, tmp2, s, &bcAAcc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcAAcc - SUN_RCONST(1.0) / SUN_RCONST(72.0)) > TOL) ? SUNFALSE @@ -3770,39 +3655,38 @@ static sunbooleantype arkode_butcher_order6i(sunrealtype* b, sunrealtype* c1, } /* b'*(c1.*(A1*A2*A3*c2)) = 1/144 */ -static sunbooleantype arkode_butcher_order6j(sunrealtype* b, sunrealtype* c1, - sunrealtype** A1, sunrealtype** A2, - sunrealtype** A3, sunrealtype* c2, - int s) +static sunbooleantype __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 (arkode_butcher_mv(A3, c2, s, tmp1)) + if (__mv(A3, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A2, tmp1, s, tmp2)) + if (__mv(A2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp2, s, tmp1)) + if (__mv(A1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c1, tmp1, s, tmp2)) + if (__vv(c1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bcAAAc)) { return (SUNFALSE); } + if (__dot(b, tmp2, s, &bcAAAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcAAAc - SUN_RCONST(1.0) / SUN_RCONST(144.0)) > TOL) ? SUNFALSE @@ -3810,39 +3694,38 @@ static sunbooleantype arkode_butcher_order6j(sunrealtype* b, sunrealtype* c1, } /* b'*A*(c1.*c2.*c3.*c4) = 1/30 */ -static sunbooleantype arkode_butcher_order6k(sunrealtype* b, sunrealtype** A, - sunrealtype* c1, sunrealtype* c2, - sunrealtype* c3, sunrealtype* c4, - int s) +static sunbooleantype __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 (arkode_butcher_vv(c1, c2, s, tmp1)) + if (__vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c3, tmp1, s, tmp2)) + if (__vv(c3, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c4, tmp2, s, tmp1)) + if (__vv(c4, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A, tmp1, s, tmp2)) + if (__mv(A, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bAcccc)) { return (SUNFALSE); } + if (__dot(b, tmp2, s, &bAcccc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAcccc - SUN_RCONST(1.0) / SUN_RCONST(30.0)) > TOL) ? SUNFALSE @@ -3850,39 +3733,38 @@ static sunbooleantype arkode_butcher_order6k(sunrealtype* b, sunrealtype** A, } /* b'*A1*(c1.*c2.*(A2*c3)) = 1/60 */ -static sunbooleantype arkode_butcher_order6l(sunrealtype* b, sunrealtype** A1, - sunrealtype* c1, sunrealtype* c2, - sunrealtype** A2, sunrealtype* c3, - int s) +static sunbooleantype __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 (arkode_butcher_mv(A2, c3, s, tmp1)) + if (__mv(A2, c3, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c2, tmp1, s, tmp2)) + if (__vv(c2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c1, tmp2, s, tmp1)) + if (__vv(c1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp1, s, tmp2)) + if (__mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bAccAc)) { return (SUNFALSE); } + if (__dot(b, tmp2, s, &bAccAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAccAc - SUN_RCONST(1.0) / SUN_RCONST(60.0)) > TOL) ? SUNFALSE @@ -3890,43 +3772,42 @@ static sunbooleantype arkode_butcher_order6l(sunrealtype* b, sunrealtype** A1, } /* b'*A1*((A2*c1).*(A3*c2)) = 1/120 */ -static sunbooleantype arkode_butcher_order6m(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c1, - sunrealtype** A3, sunrealtype* c2, - int s) +static sunbooleantype __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 (arkode_butcher_mv(A3, c2, s, tmp1)) + if (__mv(A3, c2, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_mv(A2, c1, s, tmp2)) + if (__mv(A2, c1, s, tmp2)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_vv(tmp1, tmp2, s, tmp3)) + if (__vv(tmp1, tmp2, s, tmp3)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp3, s, tmp1)) + if (__mv(A1, tmp3, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp1, s, &bAAcAc)) { return (SUNFALSE); } + if (__dot(b, tmp1, s, &bAAcAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); free(tmp3); @@ -3935,39 +3816,38 @@ static sunbooleantype arkode_butcher_order6m(sunrealtype* b, sunrealtype** A1, } /* b'*A1*(c1.*(A2*(c2.*c3))) = 1/90 */ -static sunbooleantype arkode_butcher_order6n(sunrealtype* b, sunrealtype** A1, - sunrealtype* c1, sunrealtype** A2, - sunrealtype* c2, sunrealtype* c3, - int s) +static sunbooleantype __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 (arkode_butcher_vv(c2, c3, s, tmp1)) + if (__vv(c2, c3, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A2, tmp1, s, tmp2)) + if (__mv(A2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c1, tmp2, s, tmp1)) + if (__vv(c1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp1, s, tmp2)) + if (__mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bAcAcc)) { return (SUNFALSE); } + if (__dot(b, tmp2, s, &bAcAcc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAcAcc - SUN_RCONST(1.0) / SUN_RCONST(90.0)) > TOL) ? SUNFALSE @@ -3975,39 +3855,38 @@ static sunbooleantype arkode_butcher_order6n(sunrealtype* b, sunrealtype** A1, } /* b'*A1*(c1.*(A2*A3*c2)) = 1/180 */ -static sunbooleantype arkode_butcher_order6o(sunrealtype* b, sunrealtype** A1, - sunrealtype* c1, sunrealtype** A2, - sunrealtype** A3, sunrealtype* c2, - int s) +static sunbooleantype __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 (arkode_butcher_mv(A3, c2, s, tmp1)) + if (__mv(A3, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A2, tmp1, s, tmp2)) + if (__mv(A2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c1, tmp2, s, tmp1)) + if (__vv(c1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp1, s, tmp2)) + if (__mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bAcAAc)) { return (SUNFALSE); } + if (__dot(b, tmp2, s, &bAcAAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAcAAc - SUN_RCONST(1.0) / SUN_RCONST(180.0)) > TOL) ? SUNFALSE @@ -4015,39 +3894,38 @@ static sunbooleantype arkode_butcher_order6o(sunrealtype* b, sunrealtype** A1, } /* b'*A1*A2*(c1.*c2.*c3) = 1/120 */ -static sunbooleantype arkode_butcher_order6p(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c1, - sunrealtype* c2, sunrealtype* c3, - int s) +static sunbooleantype __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 (arkode_butcher_vv(c1, c2, s, tmp1)) + if (__vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c3, tmp1, s, tmp2)) + if (__vv(c3, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A2, tmp2, s, tmp1)) + if (__mv(A2, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp1, s, tmp2)) + if (__mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bAAccc)) { return (SUNFALSE); } + if (__dot(b, tmp2, s, &bAAccc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAAccc - SUN_RCONST(1.0) / SUN_RCONST(120.0)) > TOL) ? SUNFALSE @@ -4055,39 +3933,38 @@ static sunbooleantype arkode_butcher_order6p(sunrealtype* b, sunrealtype** A1, } /* b'*A1*A2*(c1.*(A3*c2)) = 1/240 */ -static sunbooleantype arkode_butcher_order6q(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c1, - sunrealtype** A3, sunrealtype* c2, - int s) +static sunbooleantype __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 (arkode_butcher_mv(A3, c2, s, tmp1)) + if (__mv(A3, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_vv(c1, tmp1, s, tmp2)) + if (__vv(c1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A2, tmp2, s, tmp1)) + if (__mv(A2, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp1, s, tmp2)) + if (__mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bAAcAc)) { return (SUNFALSE); } + if (__dot(b, tmp2, s, &bAAcAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAAcAc - SUN_RCONST(1.0) / SUN_RCONST(240.0)) > TOL) ? SUNFALSE @@ -4095,39 +3972,38 @@ static sunbooleantype arkode_butcher_order6q(sunrealtype* b, sunrealtype** A1, } /* b'*A1*A2*A3*(c1.*c2) = 1/360 */ -static sunbooleantype arkode_butcher_order6r(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype** A3, - sunrealtype* c1, sunrealtype* c2, - int s) +static sunbooleantype __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 (arkode_butcher_vv(c1, c2, s, tmp1)) + if (__vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A3, tmp1, s, tmp2)) + if (__mv(A3, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A2, tmp2, s, tmp1)) + if (__mv(A2, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp1, s, tmp2)) + if (__mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bAAAcc)) { return (SUNFALSE); } + if (__dot(b, tmp2, s, &bAAAcc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAAAcc - SUN_RCONST(1.0) / SUN_RCONST(360.0)) > TOL) ? SUNFALSE @@ -4135,39 +4011,38 @@ static sunbooleantype arkode_butcher_order6r(sunrealtype* b, sunrealtype** A1, } /* b'*A1*A2*A3*A4*c = 1/720 */ -static sunbooleantype arkode_butcher_order6s(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype** A3, - sunrealtype** A4, sunrealtype* c, - int s) +static sunbooleantype __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 (arkode_butcher_mv(A4, c, s, tmp1)) + if (__mv(A4, c, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A3, tmp1, s, tmp2)) + if (__mv(A2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A2, tmp2, s, tmp1)) + if (__mv(A2, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A1, tmp1, s, tmp2)) + if (__mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (arkode_butcher_dot(b, tmp2, s, &bAAAAc)) { return (SUNFALSE); } + if (__dot(b, tmp2, s, &bAAAAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAAAAc - SUN_RCONST(1.0) / SUN_RCONST(720.0)) > TOL) ? SUNFALSE @@ -4190,12 +4065,12 @@ static int __ButcherSimplifyingAssumptions(sunrealtype** A, sunrealtype* b, P = 0; for (i = 1; i < 1000; i++) { - if (arkode_butcher_vp(c, i - 1, s, tmp)) + if (__vp(c, i - 1, s, tmp)) { free(tmp); return (0); } - if (arkode_butcher_dot(b, tmp, s, &LHS)) + if (__dot(b, tmp, s, &LHS)) { free(tmp); return (0); @@ -4212,12 +4087,12 @@ static int __ButcherSimplifyingAssumptions(sunrealtype** A, sunrealtype* b, alltrue = SUNTRUE; for (i = 0; i < s; i++) { - if (arkode_butcher_vp(c, k - 1, s, tmp)) + if (__vp(c, k - 1, s, tmp)) { free(tmp); return (0); } - if (arkode_butcher_dot(A[i], tmp, s, &LHS)) + if (__dot(A[i], tmp, s, &LHS)) { free(tmp); return (0); diff --git a/src/arkode/arkode_butcher_dirk.c b/src/arkode/arkode_butcher_dirk.c index ee3001a2c8..54026e7ae2 100644 --- a/src/arkode/arkode_butcher_dirk.c +++ b/src/arkode/arkode_butcher_dirk.c @@ -54,28 +54,6 @@ 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_dirk.def b/src/arkode/arkode_butcher_dirk.def index 40d13e60bd..2ce5444f8c 100644 --- a/src/arkode/arkode_butcher_dirk.def +++ b/src/arkode/arkode_butcher_dirk.def @@ -34,11 +34,7 @@ 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 @@ -61,6 +57,7 @@ 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 ----------------------------------------------------------------- */ @@ -68,19 +65,6 @@ 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; @@ -135,34 +119,6 @@ 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.c b/src/arkode/arkode_butcher_erk.c index 10cebbfdf4..e15aa6b8b0 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: emethod -- integer key for the desired method + Input: emthod -- integer key for the desired method ---------------------------------------------------------------*/ ARKodeButcherTable ARKodeButcherTable_LoadERK(ARKODE_ERKTableID emethod) { @@ -54,28 +54,6 @@ 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/src/arkode/arkode_butcher_erk.def b/src/arkode/arkode_butcher_erk.def index a29292e27d..5fe439bbab 100644 --- a/src/arkode/arkode_butcher_erk.def +++ b/src/arkode/arkode_butcher_erk.def @@ -36,50 +36,38 @@ are known precisely enough for use in quad precision (128-bit) calculations. - 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 - --------------------------------------- + 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 + -------------------------------------- */ 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; @@ -96,37 +84,6 @@ 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 5cc09d2390..8fec869acf 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -27,7 +27,7 @@ #include "arkode_interp_impl.h" /*=============================================================== - Exported functions + ERKStep Exported functions -- Required ===============================================================*/ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) @@ -85,35 +85,24 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, MSG_ARK_ARKMEM_FAIL); - ARKodeFree((void**)&ark_mem); + ERKStepFree((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_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); + 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); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Error setting default solver options"); - ARKodeFree((void**)&ark_mem); + ERKStepFree((void**)&ark_mem); return (NULL); } @@ -137,13 +126,64 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Unable to initialize main ARKODE infrastructure"); - ARKodeFree((void**)&ark_mem); + ERKStepFree((void**)&ark_mem); return (NULL); } return ((void*)ark_mem); } +/*--------------------------------------------------------------- + ERKStepResize: + + 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) +{ + 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); + if (retval != ARK_SUCCESS) { return (retval); } + + /* Determing 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 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++) + { + 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: @@ -162,7 +202,7 @@ int ERKStepReInit(void* arkode_mem, ARKRhsFn f, sunrealtype t0, N_Vector y0) int retval; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Check if ark_mem was allocated */ @@ -207,64 +247,151 @@ int ERKStepReInit(void* arkode_mem, ARKRhsFn f, sunrealtype t0, N_Vector y0) return (ARK_SUCCESS); } -/*=============================================================== - Interface routines supplied to ARKODE - ===============================================================*/ - /*--------------------------------------------------------------- - erkStep_Resize: + ERKStepReset: - This routine resizes the memory within the ERKStep module. + 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 erkStep_Resize(ARKodeMem ark_mem, N_Vector y0, - SUNDIALS_MAYBE_UNUSED sunrealtype hscale, - SUNDIALS_MAYBE_UNUSED sunrealtype t0, ARKVecResizeFn resize, - void* resize_data) +int ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) { + ARKodeMem ark_mem; ARKodeERKStepMem step_mem; - sunindextype lrw1, liw1, lrw_diff, liw_diff; - int i, retval; + int retval; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &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; + /* Initialize main ARKODE infrastructure */ + retval = arkInit(ark_mem, tR, yR, RESET_INIT); - /* Resize the RHS vectors */ - for (i = 0; i < step_mem->stages; i++) + if (retval != ARK_SUCCESS) { - 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); - } + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Unable to initialize main ARKODE infrastructure"); + return (retval); } return (ARK_SUCCESS); } /*--------------------------------------------------------------- - erkStep_Free frees all ERKStep memory. + 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. ---------------------------------------------------------------*/ -void erkStep_Free(ARKodeMem ark_mem) +void ERKStepFree(void** arkode_mem) { int j; sunindextype Bliw, Blrw; + ARKodeMem ark_mem; ARKodeERKStepMem step_mem; - /* nothing to do if ark_mem is already NULL */ - if (ark_mem == NULL) { return; } + /* nothing to do if arkode_mem is already NULL */ + if (*arkode_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; @@ -309,16 +436,21 @@ void erkStep_Free(ARKodeMem ark_mem) free(ark_mem->step_mem); ark_mem->step_mem = NULL; } + + /* free memory for overall ARKODE infrastructure */ + arkFree(arkode_mem); } /*--------------------------------------------------------------- - erkStep_PrintMem: + ERKStepPrintMem: - This routine outputs the memory from the ERKStep structure to - a specified file pointer (useful when debugging). + This routine outputs the memory from the ERKStep structure and + the main ARKODE infrastructure to a specified file pointer + (useful when debugging). ---------------------------------------------------------------*/ -void erkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) +void ERKStepPrintMem(void* arkode_mem, FILE* outfile) { + ARKodeMem ark_mem; ARKodeERKStepMem step_mem; int retval; @@ -327,9 +459,12 @@ void erkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) #endif /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &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); @@ -352,6 +487,14 @@ void erkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) #endif } +/*=============================================================== + ERKStep Private functions + ===============================================================*/ + +/*--------------------------------------------------------------- + Interface routines supplied to ARKODE + ---------------------------------------------------------------*/ + /*--------------------------------------------------------------- erkStep_Init: @@ -367,13 +510,14 @@ 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(void* arkode_mem, int init_type) { + ARKodeMem ark_mem; ARKodeERKStepMem step_mem; int retval, j; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* immediately return if resize or reset */ @@ -451,17 +595,28 @@ int erkStep_Init(ARKodeMem ark_mem, int init_type) ark_mem->liw += (step_mem->stages + 1); /* pointers */ } - /* Override the interpolant degree (if needed), used in arkInitialSetup */ - if (step_mem->q > 1 && ark_mem->interp_degree > (step_mem->q - 1)) - { - /* 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) + /* Limit max interpolant degree (negative input only overwrites the current + interpolant degree if it is greater than abs(input). */ + if (ark_mem->interp != NULL) { - /* 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 (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); + } } /* Signal to shared arkode module that full RHS evaluations are required */ @@ -499,15 +654,16 @@ int erkStep_Init(ARKodeMem ark_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(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, +int erkStep_FullRHS(void* arkode_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(ark_mem, __func__, &step_mem); + retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* perform RHS functions contingent on 'mode' argument */ @@ -608,18 +764,19 @@ int erkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, reduce step and retry (if possible) <0 => step encountered unrecoverable failure ---------------------------------------------------------------*/ -int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) +int erkStep_TakeStep(void* arkode_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(ark_mem, __func__, &step_mem); + retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* local shortcuts for fused vector operations */ @@ -635,10 +792,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 +861,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 +873,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 @@ -729,18 +886,18 @@ int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) return (ARK_SUCCESS); } -/*=============================================================== +/*--------------------------------------------------------------- Internal utility routines - ===============================================================*/ + ---------------------------------------------------------------*/ /*--------------------------------------------------------------- - erkStep_AccessARKODEStepMem: + erkStep_AccessStepMem: - Shortcut routine to unpack both ark_mem and step_mem structures - from void* pointer. If either is missing it returns ARK_MEM_NULL. + Shortcut routine to unpack ark_mem and step_mem structures from + void* pointer. If either is missing it returns ARK_MEM_NULL. ---------------------------------------------------------------*/ -int erkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, - ARKodeMem* ark_mem, ARKodeERKStepMem* step_mem) +int erkStep_AccessStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeERKStepMem* step_mem) { /* access ARKodeMem structure */ if (arkode_mem == NULL) @@ -750,8 +907,6 @@ int erkStep_AccessARKODEStepMem(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__, @@ -762,26 +917,6 @@ int erkStep_AccessARKODEStepMem(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: @@ -829,7 +964,6 @@ 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; @@ -1049,16 +1183,13 @@ 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) { @@ -1138,6 +1269,7 @@ 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_impl.h b/src/arkode/arkode_erkstep_impl.h index 794f112550..ef84f748ef 100644 --- a/src/arkode/arkode_erkstep_impl.h +++ b/src/arkode/arkode_erkstep_impl.h @@ -68,34 +68,20 @@ typedef struct ARKodeERKStepMemRec ===============================================================*/ /* Interface routines supplied to ARKODE */ -int erkStep_Init(ARKodeMem ark_mem, int init_type); -int erkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, +int erkStep_Init(void* arkode_mem, int init_type); +int erkStep_FullRHS(void* arkode_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); -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); +int erkStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr); /* Internal utility routines */ -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); +int erkStep_AccessStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, 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 ffbf9a18fb..15904203a0 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -27,245 +27,404 @@ #include "arkode_erkstep_impl.h" /*=============================================================== - Exported optional input functions. + ERKStep Optional input functions (wrappers for generic ARKODE + utility routines). All are documented in arkode_io.c. ===============================================================*/ +int ERKStepSetDenseOrder(void* arkode_mem, int dord) +{ + return (ERKStepSetInterpolantDegree(arkode_mem, dord)); +} -/*--------------------------------------------------------------- - ERKStepSetTable: +int ERKStepSetInterpolantDegree(void* arkode_mem, int degree) +{ + if (degree < 0) { degree = ARK_INTERP_MAX_DEGREE; } + return (arkSetInterpolantDegree(arkode_mem, degree)); +} - Specifies to use a customized Butcher table for the explicit - portion of the system. +int ERKStepSetInterpolantType(void* arkode_mem, int itype) +{ + return (arkSetInterpolantType(arkode_mem, itype)); +} - 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 ERKStepSetUserData(void* arkode_mem, void* user_data) { - ARKodeMem ark_mem; - ARKodeERKStepMem step_mem; - sunindextype Blrw, Bliw; - int retval; + return (arkSetUserData(arkode_mem, user_data)); +} - /* access ARKodeMem and ARKodeERKStepMem structures */ - retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ERKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) +{ + return (arkSetMaxNumSteps(arkode_mem, mxsteps)); +} - /* check for legal inputs */ - if (B == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } +int ERKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) +{ + return (arkSetMaxHnilWarns(arkode_mem, mxhnil)); +} - /* clear any existing parameters and Butcher tables */ - step_mem->stages = 0; - step_mem->q = 0; - step_mem->p = 0; +int ERKStepSetInitStep(void* arkode_mem, sunrealtype hin) +{ + return (arkSetInitStep(arkode_mem, hin)); +} - 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 ERKStepSetMinStep(void* arkode_mem, sunrealtype hmin) +{ + return (arkSetMinStep(arkode_mem, hmin)); +} - /* set the relevant parameters */ - step_mem->stages = B->stages; - step_mem->q = B->q; - step_mem->p = B->p; +int ERKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) +{ + return (arkSetMaxStep(arkode_mem, hmax)); +} - /* 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 ERKStepSetStopTime(void* arkode_mem, sunrealtype tstop) +{ + return (arkSetStopTime(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 (arkSetInterpolateStopTime(arkode_mem, interp)); +} - return (ARK_SUCCESS); +int ERKStepClearStopTime(void* arkode_mem) +{ + return (arkClearStopTime(arkode_mem)); } -/*--------------------------------------------------------------- - ERKStepSetTableNum: +int ERKStepSetRootDirection(void* arkode_mem, int* rootdir) +{ + return (arkSetRootDirection(arkode_mem, rootdir)); +} - 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; + return (arkSetNoInactiveRootWarn(arkode_mem)); +} - /* access ARKodeMem and ARKodeERKStepMem structures */ - retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ERKStepSetConstraints(void* arkode_mem, N_Vector constraints) +{ + return (arkSetConstraints(arkode_mem, constraints)); +} - /* 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 ERKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) +{ + return (arkSetMaxNumConstrFails(arkode_mem, maxfails)); +} - /* clear any existing parameters and Butcher tables */ - step_mem->stages = 0; - step_mem->q = 0; - step_mem->p = 0; +int ERKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) +{ + return (arkSetPostprocessStepFn(arkode_mem, ProcessStep)); +} - 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 ERKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) +{ + return (arkSetPostprocessStageFn(arkode_mem, ProcessStage)); +} - /* 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 ERKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust) +{ + return (arkSetAdaptivityAdjustment(arkode_mem, adjust)); +} - ARKodeButcherTable_Space(step_mem->B, &Bliw, &Blrw); - ark_mem->liw += Bliw; - ark_mem->lrw += Blrw; +int ERKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) +{ + return (arkSetCFLFraction(arkode_mem, cfl_frac)); +} - return (ARK_SUCCESS); +int ERKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) +{ + return (arkSetSafetyFactor(arkode_mem, safety)); } -/*--------------------------------------------------------------- - ERKStepSetTableName: +int ERKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) +{ + return (arkSetMaxGrowth(arkode_mem, mx_growth)); +} - 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 ERKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) { - return ERKStepSetTableNum(arkode_mem, arkButcherTableERKNameToID(etable)); + return (arkSetMinReduction(arkode_mem, eta_min)); +} + +int ERKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) +{ + return (arkSetFixedStepBounds(arkode_mem, lb, ub)); +} + +int ERKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) +{ + return (arkSetMaxFirstGrowth(arkode_mem, etamx1)); +} + +int ERKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) +{ + return (arkSetMaxEFailGrowth(arkode_mem, etamxf)); +} + +int ERKStepSetSmallNumEFails(void* arkode_mem, int small_nef) +{ + return (arkSetSmallNumEFails(arkode_mem, small_nef)); +} + +int ERKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) +{ + return (arkSetStabilityFn(arkode_mem, EStab, estab_data)); +} + +int ERKStepSetMaxErrTestFails(void* arkode_mem, int maxnef) +{ + return (arkSetMaxErrTestFails(arkode_mem, maxnef)); +} + +int ERKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) +{ + return (arkSetFixedStep(arkode_mem, hfixed)); +} + +int ERKStepSetAdaptController(void* arkode_mem, SUNAdaptController C) +{ + return (arkSetAdaptController(arkode_mem, C)); } /*=============================================================== - Exported optional output functions. + ERKStep Optional output functions (wrappers for generic ARKODE + utility routines). All are documented in arkode_io.c. ===============================================================*/ -/*--------------------------------------------------------------- - ERKStepGetNumRhsEvals: +int ERKStepGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) +{ + return (arkGetNumStepAttempts(arkode_mem, nstep_attempts)); +} - Returns the current number of calls to f - ---------------------------------------------------------------*/ -int ERKStepGetNumRhsEvals(void* arkode_mem, long int* fevals) +int ERKStepGetNumSteps(void* arkode_mem, long int* nsteps) { - ARKodeMem ark_mem; - ARKodeERKStepMem step_mem; - int retval; + return (arkGetNumSteps(arkode_mem, nsteps)); +} - /* access ARKodeMem and ARKodeERKStepMem structures */ - retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ERKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) +{ + return (arkGetActualInitStep(arkode_mem, hinused)); +} - /* get values from step_mem */ - *fevals = step_mem->nfe; +int ERKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) +{ + return (arkGetLastStep(arkode_mem, hlast)); +} - return (ARK_SUCCESS); +int ERKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) +{ + return (arkGetCurrentStep(arkode_mem, hcur)); } -/*--------------------------------------------------------------- - ERKStepGetCurrentButcherTable: +int ERKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) +{ + return (arkGetCurrentTime(arkode_mem, tcur)); +} - Sets pointers to the Butcher table currently in use. - ---------------------------------------------------------------*/ -int ERKStepGetCurrentButcherTable(void* arkode_mem, ARKodeButcherTable* B) +int ERKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) { - ARKodeMem ark_mem; - ARKodeERKStepMem step_mem; - int retval; + return (arkGetTolScaleFactor(arkode_mem, tolsfact)); +} - /* access ARKodeMem and ARKodeERKStepMem structures */ - retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ERKStepGetErrWeights(void* arkode_mem, N_Vector eweight) +{ + return (arkGetErrWeights(arkode_mem, eweight)); +} - /* get tables from step_mem */ - *B = step_mem->B; - return (ARK_SUCCESS); +int ERKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +{ + return (arkGetWorkSpace(arkode_mem, lenrw, leniw)); } -/*--------------------------------------------------------------- - ERKStepGetTimestepperStats: +int ERKStepGetNumGEvals(void* arkode_mem, long int* ngevals) +{ + return (arkGetNumGEvals(arkode_mem, ngevals)); +} - Returns integrator statistics - ---------------------------------------------------------------*/ -int ERKStepGetTimestepperStats(void* arkode_mem, long int* expsteps, - long int* accsteps, long int* attempts, - long int* fevals, long int* netfails) +int ERKStepGetRootInfo(void* arkode_mem, int* rootsfound) { - ARKodeMem ark_mem; - ARKodeERKStepMem step_mem; - int retval; + return (arkGetRootInfo(arkode_mem, rootsfound)); +} - /* access ARKodeMem and ARKodeERKStepMem structures */ - retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +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)); +} - /* set expsteps and accsteps from adaptivity structure */ - *expsteps = ark_mem->hadapt_mem->nst_exp; - *accsteps = ark_mem->hadapt_mem->nst_acc; +int ERKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) +{ + return (arkGetNumConstrFails(arkode_mem, nconstrfails)); +} - /* set remaining outputs */ - *attempts = ark_mem->nst_attempts; - *fevals = step_mem->nfe; - *netfails = ark_mem->netf; +int ERKStepGetNumExpSteps(void* arkode_mem, long int* nsteps) +{ + return (arkGetNumExpSteps(arkode_mem, nsteps)); +} - return (ARK_SUCCESS); +int ERKStepGetNumAccSteps(void* arkode_mem, long int* nsteps) +{ + return (arkGetNumAccSteps(arkode_mem, nsteps)); +} + +int ERKStepGetNumErrTestFails(void* arkode_mem, long int* netfails) +{ + return (arkGetNumErrTestFails(arkode_mem, netfails)); +} + +int ERKStepGetUserData(void* arkode_mem, void** user_data) +{ + return (arkGetUserData(arkode_mem, user_data)); +} + +char* ERKStepGetReturnFlagName(long int flag) +{ + return (arkGetReturnFlagName(flag)); +} + +/* ----------------------------------------------------------------------------- + * Wrappers for the ARKODE relaxation module + * ---------------------------------------------------------------------------*/ + +int ERKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) +{ + return arkRelaxCreate(arkode_mem, rfn, rjac, erkStep_RelaxDeltaE, + erkStep_GetOrder); +} + +int ERKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf) +{ + return arkRelaxSetEtaFail(arkode_mem, eta_rf); +} + +int ERKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) +{ + return arkRelaxSetLowerBound(arkode_mem, lower); +} + +int ERKStepSetRelaxMaxFails(void* arkode_mem, int max_fails) +{ + return arkRelaxSetMaxFails(arkode_mem, max_fails); +} + +int ERKStepSetRelaxMaxIters(void* arkode_mem, int max_iters) +{ + return arkRelaxSetMaxIters(arkode_mem, max_iters); +} + +int ERKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver) +{ + return arkRelaxSetSolver(arkode_mem, solver); +} + +int ERKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol) +{ + return arkRelaxSetResTol(arkode_mem, res_tol); +} + +int ERKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) +{ + return arkRelaxSetTol(arkode_mem, rel_tol, abs_tol); +} + +int ERKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) +{ + return arkRelaxSetUpperBound(arkode_mem, upper); +} + +int ERKStepGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals) +{ + return arkRelaxGetNumRelaxFnEvals(arkode_mem, r_evals); +} + +int ERKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) +{ + return arkRelaxGetNumRelaxJacEvals(arkode_mem, J_evals); +} + +int ERKStepGetNumRelaxFails(void* arkode_mem, long int* relax_fails) +{ + return arkRelaxGetNumRelaxFails(arkode_mem, relax_fails); +} + +int ERKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails) +{ + return arkRelaxGetNumRelaxBoundFails(arkode_mem, fails); +} + +int ERKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails) +{ + return arkRelaxGetNumRelaxSolveFails(arkode_mem, fails); +} + +int ERKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) +{ + return arkRelaxGetNumRelaxSolveIters(arkode_mem, iters); } /*=============================================================== - Private functions attached to ARKODE + DEPRECATED ERKStep optional input/output functions ===============================================================*/ /*--------------------------------------------------------------- - erkStep_SetRelaxFn: + ERKStepSetAdaptivityMethod: user should create/attach a + specific SUNAdaptController object. + ---------------------------------------------------------------*/ +int ERKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, + int pq, sunrealtype adapt_params[3]) +{ + return (arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); +} + +/*--------------------------------------------------------------- + ERKStepSetAdaptivityFn: user should create/attach a custom + SUNAdaptController object. + ---------------------------------------------------------------*/ +int ERKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) +{ + return (arkSetAdaptivityFn(arkode_mem, hfun, h_data)); +} - Sets up the relaxation module using ERKStep's utility routines. +/*--------------------------------------------------------------- + ERKStepSetErrorBias: user should set this value directly in the + SUNAdaptController object. ---------------------------------------------------------------*/ -int erkStep_SetRelaxFn(ARKodeMem ark_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) +int ERKStepSetErrorBias(void* arkode_mem, sunrealtype bias) { - return ( - arkRelaxCreate(ark_mem, rfn, rjac, erkStep_RelaxDeltaE, erkStep_GetOrder)); + return (arkSetErrorBias(arkode_mem, bias)); } +/*=============================================================== + ERKStep optional input functions -- stepper-specific + ===============================================================*/ + /*--------------------------------------------------------------- - erkStep_SetDefaults: + ERKStepSetDefaults: 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 ERKStepSetDefaults(void* arkode_mem) { + ARKodeMem ark_mem; ARKodeERKStepMem step_mem; int retval; long int lenrw, leniw; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &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); @@ -319,18 +478,19 @@ int erkStep_SetDefaults(ARKodeMem ark_mem) } /*--------------------------------------------------------------- - erkStep_SetOrder: + ERKStepSetOrder: Specifies the method order ---------------------------------------------------------------*/ -int erkStep_SetOrder(ARKodeMem ark_mem, int ord) +int ERKStepSetOrder(void* arkode_mem, int ord) { + ARKodeMem ark_mem; ARKodeERKStepMem step_mem; sunindextype Blrw, Bliw; int retval; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set user-provided value, or default, depending on argument */ @@ -352,413 +512,317 @@ int erkStep_SetOrder(ARKodeMem ark_mem, int ord) } /*--------------------------------------------------------------- - erkStep_GetEstLocalErrors: Returns the current local truncation - error estimate vector - ---------------------------------------------------------------*/ -int erkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele) -{ - 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); -} + ERKStepSetTable: -/*--------------------------------------------------------------- - erkStep_PrintAllStats: + Specifies to use a customized Butcher table for the explicit + portion of the system. - Prints integrator statistics + 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 erkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) +int ERKStepSetTable(void* arkode_mem, ARKodeButcherTable B) { + ARKodeMem ark_mem; ARKodeERKStepMem step_mem; + sunindextype Blrw, Bliw; int retval; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - switch (fmt) + /* check for legal inputs */ + if (B == NULL) { - 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); + 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); } /*--------------------------------------------------------------- - erkStep_WriteParameters: + ERKStepSetTableNum: - Outputs all solver parameters to the provided file pointer. + 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 erkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) +int ERKStepSetTableNum(void* arkode_mem, ARKODE_ERKTableID etable) { + ARKodeMem ark_mem; ARKodeERKStepMem step_mem; + sunindextype Blrw, Bliw; int retval; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &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); -} - -/*=============================================================== - Exported-but-deprecated user-callable functions. - ===============================================================*/ - -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 ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) -{ - return (ARKodeReset(arkode_mem, tR, yR)); -} - -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 ERKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) -{ - return (ARKodeRootInit(arkode_mem, nrtfn, g)); -} - -int ERKStepSetDefaults(void* arkode_mem) -{ - return (ARKodeSetDefaults(arkode_mem)); -} - -int ERKStepSetOrder(void* arkode_mem, int ord) -{ - return (ARKodeSetOrder(arkode_mem, ord)); -} - -int ERKStepSetInterpolantType(void* arkode_mem, int itype) -{ - return (ARKodeSetInterpolantType(arkode_mem, itype)); -} - -int ERKStepSetInterpolantDegree(void* arkode_mem, int degree) -{ - return (ARKodeSetInterpolantDegree(arkode_mem, degree)); -} - -int ERKStepSetDenseOrder(void* arkode_mem, int dord) -{ - return (ARKodeSetInterpolantDegree(arkode_mem, dord)); -} - -int ERKStepSetAdaptController(void* arkode_mem, SUNAdaptController C) -{ - return (ARKodeSetAdaptController(arkode_mem, C)); -} - -int ERKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust) -{ - return (ARKodeSetAdaptivityAdjustment(arkode_mem, adjust)); -} - -int ERKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) -{ - return (ARKodeSetCFLFraction(arkode_mem, cfl_frac)); -} - -int ERKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) -{ - return (ARKodeSetSafetyFactor(arkode_mem, safety)); -} - -int ERKStepSetErrorBias(void* arkode_mem, sunrealtype bias) -{ - return (ARKodeSetErrorBias(arkode_mem, bias)); -} - -int ERKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) -{ - return (ARKodeSetMaxGrowth(arkode_mem, mx_growth)); -} - -int ERKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) -{ - return (ARKodeSetMinReduction(arkode_mem, eta_min)); -} - -int ERKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) -{ - return (ARKodeSetFixedStepBounds(arkode_mem, lb, ub)); -} - -int ERKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, - int pq, sunrealtype adapt_params[3]) -{ - return (arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); -} - -int ERKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) -{ - return (arkSetAdaptivityFn(arkode_mem, hfun, h_data)); -} - -int ERKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) -{ - return (ARKodeSetMaxFirstGrowth(arkode_mem, etamx1)); -} - -int ERKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) -{ - return (ARKodeSetMaxEFailGrowth(arkode_mem, etamxf)); -} - -int ERKStepSetSmallNumEFails(void* arkode_mem, int small_nef) -{ - return (ARKodeSetSmallNumEFails(arkode_mem, small_nef)); -} - -int ERKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) -{ - return (ARKodeSetStabilityFn(arkode_mem, EStab, estab_data)); -} - -int ERKStepSetMaxErrTestFails(void* arkode_mem, int maxnef) -{ - return (ARKodeSetMaxErrTestFails(arkode_mem, maxnef)); -} - -int ERKStepSetConstraints(void* arkode_mem, N_Vector constraints) -{ - return (ARKodeSetConstraints(arkode_mem, constraints)); -} - -int ERKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) -{ - return (ARKodeSetMaxNumSteps(arkode_mem, mxsteps)); -} - -int ERKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) -{ - return (ARKodeSetMaxHnilWarns(arkode_mem, mxhnil)); -} - -int ERKStepSetInitStep(void* arkode_mem, sunrealtype hin) -{ - return (ARKodeSetInitStep(arkode_mem, hin)); -} - -int ERKStepSetMinStep(void* arkode_mem, sunrealtype hmin) -{ - return (ARKodeSetMinStep(arkode_mem, hmin)); -} - -int ERKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) -{ - return (ARKodeSetMaxStep(arkode_mem, hmax)); -} + /* 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 ERKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) -{ - return (ARKodeSetInterpolateStopTime(arkode_mem, interp)); -} + /* clear any existing parameters and Butcher tables */ + step_mem->stages = 0; + step_mem->q = 0; + step_mem->p = 0; -int ERKStepSetStopTime(void* arkode_mem, sunrealtype tstop) -{ - return (ARKodeSetStopTime(arkode_mem, tstop)); -} + 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 ERKStepClearStopTime(void* arkode_mem) -{ - return (ARKodeClearStopTime(arkode_mem)); -} + /* 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 ERKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) -{ - return (ARKodeSetFixedStep(arkode_mem, hfixed)); -} + ARKodeButcherTable_Space(step_mem->B, &Bliw, &Blrw); + ark_mem->liw += Bliw; + ark_mem->lrw += Blrw; -int ERKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) -{ - return (ARKodeSetMaxNumConstrFails(arkode_mem, maxfails)); + return (ARK_SUCCESS); } -int ERKStepSetRootDirection(void* arkode_mem, int* rootdir) -{ - return (ARKodeSetRootDirection(arkode_mem, rootdir)); -} +/*--------------------------------------------------------------- + ERKStepSetTableName: -int ERKStepSetNoInactiveRootWarn(void* arkode_mem) + 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 (ARKodeSetNoInactiveRootWarn(arkode_mem)); + return ERKStepSetTableNum(arkode_mem, arkButcherTableERKNameToID(etable)); } -int ERKStepSetUserData(void* arkode_mem, void* user_data) -{ - return (ARKodeSetUserData(arkode_mem, user_data)); -} +/*=============================================================== + ERKStep optional output functions -- stepper-specific + ===============================================================*/ -int ERKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) -{ - return (ARKodeSetPostprocessStepFn(arkode_mem, ProcessStep)); -} +/*--------------------------------------------------------------- + ERKStepGetNumRhsEvals: -int ERKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) + Returns the current number of calls to fe and fi + ---------------------------------------------------------------*/ +int ERKStepGetNumRhsEvals(void* arkode_mem, long int* fevals) { - return (ARKodeSetPostprocessStageFn(arkode_mem, ProcessStage)); -} + ARKodeMem ark_mem; + ARKodeERKStepMem step_mem; + int retval; -int ERKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask) -{ - return (ARKodeEvolve(arkode_mem, tout, yout, tret, itask)); -} + /* access ARKodeERKStepMem structure */ + retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ERKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) -{ - return (ARKodeGetDky(arkode_mem, t, k, dky)); -} + /* get values from step_mem */ + *fevals = step_mem->nfe; -int ERKStepGetNumExpSteps(void* arkode_mem, long int* nsteps) -{ - return (ARKodeGetNumExpSteps(arkode_mem, nsteps)); + return (ARK_SUCCESS); } -int ERKStepGetNumAccSteps(void* arkode_mem, long int* nsteps) -{ - return (ARKodeGetNumAccSteps(arkode_mem, nsteps)); -} +/*--------------------------------------------------------------- + ERKStepGetCurrentButcherTable: -int ERKStepGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) + Sets pointers to the Butcher table currently in use. + ---------------------------------------------------------------*/ +int ERKStepGetCurrentButcherTable(void* arkode_mem, ARKodeButcherTable* B) { - return (ARKodeGetNumStepAttempts(arkode_mem, nstep_attempts)); -} + ARKodeMem ark_mem; + ARKodeERKStepMem step_mem; + int retval; -int ERKStepGetNumErrTestFails(void* arkode_mem, long int* netfails) -{ - return (ARKodeGetNumErrTestFails(arkode_mem, netfails)); -} + /* access ARKodeERKStepMem structure */ + retval = erkStep_AccessStepMem(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)); + /* get tables from step_mem */ + *B = step_mem->B; + return (ARK_SUCCESS); } -int ERKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) -{ - return (ARKodeGetWorkSpace(arkode_mem, lenrw, leniw)); -} +/*--------------------------------------------------------------- + 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) -int ERKStepGetNumSteps(void* arkode_mem, long int* nsteps) + Returns an estimate of the local error + ---------------------------------------------------------------*/ +int ERKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele) { - return (ARKodeGetNumSteps(arkode_mem, nsteps)); -} + ARKodeMem ark_mem; + ARKodeERKStepMem step_mem; + int retval; -int ERKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) -{ - return (ARKodeGetActualInitStep(arkode_mem, hinused)); -} + /* access ARKodeERKStepMem structure */ + retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ERKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) -{ - return (ARKodeGetLastStep(arkode_mem, hlast)); -} + /* copy vector to output */ + N_VScale(ONE, ark_mem->tempv1, ele); -int ERKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) -{ - return (ARKodeGetCurrentStep(arkode_mem, hcur)); + return (ARK_SUCCESS); } -int ERKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) -{ - return (ARKodeGetCurrentTime(arkode_mem, tcur)); -} +/*--------------------------------------------------------------- + ERKStepGetTimestepperStats: -int ERKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) + Returns integrator statistics + ---------------------------------------------------------------*/ +int ERKStepGetTimestepperStats(void* arkode_mem, long int* expsteps, + long int* accsteps, long int* attempts, + long int* fevals, long int* netfails) { - return (ARKodeGetTolScaleFactor(arkode_mem, tolsfact)); -} + ARKodeMem ark_mem; + ARKodeERKStepMem step_mem; + int retval; -int ERKStepGetErrWeights(void* arkode_mem, N_Vector eweight) -{ - return (ARKodeGetErrWeights(arkode_mem, eweight)); -} + /* access ARKodeERKStepMem structure */ + retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ERKStepGetNumGEvals(void* arkode_mem, long int* ngevals) -{ - return (ARKodeGetNumGEvals(arkode_mem, ngevals)); -} + /* set expsteps and accsteps from adaptivity structure */ + *expsteps = ark_mem->hadapt_mem->nst_exp; + *accsteps = ark_mem->hadapt_mem->nst_acc; -int ERKStepGetRootInfo(void* arkode_mem, int* rootsfound) -{ - return (ARKodeGetRootInfo(arkode_mem, rootsfound)); -} + /* set remaining outputs */ + *attempts = ark_mem->nst_attempts; + *fevals = step_mem->nfe; + *netfails = ark_mem->netf; -int ERKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) -{ - return (ARKodeGetNumConstrFails(arkode_mem, nconstrfails)); + return (ARK_SUCCESS); } -int ERKStepGetUserData(void* arkode_mem, void** user_data) -{ - return (ARKodeGetUserData(arkode_mem, user_data)); -} +/*--------------------------------------------------------------- + ERKStepPrintAllStats: + Prints integrator statistics + ---------------------------------------------------------------*/ int ERKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) { - return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); -} + ARKodeMem ark_mem; + ARKodeERKStepMem step_mem; + int retval; -char* ERKStepGetReturnFlagName(long int flag) -{ - return (ARKodeGetReturnFlagName(flag)); + /* 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); + 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); } +/*=============================================================== + ERKStep parameter output + ===============================================================*/ + +/*--------------------------------------------------------------- + ERKStepWriteParameters: + + Outputs all solver parameters to the provided file pointer. + ---------------------------------------------------------------*/ int ERKStepWriteParameters(void* arkode_mem, FILE* fp) { - return (ARKodeWriteParameters(arkode_mem, fp)); + 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); } + + /* 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); + fprintf(fp, "\n"); + + return (ARK_SUCCESS); } +/*--------------------------------------------------------------- + ERKStepWriteButcher: + + Outputs Butcher tables to the provided file pointer. + ---------------------------------------------------------------*/ int ERKStepWriteButcher(void* arkode_mem, FILE* fp) { int retval; ARKodeMem ark_mem; ARKodeERKStepMem step_mem; - /* access ARKodeMem and ARKodeERKStepMem structures */ - retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeERKStepMem structure */ + retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* check that Butcher table is non-NULL (otherwise report error) */ @@ -777,94 +841,6 @@ 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 2b4ad70e3a..ca7beff869 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -17,12 +17,11 @@ #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> @@ -34,7 +33,7 @@ #include "arkode_root_impl.h" #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" { @@ -68,29 +67,23 @@ extern "C" { ===============================================================*/ /* Basic ARKODE defaults */ -/* 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 +#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 */ /* Numeric constants */ -#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) +#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 */ /* Control constants for tolerances */ #define ARK_SS 0 @@ -147,145 +140,56 @@ 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 internal interface - functions is located at the end of this file */ +/* NOTE: documentation for the purpose of these functions is + located at the end of this file */ /* linear solver interface functions */ -typedef int (*ARKLinsolInitFn)(ARKodeMem ark_mem); -typedef int (*ARKLinsolSetupFn)(ARKodeMem ark_mem, int convfail, +typedef int (*ARKLinsolInitFn)(void* arkode_mem); +typedef int (*ARKLinsolSetupFn)(void* arkode_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)(ARKodeMem ark_mem, N_Vector b, sunrealtype tcur, +typedef int (*ARKLinsolSolveFn)(void* arkode_mem, N_Vector b, sunrealtype tcur, N_Vector ycur, N_Vector fcur, sunrealtype client_tol, int mnewt); -typedef int (*ARKLinsolFreeFn)(ARKodeMem ark_mem); +typedef int (*ARKLinsolFreeFn)(void* arkode_mem); -/* mass matrix solver interface functions */ -typedef int (*ARKMassInitFn)(ARKodeMem ark_mem); -typedef int (*ARKMassSetupFn)(ARKodeMem ark_mem, sunrealtype t, N_Vector vtemp1, +/* mass-matrix solver interface functions */ +typedef int (*ARKMassInitFn)(void* arkode_mem); +typedef int (*ARKMassSetupFn)(void* arkode_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)(ARKodeMem ark_mem, N_Vector b, +typedef int (*ARKMassSolveFn)(void* arkode_mem, N_Vector b, sunrealtype client_tol); -typedef int (*ARKMassFreeFn)(ARKodeMem ark_mem); - -/* time stepper interface functions -- general */ -typedef int (*ARKTimestepInitFn)(ARKodeMem ark_mem, 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); -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 (*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); - -/* time stepper interface functions -- implicit solvers */ -typedef int (*ARKTimestepAttachLinsolFn)(ARKodeMem ark_mem, ARKLinsolInitFn linit, +typedef int (*ARKMassFreeFn)(void* arkode_mem); + +/* time stepper interface functions */ +typedef int (*ARKTimestepInitFn)(void* arkode_mem, int init_type); +typedef int (*ARKTimestepAttachLinsolFn)(void* arkode_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); -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); -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 (*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); - -/* time stepper interface functions -- non-identity mass matrices */ typedef int (*ARKTimestepAttachMasssolFn)( - ARKodeMem ark_mem, ARKMassInitFn minit, ARKMassSetupFn msetup, + void* arkode_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); +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, + 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); /*=============================================================== ARKODE interpolation module definition @@ -300,15 +204,15 @@ typedef struct _generic_ARKInterp* ARKInterp; /* Structure containing function pointers to interpolation operations */ struct _generic_ARKInterpOps { - int (*resize)(ARKodeMem ark_mem, ARKInterp interp, ARKVecResizeFn resize, + int (*resize)(void* arkode_mem, ARKInterp interp, ARKVecResizeFn resize, void* resize_data, sunindextype lrw_diff, sunindextype liw_diff, N_Vector tmpl); - void (*free)(ARKodeMem ark_mem, ARKInterp interp); + void (*free)(void* arkode_mem, ARKInterp interp); void (*print)(ARKInterp interp, FILE* outfile); - 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 (*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 order, N_Vector yout); }; @@ -321,15 +225,15 @@ struct _generic_ARKInterp }; /* ARKInterp module functions */ -int arkInterpResize(ARKodeMem ark_mem, ARKInterp interp, ARKVecResizeFn resize, +int arkInterpResize(void* arkode_mem, ARKInterp interp, ARKVecResizeFn resize, void* resize_data, sunindextype lrw_diff, sunindextype liw_diff, N_Vector tmpl); -void arkInterpFree(ARKodeMem ark_mem, ARKInterp interp); +void arkInterpFree(void* arkode_mem, ARKInterp interp); void arkInterpPrintMem(ARKInterp interp, FILE* outfile); -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 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 d, int order, N_Vector yout); /*=============================================================== @@ -392,64 +296,20 @@ struct ARKodeMemRec void* r_data; /* user pointer passed to rfun */ sunbooleantype constraintsSet; /* check inequality constraints */ - /* Time stepper module -- general */ - void* step_mem; - 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; - 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; + /* Time stepper module */ ARKTimestepAttachLinsolFn step_attachlinsol; - ARKTimestepDisableLSetup step_disablelsetup; - ARKTimestepGetLinMemFn step_getlinmem; - ARKTimestepGetImplicitRHSFn step_getimplicitrhs; - ARKTimestepGetGammasFn step_getgammas; - ARKTimestepComputeState step_computestate; - ARKTimestepSetNonlinearSolver step_setnonlinearsolver; - ARKTimestepSetLinear step_setlinear; - ARKTimestepSetAutonomous step_setautonomous; - 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; - ARKTimestepGetNumLinSolvSetups step_getnumlinsolvsetups; - ARKTimestepGetCurrentGamma step_getcurrentgamma; - ARKTimestepGetNonlinearSystemData step_getnonlinearsystemdata; - ARKTimestepGetNumNonlinSolvIters step_getnumnonlinsolviters; - ARKTimestepGetNumNonlinSolvConvFails step_getnumnonlinsolvconvfails; - ARKTimestepGetNonlinSolvStats step_getnonlinsolvstats; - - /* Time stepper module -- non-identity mass matrices */ - sunbooleantype step_supports_massmatrix; ARKTimestepAttachMasssolFn step_attachmasssol; + ARKTimestepDisableLSetup step_disablelsetup; ARKTimestepDisableMSetup step_disablemsetup; + ARKTimestepGetLinMemFn step_getlinmem; ARKTimestepGetMassMemFn step_getmassmem; + ARKTimestepGetImplicitRHSFn step_getimplicitrhs; ARKMassMultFn step_mmult; + ARKTimestepGetGammasFn step_getgammas; + ARKTimestepInitFn step_init; + ARKTimestepFullRHSFn step_fullrhs; + ARKTimestepStepFn step; + void* step_mem; /* N_Vector storage */ N_Vector ewt; /* error weight vector */ @@ -465,14 +325,12 @@ 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 */ /* Temporal interpolation module */ ARKInterp interp; int interp_type; - int interp_degree; /* Tstop information */ sunbooleantype tstopset; @@ -563,355 +421,156 @@ struct ARKodeMemRec }; /*=============================================================== - ARKODE PROTOTYPE FUNCTIONS (MAY BE REPLACED BY USER) + Interface To Linear Solvers ===============================================================*/ -/* Prototype of internal rwtSet function */ -int arkRwtSet(N_Vector ycur, N_Vector weight, void* data); +/*--------------------------------------------------------------- + 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. + --------------------------------------------------------------*/ -/* Prototype of internal explicit stability estimation function */ -int arkExpStab(N_Vector y, sunrealtype t, sunrealtype* hstab, void* user_data); +/* Constants for convfail (input to lsetup) */ +#define ARK_NO_FAILURES 0 +#define ARK_FAIL_BAD_J 1 +#define ARK_FAIL_OTHER 2 -/*=============================================================== - HIGH LEVEL ERROR HANDLER, USED THROUGHOUT ARKODE - ===============================================================*/ +/*--------------------------------------------------------------- + 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. + ---------------------------------------------------------------*/ -void arkProcessError(ARKodeMem ark_mem, int error_code, int line, - const char* func, const char* file, const char* msgfmt, ...); +/*--------------------------------------------------------------- + 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 PRIVATE FUNCTION PROTOTYPES - ===============================================================*/ + arkode_mem - void* problem memory pointer of type ARKodeMem. See + the typedef earlier in this file. -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); + 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. -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); + tpred - the time for the current ARKODE internal step. -int arkCompleteStep(ARKodeMem ark_mem, sunrealtype dsm); -int arkHandleFailure(ARKodeMem ark_mem, int flag); + ypred - the predicted y vector for the current ARKODE internal + step. -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); + fpred - f(tpred, ypred). -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); + 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 arkSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, int pq, - sunrealtype adapt_params[3]); -int arkSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data); + vtemp1 - temporary N_Vector provided for use by lsetup. -ARKODE_DIRKTableID arkButcherTableDIRKNameToID(const char* imethod); -ARKODE_ERKTableID arkButcherTableERKNameToID(const char* emethod); + vtemp3 - temporary N_Vector provided for use by lsetup. -/* XBraid interface functions */ -int arkSetForcePass(void* arkode_mem, sunbooleantype force_pass); -int arkGetLastKFlag(void* arkode_mem, int* last_kflag); + vtemp3 - temporary N_Vector provided for use by lsetup. -/*=============================================================== - Reusable ARKODE Error Messages - ===============================================================*/ + This routine should return 0 if successful, a positive value + for a recoverable error, and a negative value for an + unrecoverable error. + ---------------------------------------------------------------*/ -#if defined(SUNDIALS_EXTENDED_PRECISION) +/*--------------------------------------------------------------- + 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). -#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" + Additional vectors that are set within the ARKODE memory + structure, and that may be of use within an iterative linear + solver, include: -#elif defined(SUNDIALS_DOUBLE_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) -#else + 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 = %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" +/*--------------------------------------------------------------- + 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. + ---------------------------------------------------------------*/ -#endif +/*--------------------------------------------------------------- + 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. + ---------------------------------------------------------------*/ -/* 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 - - 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 - - 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 - necessary. Its parameters are as follows: +/*--------------------------------------------------------------- + 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 + necessary. Its parameters are as follows: arkode_mem - void* problem memory pointer of type ARKodeMem. See the typedef earlier in this file. @@ -920,21 +579,21 @@ int arkGetLastKFlag(void* arkode_mem, int* last_kflag); This routine should return 0 if successful, and a negative value for an unrecoverable error. + ---------------------------------------------------------------*/ - --------------------------------------------------------------- - +/*--------------------------------------------------------------- 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 - + --------------------------------------------------------------- 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 @@ -953,44 +612,163 @@ int arkGetLastKFlag(void* arkode_mem, int* last_kflag); 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 - + --------------------------------------------------------------- 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. + ---------------------------------------------------------------*/ - =============================================================== - - Internal Interface to Time Steppers -- General +/*=============================================================== + Interface to Time Steppers + ===============================================================*/ +/*--------------------------------------------------------------- + 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. - ARKTimestepInitFn + 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. + ---------------------------------------------------------------*/ - 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 - a specific ARKODE time stepping module, such as verifying - compatibility of user-specified linear and nonlinear solver - objects. The input init_type flag indicates if the call is - for (re-)initializing, resizing, or resetting the problem. +/*--------------------------------------------------------------- + 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 initialized - 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. + 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). - ARKTimestepFullRHSFn + This routine has no return value. + ---------------------------------------------------------------*/ - 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 +/*--------------------------------------------------------------- + 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 + a specific ARKODE time stepping module, such as verifying + compatibility of user-specified linear and nonlinear solver + objects. The input init_type flag indicates if the call is + for (re-)initializing, resizing, or resetting the problem. + + This routine should return 0 if it has successfully initialized + 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 + --------------------------------------------------------------- + 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 the sum of many ODE RHS functions (e.g. ARK, MRI). The 'mode' indicates where this routine is called: @@ -1020,11 +798,11 @@ int arkGetLastKFlag(void* arkode_mem, int* last_kflag); 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 - + --------------------------------------------------------------- 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). @@ -1067,397 +845,313 @@ int arkGetLastKFlag(void* arkode_mem, int* last_kflag); >0 => step encountered recoverable failure; reduce step and retry (if possible) <0 => step encountered unrecoverable failure + ---------------------------------------------------------------*/ - --------------------------------------------------------------- - - ARKTimetepSetUserDataFn - - This optional routine provides the input from ARKodeSetUserData - to the stepper. - - --------------------------------------------------------------- - - ARKTimestepPrintAllStats - - This optional routine allows the stepper to optionally print - out any internally-stored solver statistics when - ARKodePrintAllStats is called. - - --------------------------------------------------------------- - - ARKTimestepWriteParameters - - This optional routine allows the stepper to optionally print - out any solver parameters when ARKodeWriteParameters is called. - - --------------------------------------------------------------- - - ARKTimestepResize - - This optional routine allows the stepper to optionally resize - any internal vector storage when ARKodeResize is called. - - --------------------------------------------------------------- - - ARKTimestepReset - - This optional routine allows the stepper to reset any internal - data when ARKodeReset is called. - - --------------------------------------------------------------- - - ARKTimestepFree - - This optional routine allows the stepper the free any - interally-stored memory when ARKodeFree is called. - - --------------------------------------------------------------- - - ARKTimestepPrintMem - - This optional routine allows the stepper to output any internal - memory (typically for debugging purposes) when ARKodePrintMem is - called. +/*=============================================================== + ARKODE PROTOTYPE FUNCTIONS (MAY BE REPLACED BY USER) + ===============================================================*/ - --------------------------------------------------------------- +/* Prototype of internal rwtSet function */ +int arkRwtSet(N_Vector ycur, N_Vector weight, void* data); - ARKTimestepSetDefaults +/* Prototype of internal explicit stability estimation function */ +int arkExpStab(N_Vector y, sunrealtype t, sunrealtype* hstab, void* user_data); - This optional routine allows the stepper to reset any internal - solver parameters to their default values, and is called by - ARKodeSetDefaults. +/*=============================================================== + 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, ...); - ARKTimestepSetOrder +/*=============================================================== + ARKODE PRIVATE FUNCTION PROTOTYPES + ===============================================================*/ +#ifdef __GNUC__ +#define SUNDIALS_UNUSED __attribute__((unused)) +#else +#define SUNDIALS_UNUSED +#endif - This optional routine allows the stepper to accept any user- - requested method order parameter that was passed to - ARKodeSetOrder. +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); +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); +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); - Internal Interface to Time Steppers -- Temporal Adaptivity +int arkCompleteStep(ARKodeMem ark_mem, sunrealtype dsm); +int arkHandleFailure(ARKodeMem ark_mem, int flag); - These should only be provided if the stepper supports temporal - adaptivity, and should be indicated by setting the flag - "step_supports_adaptive" to SUNTRUE. +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); +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); +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); - ARKTimestepGetEstLocalErrors +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); +int arkAllocSUNStepperForcing(SUNStepper stepper, int count, N_Vector tmpl); +int arkFreeSUNStepperForcing(SUNStepper stepper); - This routine requests the stepper to copy its internal - estimate of the local trunction error to the output (called by - ARKodeGetEstLocalErrors). +ARKODE_DIRKTableID arkButcherTableDIRKNameToID(const char* imethod); +ARKODE_ERKTableID arkButcherTableERKNameToID(const char* emethod); - =============================================================== +/* XBraid interface functions */ +int arkSetForcePass(void* arkode_mem, sunbooleantype force_pass); +int arkGetLastKFlag(void* arkode_mem, int* last_kflag); - Internal Interface to Time Steppers -- Relaxation +/*=============================================================== + Reusable ARKODE Error Messages + ===============================================================*/ - 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. +#if defined(SUNDIALS_EXTENDED_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" - ARKTimestepSetRelaxFn +#elif defined(SUNDIALS_DOUBLE_PRECISION) - This routine is called by ARKodeSetRelaxFn, and expects the - stepper to call ARKODE's "arkRelaxCreate" routine with the - appropriate stepper-specific function pointers. +#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" - =============================================================== +#else - Internal Interface to Time Steppers -- Implicit Solvers +#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" - 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. +#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." - 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. - - --------------------------------------------------------------- - - 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 - 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. - - ===============================================================*/ +/* 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." #ifdef __cplusplus } diff --git a/src/arkode/arkode_interp.c b/src/arkode/arkode_interp.c index daf42de479..c481e465df 100644 --- a/src/arkode/arkode_interp.c +++ b/src/arkode/arkode_interp.c @@ -23,7 +23,6 @@ #include <sundials/sundials_math.h> #include <sundials/sundials_types.h> -#include "arkode/arkode.h" #include "arkode_impl.h" #include "arkode_interp_impl.h" @@ -32,19 +31,19 @@ interpolation modules ---------------------------------------------------------------*/ -int arkInterpResize(ARKodeMem ark_mem, ARKInterp interp, ARKVecResizeFn resize, +int arkInterpResize(void* arkode_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(ark_mem, interp, resize, resize_data, + return ((int)interp->ops->resize(arkode_mem, interp, resize, resize_data, lrw_diff, liw_diff, tmpl)); } -void arkInterpFree(ARKodeMem ark_mem, ARKInterp interp) +void arkInterpFree(void* arkode_mem, ARKInterp interp) { if (interp == NULL) { return; } - interp->ops->free(ark_mem, interp); + interp->ops->free(arkode_mem, interp); return; } @@ -55,29 +54,29 @@ void arkInterpPrintMem(ARKInterp interp, FILE* outfile) return; } -int arkInterpSetDegree(ARKodeMem ark_mem, ARKInterp interp, int degree) +int arkInterpSetDegree(void* arkode_mem, ARKInterp interp, int degree) { if (interp == NULL) { return (ARK_SUCCESS); } - return ((int)interp->ops->setdegree(ark_mem, interp, degree)); + return ((int)interp->ops->setdegree(arkode_mem, interp, degree)); } -int arkInterpInit(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tnew) +int arkInterpInit(void* arkode_mem, ARKInterp interp, sunrealtype tnew) { if (interp == NULL) { return (ARK_SUCCESS); } - return ((int)interp->ops->init(ark_mem, interp, tnew)); + return ((int)interp->ops->init(arkode_mem, interp, tnew)); } -int arkInterpUpdate(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tnew) +int arkInterpUpdate(void* arkode_mem, ARKInterp interp, sunrealtype tnew) { if (interp == NULL) { return (ARK_SUCCESS); } - return ((int)interp->ops->update(ark_mem, interp, tnew)); + return ((int)interp->ops->update(arkode_mem, interp, tnew)); } -int arkInterpEvaluate(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tau, +int arkInterpEvaluate(void* arkode_mem, ARKInterp interp, sunrealtype tau, int d, int order, N_Vector yout) { if (interp == NULL) { return (ARK_SUCCESS); } - return ((int)interp->ops->evaluate(ark_mem, interp, tau, d, order, yout)); + return ((int)interp->ops->evaluate(arkode_mem, interp, tau, d, order, yout)); } /*--------------------------------------------------------------- @@ -91,11 +90,16 @@ int arkInterpEvaluate(ARKodeMem ark_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(ARKodeMem ark_mem, int degree) +ARKInterp arkInterpCreate_Hermite(void* arkode_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); } @@ -164,11 +168,17 @@ ARKInterp arkInterpCreate_Hermite(ARKodeMem ark_mem, int degree) This routine resizes the internal vectors. ---------------------------------------------------------------*/ -int arkInterpResize_Hermite(ARKodeMem ark_mem, ARKInterp interp, +int arkInterpResize_Hermite(void* arkode_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); } @@ -209,8 +219,14 @@ int arkInterpResize_Hermite(ARKodeMem ark_mem, ARKInterp interp, This routine frees the Hermite ARKInterp structure. ---------------------------------------------------------------*/ -void arkInterpFree_Hermite(ARKodeMem ark_mem, ARKInterp interp) +void arkInterpFree_Hermite(void* arkode_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; } @@ -291,27 +307,57 @@ void arkInterpPrintMem_Hermite(ARKInterp interp, FILE* outfile) /*--------------------------------------------------------------- arkInterpSetDegree_Hermite - This routine sets a supplied interpolation degree which must be - in the range 0 <= degree <= ARK_INTERP_MAX_DEGREE. + 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]. 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(ARKodeMem ark_mem, ARKInterp interp, int degree) +int arkInterpSetDegree_Hermite(void* arkode_mem, ARKInterp interp, int degree) { - if (degree > ARK_INTERP_MAX_DEGREE || degree < 0) + 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); } + + /* on positive degree, check for allowable value and overwrite stored degree */ + if (degree >= 0) { - arkProcessError(ark_mem, ARK_INTERP_FAIL, __LINE__, __func__, __FILE__, - "Illegal degree specified."); - return ARK_ILL_INPUT; + 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); } - HINT_DEGREE(interp) = degree; + /* 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); - return ARK_SUCCESS; + return (ARK_SUCCESS); } /*--------------------------------------------------------------- @@ -324,8 +370,14 @@ int arkInterpSetDegree_Hermite(ARKodeMem ark_mem, ARKInterp interp, int degree) 4. Calls the full RHS routine to fill fnew 5. Copies fnew into fold ---------------------------------------------------------------*/ -int arkInterpInit_Hermite(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tnew) +int arkInterpInit_Hermite(void* arkode_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; @@ -378,9 +430,14 @@ int arkInterpInit_Hermite(ARKodeMem ark_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(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tnew) +int arkInterpUpdate_Hermite(void* arkode_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 */ @@ -434,7 +491,7 @@ int arkInterpUpdate_Hermite(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tne where h = tnew-told, i.e. values -1<tau<0 provide interpolation, other values result in extrapolation. ---------------------------------------------------------------*/ -int arkInterpEvaluate_Hermite(ARKodeMem ark_mem, ARKInterp interp, +int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, sunrealtype tau, int d, int order, N_Vector yout) { /* local variables */ @@ -443,6 +500,11 @@ int arkInterpEvaluate_Hermite(ARKodeMem ark_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; @@ -579,7 +641,7 @@ int arkInterpEvaluate_Hermite(ARKodeMem ark_mem, ARKInterp interp, /* first, evaluate cubic interpolant at tau=-1/3 */ tval = -ONE / THREE; - retval = arkInterpEvaluate(ark_mem, interp, tval, 0, 3, yout); + retval = arkInterpEvaluate(arkode_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 */ @@ -649,7 +711,7 @@ int arkInterpEvaluate_Hermite(ARKodeMem ark_mem, ARKInterp interp, /* first, evaluate quartic interpolant at tau=-1/3 */ tval = -ONE / THREE; - retval = arkInterpEvaluate(ark_mem, interp, tval, 0, 4, yout); + retval = arkInterpEvaluate(arkode_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 */ @@ -660,7 +722,7 @@ int arkInterpEvaluate_Hermite(ARKodeMem ark_mem, ARKInterp interp, /* third, evaluate quartic interpolant at tau=-2/3 */ tval = -TWO / THREE; - retval = arkInterpEvaluate(ark_mem, interp, tval, 0, 4, yout); + retval = arkInterpEvaluate(arkode_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 */ @@ -793,11 +855,16 @@ int arkInterpEvaluate_Hermite(ARKodeMem ark_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(ARKodeMem ark_mem, int degree) +ARKInterp arkInterpCreate_Lagrange(void* arkode_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); } @@ -865,12 +932,16 @@ ARKInterp arkInterpCreate_Lagrange(ARKodeMem ark_mem, int degree) This routine resizes the internal vectors. ---------------------------------------------------------------*/ -int arkInterpResize_Lagrange(ARKodeMem ark_mem, ARKInterp I, - ARKVecResizeFn resize, void* resize_data, - sunindextype lrw_diff, sunindextype liw_diff, - N_Vector y0) +int arkInterpResize_Lagrange(void* arkode_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); } @@ -897,9 +968,14 @@ int arkInterpResize_Lagrange(ARKodeMem ark_mem, ARKInterp I, This routine frees the Lagrange ARKInterp structure. ---------------------------------------------------------------*/ -void arkInterpFree_Lagrange(ARKodeMem ark_mem, ARKInterp I) +void arkInterpFree_Lagrange(void* arkode_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; } @@ -993,27 +1069,57 @@ void arkInterpPrintMem_Lagrange(ARKInterp I, FILE* outfile) /*--------------------------------------------------------------- arkInterpSetDegree_Lagrange - This routine sets a supplied interpolation degree which must be - in the range 0 <= degree <= ARK_INTERP_MAX_DEGREE. + 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]. 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(ARKodeMem ark_mem, ARKInterp I, int degree) +int arkInterpSetDegree_Lagrange(void* arkode_mem, ARKInterp I, int degree) { - if (degree > ARK_INTERP_MAX_DEGREE || degree < 0) + 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); } + + /* on positive degree, check for allowable value and overwrite stored degree */ + if (degree >= 0) { - arkProcessError(ark_mem, ARK_INTERP_FAIL, __LINE__, __func__, __FILE__, - "Illegal degree specified."); - return ARK_ILL_INPUT; + 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); } - LINT_NMAX(I) = degree + 1; + /* 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); - return ARK_SUCCESS; + return (ARK_SUCCESS); } /*--------------------------------------------------------------- @@ -1025,9 +1131,14 @@ int arkInterpSetDegree_Lagrange(ARKodeMem ark_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(ARKodeMem ark_mem, ARKInterp I, sunrealtype tnew) +int arkInterpInit_Lagrange(void* arkode_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)) @@ -1113,15 +1224,20 @@ int arkInterpInit_Lagrange(ARKodeMem ark_mem, ARKInterp I, sunrealtype tnew) into the first history vector Otherwise it just returns with success. ---------------------------------------------------------------*/ -int arkInterpUpdate_Lagrange(ARKodeMem ark_mem, ARKInterp I, sunrealtype tnew) +int arkInterpUpdate_Lagrange(void* arkode_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); @@ -1182,7 +1298,7 @@ int arkInterpUpdate_Lagrange(ARKodeMem ark_mem, ARKInterp I, sunrealtype tnew) fixed step sizes, otherwise the stated lower bound is only approximate). ---------------------------------------------------------------*/ -int arkInterpEvaluate_Lagrange(ARKodeMem ark_mem, ARKInterp I, sunrealtype tau, +int arkInterpEvaluate_Lagrange(void* arkode_mem, ARKInterp I, sunrealtype tau, int deriv, int degree, N_Vector yout) { /* local variables */ @@ -1190,10 +1306,15 @@ int arkInterpEvaluate_Lagrange(ARKodeMem ark_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 9bbe3dd505..502817746e 100644 --- a/src/arkode/arkode_interp_impl.h +++ b/src/arkode/arkode_interp_impl.h @@ -71,18 +71,18 @@ 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, +ARKInterp arkInterpCreate_Hermite(void* arkode_mem, int degree); + +int arkInterpResize_Hermite(void* arkode_mem, ARKInterp interp, ARKVecResizeFn resize, void* resize_data, sunindextype lrw_diff, sunindextype liw_diff, N_Vector tmpl); -void arkInterpFree_Hermite(ARKodeMem ark_mem, ARKInterp interp); +void arkInterpFree_Hermite(void* arkode_mem, ARKInterp interp); void arkInterpPrintMem_Hermite(ARKInterp interp, FILE* outfile); -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, +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, sunrealtype tau, int d, int order, N_Vector yout); /*=============================================================== @@ -117,18 +117,19 @@ 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, +ARKInterp arkInterpCreate_Lagrange(void* arkode_mem, int degree); + +int arkInterpResize_Lagrange(void* arkode_mem, ARKInterp interp, ARKVecResizeFn resize, void* resize_data, sunindextype lrw_diff, sunindextype liw_diff, N_Vector tmpl); -void arkInterpFree_Lagrange(ARKodeMem ark_mem, ARKInterp interp); +void arkInterpFree_Lagrange(void* arkode_mem, ARKInterp interp); void arkInterpPrintMem_Lagrange(ARKInterp interp, FILE* outfile); -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, +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, sunrealtype tnew); -int arkInterpEvaluate_Lagrange(ARKodeMem ark_mem, ARKInterp interp, +int arkInterpEvaluate_Lagrange(void* arkode_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 b8a12c6a33..1f0bb406e8 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -25,17 +25,16 @@ #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" /*=============================================================== - ARKODE optional input functions + ARKODE optional input utility functions ===============================================================*/ /*--------------------------------------------------------------- - ARKodeSetDefaults: + arkSetDefaults: Resets all optional inputs to ARKODE default values. Does not change problem-defining function pointers fe and fi or @@ -43,10 +42,9 @@ structures/options related to root-finding (those can be reset using ARKodeRootInit) or post-processing a step (ProcessStep). ---------------------------------------------------------------*/ -int ARKodeSetDefaults(void* arkode_mem) +int arkSetDefaults(void* arkode_mem) { ARKodeMem ark_mem; - int retval; if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, @@ -55,13 +53,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 */ @@ -110,37 +101,7 @@ int ARKodeSetDefaults(void* arkode_mem) } /*--------------------------------------------------------------- - 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: + arkSetInterpolantType: Specifies use of the Lagrange or Hermite interpolation modules. itype == ARK_INTERP_HERMITE specifies the Hermite (nonstiff) @@ -154,7 +115,7 @@ int ARKodeSetOrder(void* arkode_mem, int ord) ARK_MEM_FAIL if the interpolation module cannot be allocated. ARK_ILL_INPUT if the itype argument is not recognized. ---------------------------------------------------------------*/ -int ARKodeSetInterpolantType(void* arkode_mem, int itype) +int arkSetInterpolantType(void* arkode_mem, int itype) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -166,8 +127,7 @@ 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) && - (itype != ARK_INTERP_NONE)) + if ((itype != ARK_INTERP_HERMITE) && (itype != ARK_INTERP_LAGRANGE)) { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, "Illegal interpolation type input."); @@ -193,37 +153,31 @@ 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_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 = arkInterpCreate_Hermite(arkode_mem, ARK_INTERP_MAX_DEGREE); ark_mem->interp_type = ARK_INTERP_HERMITE; } else if (itype == ARK_INTERP_LAGRANGE) { - 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 = arkInterpCreate_Lagrange(arkode_mem, ARK_INTERP_MAX_DEGREE); ark_mem->interp_type = ARK_INTERP_LAGRANGE; } else { ark_mem->interp = NULL; - ark_mem->interp_type = ARK_INTERP_NONE; + 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); } return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetInterpolantDegree: + arkSetInterpolantDegree: Specifies the polynomial degree for the dense output interpolation module. @@ -236,7 +190,7 @@ int ARKodeSetInterpolantType(void* arkode_mem, int itype) initialized. ARK_ILL_INPUT if the degree is illegal. ---------------------------------------------------------------*/ -int ARKodeSetInterpolantDegree(void* arkode_mem, int degree) +int arkSetInterpolantDegree(void* arkode_mem, int degree) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -247,6 +201,13 @@ 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) { @@ -255,32 +216,16 @@ int ARKodeSetInterpolantDegree(void* arkode_mem, int degree) return (ARK_ILL_INPUT); } - 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; + /* pass 'degree' to interpolation module, returning its value */ + return (arkInterpSetDegree(ark_mem, ark_mem->interp, degree)); } /*--------------------------------------------------------------- - ARKodeSetNonlinearSolver: + arkSetUserData: - This routine attaches a SUNNonlinearSolver object to the - time-stepping module. + Specifies the user data pointer for f ---------------------------------------------------------------*/ -int ARKodeSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) +int arkSetUserData(void* arkode_mem, void* user_data) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -289,47 +234,35 @@ int ARKodeSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } - ark_mem = (ARKodeMem)arkode_mem; + ark_mem = (ARKodeMem)arkode_mem; + ark_mem->user_data = user_data; - /* 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); - } + /* Set data for efun */ + if (ark_mem->user_efun) { ark_mem->e_data = user_data; } - /* 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); - } + /* Set data for rfun */ + if (ark_mem->user_rfun) { ark_mem->r_data = user_data; } + + /* Set data for root finding */ + if (ark_mem->root_mem != NULL) { ark_mem->root_mem->root_data = user_data; } + + /* Set data for post-processing a step */ + if (ark_mem->ProcessStep != NULL) { ark_mem->ps_data = user_data; } + + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - 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. + arkSetAdaptController: + + Specifies a non-default SUNAdaptController time step controller + object. If a NULL-valued SUNAdaptController is input, the + default will be re-enabled. ---------------------------------------------------------------*/ -int ARKodeSetLinear(void* arkode_mem, int timedepend) +int arkSetAdaptController(void* arkode_mem, SUNAdaptController C) { + int retval; + long int lenrw, leniw; ARKodeMem ark_mem; if (arkode_mem == NULL) { @@ -339,35 +272,60 @@ int ARKodeSetLinear(void* arkode_mem, int timedepend) } ark_mem = (ARKodeMem)arkode_mem; - /* Guard against use for time steppers that do not need an algebraic solver */ - if (!ark_mem->step_supports_implicit) + /* 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) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_STEPPER_UNSUPPORTED); + 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; - /* Call stepper routine (if provided) */ - if (ark_mem->step_setlinear) + /* On NULL-valued input, create default SUNAdaptController object */ + if (C == NULL) { - return (ark_mem->step_setlinear(arkode_mem, timedepend)); + 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 + else { ark_mem->hadapt_mem->owncontroller = SUNFALSE; } + + /* Attach new SUNAdaptController object */ + retval = SUNAdaptController_Space(C, &lenrw, &leniw); + if (retval == SUN_SUCCESS) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, - "time-stepping module does not support this function"); - return (ARK_STEPPER_UNSUPPORTED); + ark_mem->liw += leniw; + ark_mem->lrw += lenrw; } + ark_mem->hadapt_mem->hcontroller = C; + + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetNonlinear: + arkSetMaxNumSteps: - Specifies that the implicit portion of the problem is nonlinear. - Used to undo a previous call to ARKodeSetLinear. + Specifies the maximum number of integration steps ---------------------------------------------------------------*/ -int ARKodeSetNonlinear(void* arkode_mem) +int arkSetMaxNumSteps(void* arkode_mem, long int mxsteps) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -378,71 +336,45 @@ int ARKodeSetNonlinear(void* arkode_mem) } 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); - } + /* Passing mxsteps=0 sets the default. Passing mxsteps<0 disables the test. */ + if (mxsteps == 0) { ark_mem->mxstep = MXSTEP_DEFAULT; } + else { ark_mem->mxstep = mxsteps; } - /* 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); - } + return (ARK_SUCCESS); } -int ARKodeSetAutonomous(void* arkode_mem, sunbooleantype autonomous) +/*--------------------------------------------------------------- + arkSetMaxHnilWarns: + + Specifies the maximum number of warnings for small h + ---------------------------------------------------------------*/ +int arkSetMaxHnilWarns(void* arkode_mem, int mxhnil) { ARKodeMem ark_mem; if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, MSG_ARK_NO_MEM); - return ARK_MEM_NULL; + 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; - } + /* Passing mxhnil=0 sets the default, otherwise use input. */ + if (mxhnil == 0) { ark_mem->mxhnil = 10; } + else { ark_mem->mxhnil = mxhnil; } - /* 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; - } + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetNlsRhsFn: + arkSetInitStep: - This routine sets an alternative user-supplied implicit ODE - right-hand side function to use in the evaluation of nonlinear - system functions. + Specifies the initial step size ---------------------------------------------------------------*/ -int ARKodeSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) +int arkSetInitStep(void* arkode_mem, sunrealtype hin) { ARKodeMem ark_mem; + int retval; if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, @@ -451,41 +383,26 @@ int ARKodeSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) } 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); - } + /* Passing hin=0 sets the default, otherwise use input. */ + if (hin == ZERO) { ark_mem->hin = ZERO; } + else { ark_mem->hin = hin; } - /* 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); - } + /* Clear previous initial step */ + 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); } + + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetDeduceImplicitRhs: + arkSetMinStep: - 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. + Specifies the minimum step size ---------------------------------------------------------------*/ -int ARKodeSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) +int arkSetMinStep(void* arkode_mem, sunrealtype hmin) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -496,37 +413,35 @@ int ARKodeSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) } ark_mem = (ARKodeMem)arkode_mem; - /* Guard against use for time steppers that do not need an algebraic solver */ - if (!ark_mem->step_supports_implicit) + /* Passing a value <= 0 sets hmin = 0 */ + if (hmin <= ZERO) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_STEPPER_UNSUPPORTED); + ark_mem->hmin = ZERO; + return (ARK_SUCCESS); } - /* Call stepper routine (if provided) */ - if (ark_mem->step_setdeduceimplicitrhs) - { - return (ark_mem->step_setdeduceimplicitrhs(arkode_mem, deduce)); - } - else + /* check that hmin and hmax are agreeable */ + if (hmin * ark_mem->hmax_inv > ONE) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, - "time-stepping module does not support this function"); - return (ARK_STEPPER_UNSUPPORTED); + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_BAD_HMIN_HMAX); + return (ARK_ILL_INPUT); } + + /* set the value */ + ark_mem->hmin = hmin; + + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetNonlinCRDown: + arkSetMaxStep: - Specifies the user-provided nonlinear convergence constant - crdown. Legal values are strictly positive; illegal values - imply a reset to the default. + Specifies the maximum step size ---------------------------------------------------------------*/ -int ARKodeSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) +int arkSetMaxStep(void* arkode_mem, sunrealtype hmax) { + sunrealtype hmax_inv; ARKodeMem ark_mem; if (arkode_mem == NULL) { @@ -536,36 +451,34 @@ int ARKodeSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) } ark_mem = (ARKodeMem)arkode_mem; - /* Guard against use for time steppers that do not need an algebraic solver */ - if (!ark_mem->step_supports_implicit) + /* Passing a value <= 0 sets hmax = infinity */ + if (hmax <= ZERO) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_STEPPER_UNSUPPORTED); + ark_mem->hmax_inv = ZERO; + return (ARK_SUCCESS); } - /* Call stepper routine (if provided) */ - if (ark_mem->step_setnonlincrdown) - { - return (ark_mem->step_setnonlincrdown(arkode_mem, crdown)); - } - else + /* check that hmax and hmin are agreeable */ + hmax_inv = ONE / hmax; + if (hmax_inv * ark_mem->hmin > ONE) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, - "time-stepping module does not support this function"); - return (ARK_STEPPER_UNSUPPORTED); + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_BAD_HMIN_HMAX); + return (ARK_ILL_INPUT); } + + /* set the value */ + ark_mem->hmax_inv = hmax_inv; + + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetNonlinRDiv: + arkSetStopTime: - Specifies the user-provided nonlinear convergence constant - rdiv. Legal values are strictly positive; illegal values - imply a reset to the default. + Specifies the time beyond which the integration is not to proceed. ---------------------------------------------------------------*/ -int ARKodeSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) +int arkSetStopTime(void* arkode_mem, sunrealtype tstop) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -576,36 +489,33 @@ int ARKodeSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) } ark_mem = (ARKodeMem)arkode_mem; - /* Guard against use for time steppers that do not need an algebraic solver */ - if (!ark_mem->step_supports_implicit) + /* 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, + tstop will be checked in ARKODE. */ + if (ark_mem->nst > 0) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_STEPPER_UNSUPPORTED); + if ((tstop - ark_mem->tcur) * ark_mem->h < ZERO) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_BAD_TSTOP, tstop, ark_mem->tcur); + return (ARK_ILL_INPUT); + } } - /* 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); - } + ark_mem->tstop = tstop; + ark_mem->tstopset = SUNTRUE; + + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetDeltaGammaMax: + arkSetInterpolateStopTime: - Specifies the user-provided linear setup decision constant - dgmax. Legal values are strictly positive; illegal values imply - a reset to the default. + Specifies to use interpolation to fill the solution output at + the stop time (instead of a copy). ---------------------------------------------------------------*/ -int ARKodeSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) +int arkSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -614,39 +524,17 @@ int ARKodeSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) 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); - } + ark_mem = (ARKodeMem)arkode_mem; + ark_mem->tstopinterp = interp; + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetLSetupFrequency: + arkClearStopTime: - 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. + Disable the stop time. ---------------------------------------------------------------*/ -int ARKodeSetLSetupFrequency(void* arkode_mem, int msbp) +int arkClearStopTime(void* arkode_mem) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -657,35 +545,28 @@ int ARKodeSetLSetupFrequency(void* arkode_mem, int msbp) } 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); - } + ark_mem->tstopset = SUNFALSE; - /* 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); - } + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetPredictorMethod: + arkSetFixedStep: + + Specifies to use a fixed time step size instead of performing + any form of temporal adaptivity. ARKODE will use this step size + for all steps (unless tstop is set, in which case it may need to + modify that last step approaching tstop. If any solver failure + occurs in the timestepping module, ARKODE will typically + immediately return with an error message indicating that the + selected step size cannot be used. - Specifies the method to use for predicting implicit solutions. + Any nonzero argument will result in the use of that fixed step + size; an argument of 0 will re-enable temporal adaptivity. ---------------------------------------------------------------*/ -int ARKodeSetPredictorMethod(void* arkode_mem, int pred_method) +int arkSetFixedStep(void* arkode_mem, sunrealtype hfixed) { + int retval; ARKodeMem ark_mem; if (arkode_mem == NULL) { @@ -695,46 +576,46 @@ int ARKodeSetPredictorMethod(void* arkode_mem, int pred_method) } ark_mem = (ARKodeMem)arkode_mem; - /* Guard against use for time steppers that do not need an algebraic solver */ - if (!ark_mem->step_supports_implicit) + /* re-attach internal error weight functions if necessary */ + if ((hfixed == ZERO) && (!ark_mem->user_efun)) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_STEPPER_UNSUPPORTED); + if (ark_mem->itol == ARK_SV && ark_mem->Vabstol != NULL) + { + retval = arkSVtolerances(ark_mem, ark_mem->reltol, ark_mem->Vabstol); + } + else + { + retval = arkSStolerances(ark_mem, ark_mem->reltol, ark_mem->Sabstol); + } + if (retval != ARK_SUCCESS) { return (retval); } } - /* Higher-order predictors require interpolation */ - if (ark_mem->interp_type == ARK_INTERP_NONE && pred_method != 0) + /* set ark_mem "fixedstep" entry */ + if (hfixed != ZERO) { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Non-trival predictors require an interpolation module"); - return ARK_ILL_INPUT; + ark_mem->fixedstep = SUNTRUE; + ark_mem->hin = hfixed; } + else { ark_mem->fixedstep = SUNFALSE; } - /* 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); - } + /* Notify ARKODE to use hfixed as the initial step size, and return */ + retval = arkSetInitStep(arkode_mem, hfixed); + + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetMaxNonlinIters: + arkSetRootDirection: - Specifies the maximum number of nonlinear iterations during - one solve. A non-positive input implies a reset to the - default value. + Specifies the direction of zero-crossings to be monitored. + The default is to monitor both crossings. ---------------------------------------------------------------*/ -int ARKodeSetMaxNonlinIters(void* arkode_mem, int maxcor) +int arkSetRootDirection(void* arkode_mem, int* rootdir) { ARKodeMem ark_mem; + ARKodeRootMem ark_root_mem; + int i; + if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, @@ -742,38 +623,37 @@ int ARKodeSetMaxNonlinIters(void* arkode_mem, int maxcor) 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) + if (ark_mem->root_mem == NULL) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_STEPPER_UNSUPPORTED); + 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; - /* Call stepper routine (if provided) */ - if (ark_mem->step_setmaxnonliniters) + if (ark_root_mem->nrtfn == 0) { - return (ark_mem->step_setmaxnonliniters(arkode_mem, maxcor)); + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NO_ROOT); + return (ARK_ILL_INPUT); } - else + for (i = 0; i < ark_root_mem->nrtfn; i++) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, - "time-stepping module does not support this function"); - return (ARK_STEPPER_UNSUPPORTED); + ark_root_mem->rootdir[i] = rootdir[i]; } + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetNonlinConvCoef: + arkSetNoInactiveRootWarn: - Specifies the coefficient in the nonlinear solver convergence - test. A non-positive input implies a reset to the default value. + Disables issuing a warning if some root function appears + to be identically zero at the beginning of the integration ---------------------------------------------------------------*/ -int ARKodeSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) +int arkSetNoInactiveRootWarn(void* arkode_mem) { ARKodeMem ark_mem; + ARKodeRootMem ark_root_mem; if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, @@ -781,35 +661,29 @@ int ARKodeSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) 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 + if (ark_mem->root_mem == NULL) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, - "time-stepping module does not support this function"); - return (ARK_STEPPER_UNSUPPORTED); + 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; + ark_root_mem->mxgnull = 0; + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetStagePredictFn: Specifies a user-provided step - predictor function having type ARKStagePredictFn. A - NULL input function disables calls to this routine. + arkSetPostprocessStepFn: + + Specifies a user-provided step postprocessing function having + type ARKPostProcessFn. A NULL input function disables step + postprocessing. + + IF THE SUPPLIED FUNCTION MODIFIES ANY OF THE ACTIVE STATE DATA, + THEN ALL THEORETICAL GUARANTEES OF SOLUTION ACCURACY AND + STABILITY ARE LOST. ---------------------------------------------------------------*/ -int ARKodeSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) +int arkSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -820,34 +694,32 @@ int ARKodeSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) } 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); - } + /* NULL argument sets default, otherwise set inputs */ + ark_mem->ProcessStep = ProcessStep; + ark_mem->ps_data = ark_mem->user_data; - /* 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); - } + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetUserData: + arkSetPostprocessStageFn: - Specifies the user data pointer for f + Specifies a user-provided stage postprocessing function having + type ARKPostProcessFn. A NULL input function disables + stage postprocessing. + + IF THE SUPPLIED FUNCTION MODIFIES ANY OF THE ACTIVE STATE DATA, + THEN ALL THEORETICAL GUARANTEES OF SOLUTION ACCURACY AND + STABILITY ARE LOST. + + While it is possible to perform postprocessing when + ARKStepSetDeduceImplicitRhs 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 + postprocessing constraints are enforced. ---------------------------------------------------------------*/ -int ARKodeSetUserData(void* arkode_mem, void* user_data) +int arkSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -856,41 +728,22 @@ int ARKodeSetUserData(void* arkode_mem, void* user_data) MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } - ark_mem = (ARKodeMem)arkode_mem; - ark_mem->user_data = user_data; - - /* Set data for efun */ - if (ark_mem->user_efun) { ark_mem->e_data = user_data; } - - /* Set data for rfun */ - if (ark_mem->user_rfun) { ark_mem->r_data = user_data; } - - /* Set data for root finding */ - if (ark_mem->root_mem != NULL) { ark_mem->root_mem->root_data = user_data; } - - /* Set data for post-processing a step */ - if (ark_mem->ProcessStep != NULL) { ark_mem->ps_data = user_data; } + ark_mem = (ARKodeMem)arkode_mem; - /* Set user data into stepper (if provided) */ - if (ark_mem->step_setuserdata) - { - return (ark_mem->step_setuserdata(arkode_mem, user_data)); - } + /* NULL argument sets default, otherwise set inputs */ + ark_mem->ProcessStage = ProcessStage; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetAdaptController: + arkSetConstraints: - Specifies a non-default SUNAdaptController time step controller - object. If a NULL-valued SUNAdaptController is input, the - default will be re-enabled. + Activates or Deactivates inequality constraint checking. ---------------------------------------------------------------*/ -int ARKodeSetAdaptController(void* arkode_mem, SUNAdaptController C) +int arkSetConstraints(void* arkode_mem, N_Vector constraints) { - int retval; - long int lenrw, leniw; + sunrealtype temptest; ARKodeMem ark_mem; if (arkode_mem == NULL) { @@ -900,68 +753,54 @@ int ARKodeSetAdaptController(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) + /* If there are no constraints, destroy data structures */ + if (constraints == NULL) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_STEPPER_UNSUPPORTED); + arkFreeVec(ark_mem, &ark_mem->constraints); + ark_mem->constraintsSet = SUNFALSE; + return (ARK_SUCCESS); } - /* 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) + /* Test if required vector ops. are defined */ + if (constraints->ops->nvdiv == NULL || constraints->ops->nvmaxnorm == NULL || + constraints->ops->nvcompare == NULL || + constraints->ops->nvconstrmask == NULL || + constraints->ops->nvminquotient == NULL) { - 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); - } + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_BAD_NVECTOR); + return (ARK_ILL_INPUT); } - ark_mem->hadapt_mem->hcontroller = NULL; - /* On NULL-valued input, create default SUNAdaptController object */ - if (C == NULL) + /* Check the constraints vector */ + temptest = N_VMaxNorm(constraints); + if ((temptest > SUN_RCONST(2.5)) || (temptest < HALF)) { - 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; + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_BAD_CONSTR); + return (ARK_ILL_INPUT); } - else { ark_mem->hadapt_mem->owncontroller = SUNFALSE; } - /* Attach new SUNAdaptController object */ - retval = SUNAdaptController_Space(C, &lenrw, &leniw); - if (retval == SUN_SUCCESS) + /* Allocate the internal constrains vector (if necessary) */ + if (!arkAllocVec(ark_mem, constraints, &ark_mem->constraints)) { - ark_mem->liw += leniw; - ark_mem->lrw += lenrw; + return (ARK_MEM_FAIL); } - ark_mem->hadapt_mem->hcontroller = C; + + /* Load the constraints vector */ + N_VScale(ONE, constraints, ark_mem->constraints); + ark_mem->constraintsSet = SUNTRUE; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetMaxNumSteps: + arkSetMaxNumConstrFails: - Specifies the maximum number of integration steps + Set max number of allowed constraint failures in a step before + returning an error ---------------------------------------------------------------*/ -int ARKodeSetMaxNumSteps(void* arkode_mem, long int mxsteps) +int arkSetMaxNumConstrFails(void* arkode_mem, int maxfails) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -972,21 +811,32 @@ int ARKodeSetMaxNumSteps(void* arkode_mem, long int mxsteps) } ark_mem = (ARKodeMem)arkode_mem; - /* Passing mxsteps=0 sets the default. Passing mxsteps<0 disables the test. */ - if (mxsteps == 0) { ark_mem->mxstep = MXSTEP_DEFAULT; } - else { ark_mem->mxstep = mxsteps; } + /* Passing maxfails = 0 sets the default, otherwise set to input */ + if (maxfails <= 0) { ark_mem->maxconstrfails = MAXCONSTRFAILS; } + else { ark_mem->maxconstrfails = maxfails; } return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetMaxHnilWarns: + arkSetAdaptivityMethod: ***DEPRECATED*** - Specifies the maximum number of warnings for small h + 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 ARKodeSetMaxHnilWarns(void* arkode_mem, int mxhnil) +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__, @@ -995,68 +845,207 @@ int ARKodeSetMaxHnilWarns(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) + /* Check for illegal inputs */ + if ((idefault != 1) && (adapt_params == NULL)) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_STEPPER_UNSUPPORTED); + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "NULL-valued adapt_params provided"); + return (ARK_ILL_INPUT); } - /* Passing mxhnil=0 sets the default, otherwise use input. */ - if (mxhnil == 0) { ark_mem->mxhnil = 10; } - else { ark_mem->mxhnil = mxhnil; } - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - ARKodeSetInitStep: - - Specifies the initial step size - ---------------------------------------------------------------*/ -int ARKodeSetInitStep(void* arkode_mem, sunrealtype hin) -{ - ARKodeMem ark_mem; - int retval; - if (arkode_mem == NULL) + /* 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) { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); + ark_mem->liw -= leniw; + ark_mem->lrw -= lenrw; } - ark_mem = (ARKodeMem)arkode_mem; + 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; - /* Guard against hin==0 for non-adaptive time stepper modules */ - if ((!ark_mem->step_supports_adaptive) && (hin == ZERO)) + /* set adaptivity parameters from inputs */ + k1 = k2 = k3 = ZERO; + if (idefault != 1) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_STEPPER_UNSUPPORTED); + k1 = adapt_params[0]; + k2 = adapt_params[1]; + k3 = adapt_params[2]; } + ark_mem->hadapt_mem->pq = pq; - /* Passing hin=0 sets the default, otherwise use input. */ - if (hin == ZERO) { ark_mem->hin = ZERO; } - else { ark_mem->hin = hin; } - - /* Clear previous initial step */ - ark_mem->h0u = ZERO; + /* 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); + } - /* 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); } + /* 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); } /*--------------------------------------------------------------- - ARKodeSetMinStep: + arkSetAdaptivityFn: ***DEPRECATED*** - Specifies the minimum step size + 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 ARKodeSetMinStep(void* arkode_mem, sunrealtype hmin) +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__, @@ -1065,426 +1054,383 @@ int ARKodeSetMinStep(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) + /* 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) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_STEPPER_UNSUPPORTED); + ark_mem->liw -= leniw; + ark_mem->lrw -= lenrw; } - - /* Passing a value <= 0 sets hmin = 0 */ - if (hmin <= ZERO) + if (ark_mem->hadapt_mem->owncontroller) { - ark_mem->hmin = ZERO; - return (ARK_SUCCESS); + 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; - /* check that hmin and hmax are agreeable */ - if (hmin * ark_mem->hmax_inv > ONE) + /* Create new SUNAdaptController object depending on NULL-ity of 'hfun' */ + C = NULL; + if (hfun == NULL) { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_BAD_HMIN_HMAX); - return (ARK_ILL_INPUT); + 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); + } } - /* set the value */ - ark_mem->hmin = hmin; + /* 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); } /*--------------------------------------------------------------- - ARKodeSetMaxStep: + arkSetCFLFraction: - Specifies the maximum step size + 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 ARKodeSetMaxStep(void* arkode_mem, sunrealtype hmax) +int arkSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) { - sunrealtype hmax_inv; + int retval; + ARKodeHAdaptMem hadapt_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); - } - - /* Passing a value <= 0 sets hmax = infinity */ - if (hmax <= ZERO) - { - ark_mem->hmax_inv = ZERO; - return (ARK_SUCCESS); - } + retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); + if (retval != ARK_SUCCESS) { return (retval); } - /* check that hmax and hmin are agreeable */ - hmax_inv = ONE / hmax; - if (hmax_inv * ark_mem->hmin > ONE) + /* check for allowable parameters */ + if (cfl_frac >= ONE) { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_BAD_HMIN_HMAX); + "Illegal CFL fraction"); return (ARK_ILL_INPUT); } - /* set the value */ - ark_mem->hmax_inv = hmax_inv; + /* set positive-valued parameters, otherwise set default */ + if (cfl_frac <= ZERO) { hadapt_mem->cfl = CFLFAC; } + else { hadapt_mem->cfl = cfl_frac; } return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetStopTime: + arkSetAdaptivityAdjustment: - Specifies the time beyond which the integration is not to proceed. + Adjusts the method order supplied to the temporal adaptivity + controller. For example, if the user expects order reduction + due to problem stiffness, they may request that the controller + assume a reduced order of accuracy for the method by specifying + a value adjust < 0. ---------------------------------------------------------------*/ -int ARKodeSetStopTime(void* arkode_mem, sunrealtype tstop) +int arkSetAdaptivityAdjustment(void* arkode_mem, int adjust) { + int retval; + ARKodeHAdaptMem hadapt_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; + retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); + if (retval != ARK_SUCCESS) { return (retval); } - /* If ARKODE was called at least once, test if tstop is legal - (i.e. if it was not already passed). - If ARKodeSetStopTime is called before the first call to ARKODE, - tstop will be checked in ARKODE. */ - if (ark_mem->nst > 0) + /* store requested adjustment */ + hadapt_mem->adjust = adjust; + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + arkSetSafetyFactor: + + 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 retval; + ARKodeHAdaptMem hadapt_mem; + ARKodeMem ark_mem; + retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* check for allowable parameters */ + if (safety >= ONE) { - if ((tstop - ark_mem->tcur) * ark_mem->h < ZERO) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_BAD_TSTOP, tstop, ark_mem->tcur); - return (ARK_ILL_INPUT); - } + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Illegal safety factor"); + return (ARK_ILL_INPUT); } - ark_mem->tstop = tstop; - ark_mem->tstopset = SUNTRUE; + /* set positive-valued parameters, otherwise set default */ + if (safety <= ZERO) { hadapt_mem->safety = SAFETY; } + else { hadapt_mem->safety = safety; } return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetInterpolateStopTime: + arkSetErrorBias: - Specifies to use interpolation to fill the solution output at - the stop time (instead of a copy). + 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 ARKodeSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) +int arkSetErrorBias(void* arkode_mem, sunrealtype bias) { + int retval; + ARKodeHAdaptMem hadapt_mem; ARKodeMem ark_mem; - if (arkode_mem == NULL) + retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* set allowed value, otherwise set default */ + if (bias < ONE) { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); + retval = SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, -1.0); + } + else + { + retval = SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, bias); + } + if (retval != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, __FILE__, + "SUNAdaptController_SetErrorBias failure"); + return (ARK_CONTROLLER_ERR); } - ark_mem = (ARKodeMem)arkode_mem; - ark_mem->tstopinterp = interp; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeClearStopTime: + arkSetMaxGrowth: - Disable the stop time. + 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 ARKodeClearStopTime(void* arkode_mem) +int arkSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) { + int retval; + ARKodeHAdaptMem hadapt_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; + retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); + if (retval != ARK_SUCCESS) { return (retval); } - ark_mem->tstopset = SUNFALSE; + /* set allowed value, otherwise set default */ + if (mx_growth <= ONE) { hadapt_mem->growth = GROWTH; } + else { hadapt_mem->growth = mx_growth; } return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetFixedStep: - - Specifies to use a fixed time step size instead of performing - any form of temporal adaptivity. ARKODE will use this step size - for all steps (unless tstop is set, in which case it may need to - modify that last step approaching tstop. If any solver failure - occurs in the timestepping module, ARKODE will typically - immediately return with an error message indicating that the - selected step size cannot be used. + arkSetMinReduction: - Any nonzero argument will result in the use of that fixed step - size; an argument of 0 will re-enable temporal adaptivity. + 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 ARKodeSetFixedStep(void* arkode_mem, sunrealtype hfixed) +int arkSetMinReduction(void* arkode_mem, sunrealtype eta_min) { int retval; + ARKodeHAdaptMem hadapt_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; - - /* 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 = 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); } - } - - /* set ark_mem "fixedstep" entry */ - if (hfixed != ZERO) - { - ark_mem->fixedstep = SUNTRUE; - ark_mem->hin = hfixed; - } - else { ark_mem->fixedstep = SUNFALSE; } + retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); + if (retval != ARK_SUCCESS) { return (retval); } - /* Notify ARKODE to use hfixed as the initial step size, and return */ - retval = ARKodeSetInitStep(arkode_mem, hfixed); + /* set allowed value, otherwise set default */ + if (eta_min >= ONE || eta_min <= ZERO) { hadapt_mem->etamin = ETAMIN; } + else { hadapt_mem->etamin = eta_min; } return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetRootDirection: + arkSetFixedStepBounds: - Specifies the direction of zero-crossings to be monitored. - The default is to monitor both crossings. + 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 ARKodeSetRootDirection(void* arkode_mem, int* rootdir) +int arkSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) { + int retval; + ARKodeHAdaptMem hadapt_mem; ARKodeMem ark_mem; - ARKodeRootMem ark_root_mem; - int i; + retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); + if (retval != ARK_SUCCESS) { return (retval); } - if (arkode_mem == NULL) + /* set allowable interval, otherwise set defaults */ + if ((lb <= ONE) && (ub >= ONE)) { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); + hadapt_mem->lbound = lb; + hadapt_mem->ubound = ub; } - ark_mem = (ARKodeMem)arkode_mem; - if (ark_mem->root_mem == NULL) + else { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); + hadapt_mem->lbound = HFIXED_LB; + hadapt_mem->ubound = HFIXED_UB; } - ark_root_mem = (ARKodeRootMem)ark_mem->root_mem; - if (ark_root_mem->nrtfn == 0) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_NO_ROOT); - return (ARK_ILL_INPUT); - } - for (i = 0; i < ark_root_mem->nrtfn; i++) - { - ark_root_mem->rootdir[i] = rootdir[i]; - } return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetNoInactiveRootWarn: + arkSetMaxFirstGrowth: - Disables issuing a warning if some root function appears - to be identically zero at the beginning of the integration + 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 ARKodeSetNoInactiveRootWarn(void* arkode_mem) +int arkSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) { + int retval; + ARKodeHAdaptMem hadapt_mem; 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; - ark_root_mem->mxgnull = 0; + retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* if argument legal set it, otherwise set default */ + if (etamx1 <= ONE) { hadapt_mem->etamx1 = ETAMX1; } + else { hadapt_mem->etamx1 = etamx1; } + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetPostprocessStepFn: - - Specifies a user-provided step postprocessing function having - type ARKPostProcessFn. A NULL input function disables step - postprocessing. + arkSetMaxEFailGrowth: - IF THE SUPPLIED FUNCTION MODIFIES ANY OF THE ACTIVE STATE DATA, - THEN ALL THEORETICAL GUARANTEES OF SOLUTION ACCURACY AND - STABILITY ARE LOST. + 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 ARKodeSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) +int arkSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) { + int retval; + ARKodeHAdaptMem hadapt_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; + retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); + if (retval != ARK_SUCCESS) { return (retval); } - /* NULL argument sets default, otherwise set inputs */ - ark_mem->ProcessStep = ProcessStep; - ark_mem->ps_data = ark_mem->user_data; + /* if argument legal set it, otherwise set default */ + if ((etamxf <= ZERO) || (etamxf > ONE)) { hadapt_mem->etamxf = ETAMXF; } + else { hadapt_mem->etamxf = etamxf; } return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetPostprocessStageFn: - - Specifies a user-provided stage postprocessing function having - type ARKPostProcessFn. A NULL input function disables - stage postprocessing. + arkSetSmallNumEFails: - IF THE SUPPLIED FUNCTION MODIFIES ANY OF THE ACTIVE STATE DATA, - THEN ALL THEORETICAL GUARANTEES OF SOLUTION ACCURACY AND - STABILITY ARE LOST. - - While it is possible to perform postprocessing when - ARKodeSetDeduceImplicitRhs is enabled, this can cause implicit - RHS evaluations to be inconsistent with the postprocessed stage - values. It is strongly recommended to disable - ARKodeSetDeduceImplicitRhs in order to guarantee - postprocessing constraints are enforced. + Specifies the user-provided time step adaptivity constant + small_nef. Legal values are > 0. Illegal values + imply a reset to the default value. ---------------------------------------------------------------*/ -int ARKodeSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) +int arkSetSmallNumEFails(void* arkode_mem, int small_nef) { + int retval; + ARKodeHAdaptMem hadapt_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; + retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); + if (retval != ARK_SUCCESS) { return (retval); } - /* NULL argument sets default, otherwise set inputs */ - ark_mem->ProcessStage = ProcessStage; + /* 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; } return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetConstraints: + arkSetMaxCFailGrowth: - Activates or Deactivates inequality constraint checking. + 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 ARKodeSetConstraints(void* arkode_mem, N_Vector constraints) +int arkSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) { - sunrealtype temptest; + int retval; + ARKodeHAdaptMem hadapt_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; + 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 && (constraints != NULL)) - { - 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; } - /* If there are no constraints, destroy data structures */ - if (constraints == NULL) - { - arkFreeVec(ark_mem, &ark_mem->constraints); - ark_mem->constraintsSet = SUNFALSE; - return (ARK_SUCCESS); - } + return (ARK_SUCCESS); +} - /* Test if required vector ops. are defined */ - if (constraints->ops->nvdiv == NULL || constraints->ops->nvmaxnorm == NULL || - constraints->ops->nvcompare == NULL || - constraints->ops->nvconstrmask == NULL || - constraints->ops->nvminquotient == NULL) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_BAD_NVECTOR); - return (ARK_ILL_INPUT); - } +/*--------------------------------------------------------------- + arkSetStabilityFn: - /* Check the constraints vector */ - temptest = N_VMaxNorm(constraints); - if ((temptest > SUN_RCONST(2.5)) || (temptest < HALF)) + 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 retval; + ARKodeHAdaptMem hadapt_mem; + ARKodeMem ark_mem; + retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* NULL argument sets default, otherwise set inputs */ + if (EStab == NULL) { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_BAD_CONSTR); - return (ARK_ILL_INPUT); + hadapt_mem->expstab = arkExpStab; + hadapt_mem->estab_data = ark_mem; } - - /* Allocate the internal constrains vector (if necessary) */ - if (!arkAllocVec(ark_mem, constraints, &ark_mem->constraints)) + else { - return (ARK_MEM_FAIL); + hadapt_mem->expstab = EStab; + hadapt_mem->estab_data = estab_data; } - /* Load the constraints vector */ - N_VScale(ONE, constraints, ark_mem->constraints); - ark_mem->constraintsSet = SUNTRUE; - return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetMaxNumConstrFails: + arkSetMaxErrTestFails: - Set max number of allowed constraint failures in a step before - returning an error + Specifies the maximum number of error test failures during one + step try. A non-positive input implies a reset to + the default value. ---------------------------------------------------------------*/ -int ARKodeSetMaxNumConstrFails(void* arkode_mem, int maxfails) +int arkSetMaxErrTestFails(void* arkode_mem, int maxnef) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1495,436 +1441,270 @@ int ARKodeSetMaxNumConstrFails(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; } - + /* argument <= 0 sets default, otherwise set input */ + if (maxnef <= 0) { ark_mem->maxnef = MAXNEF; } + else { ark_mem->maxnef = maxnef; } return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetCFLFraction: + arkSetMaxConvFails: - 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 + Specifies the maximum number of nonlinear convergence failures + during one step try. A non-positive input implies a reset to the default value. ---------------------------------------------------------------*/ -int ARKodeSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) +int arkSetMaxConvFails(void* arkode_mem, int maxncf) { - int retval; - ARKodeHAdaptMem hadapt_mem; ARKodeMem ark_mem; - 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) + if (arkode_mem == NULL) { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Illegal CFL fraction"); - return (ARK_ILL_INPUT); + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; - /* set positive-valued parameters, otherwise set default */ - if (cfl_frac <= ZERO) { hadapt_mem->cfl = CFLFAC; } - else { hadapt_mem->cfl = cfl_frac; } - + /* argument <= 0 sets default, otherwise set input */ + if (maxncf <= 0) { ark_mem->maxncf = MAXNCF; } + else { ark_mem->maxncf = maxncf; } return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetAdaptivityAdjustment: + arkSetUseCompensatedSums: - Adjusts the method order supplied to the temporal adaptivity - controller. For example, if the user expects order reduction - due to problem stiffness, they may request that the controller - assume a reduced order of accuracy for the method by specifying - a value adjust < 0. + Specifies that ARKODE should use compensated (Kahan) summation + where relevant to mitigate roundoff error. ---------------------------------------------------------------*/ -int ARKodeSetAdaptivityAdjustment(void* arkode_mem, int adjust) +int arkSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff) { - int retval; - ARKodeHAdaptMem hadapt_mem; ARKodeMem ark_mem; - 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) + if (arkode_mem == NULL) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_STEPPER_UNSUPPORTED); + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; + + if (onoff) { ark_mem->use_compensated_sums = SUNTRUE; } + else { ark_mem->use_compensated_sums = SUNFALSE; } - /* store requested adjustment */ - hadapt_mem->adjust = adjust; return (ARK_SUCCESS); } +/*=============================================================== + ARKODE optional output utility functions + ===============================================================*/ + /*--------------------------------------------------------------- - ARKodeSetSafetyFactor: + arkGetNumStepAttempts: - 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. + Returns the current number of steps attempted by the solver ---------------------------------------------------------------*/ -int ARKodeSetSafetyFactor(void* arkode_mem, sunrealtype safety) +int arkGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) { - int retval; - ARKodeHAdaptMem hadapt_mem; ARKodeMem ark_mem; - 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) + if (arkode_mem == NULL) { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Illegal safety factor"); - return (ARK_ILL_INPUT); + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; - /* set positive-valued parameters, otherwise set default */ - if (safety <= ZERO) { hadapt_mem->safety = SAFETY; } - else { hadapt_mem->safety = safety; } - + *nstep_attempts = ark_mem->nst_attempts; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetErrorBias: + arkGetNumSteps: - 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. + Returns the current number of integration steps ---------------------------------------------------------------*/ -int ARKodeSetErrorBias(void* arkode_mem, sunrealtype bias) +int arkGetNumSteps(void* arkode_mem, long int* nsteps) { - int retval; - ARKodeHAdaptMem hadapt_mem; ARKodeMem ark_mem; - 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) + if (arkode_mem == NULL) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_STEPPER_UNSUPPORTED); + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; - /* set allowed value, otherwise set default */ - if (bias < ONE) - { - retval = SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, -ONE); - } - else - { - retval = SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, bias); - } - if (retval != SUN_SUCCESS) - { - arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, __FILE__, - "SUNAdaptController_SetErrorBias failure"); - return (ARK_CONTROLLER_ERR); - } + *nsteps = ark_mem->nst; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetMaxGrowth: + arkGetActualInitStep: - 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. + Returns the step size used on the first step ---------------------------------------------------------------*/ -int ARKodeSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) +int arkGetActualInitStep(void* arkode_mem, sunrealtype* hinused) { - int retval; - ARKodeHAdaptMem hadapt_mem; ARKodeMem ark_mem; - 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) + if (arkode_mem == NULL) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_STEPPER_UNSUPPORTED); + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; - /* set allowed value, otherwise set default */ - if (mx_growth <= ONE) { hadapt_mem->growth = GROWTH; } - else { hadapt_mem->growth = mx_growth; } - + *hinused = ark_mem->h0u; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetMinReduction: + arkGetLastStep: - 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. + Returns the step size used on the last successful step ---------------------------------------------------------------*/ -int ARKodeSetMinReduction(void* arkode_mem, sunrealtype eta_min) +int arkGetLastStep(void* arkode_mem, sunrealtype* hlast) { - int retval; - ARKodeHAdaptMem hadapt_mem; ARKodeMem ark_mem; - 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) + if (arkode_mem == NULL) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_STEPPER_UNSUPPORTED); + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; - /* set allowed value, otherwise set default */ - if (eta_min >= ONE || eta_min <= ZERO) { hadapt_mem->etamin = ETAMIN; } - else { hadapt_mem->etamin = eta_min; } - + *hlast = ark_mem->hold; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetFixedStepBounds: + arkGetCurrentStep: - 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. + Returns the step size to be attempted on the next step ---------------------------------------------------------------*/ -int ARKodeSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) +int arkGetCurrentStep(void* arkode_mem, sunrealtype* hcur) { - int retval; - ARKodeHAdaptMem hadapt_mem; ARKodeMem ark_mem; - 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)) - { - hadapt_mem->lbound = lb; - hadapt_mem->ubound = ub; - } - else + if (arkode_mem == NULL) { - hadapt_mem->lbound = HFIXED_LB; - hadapt_mem->ubound = HFIXED_UB; + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; + *hcur = ark_mem->next_h; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetMaxFirstGrowth: + arkGetCurrentState: - 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. + Returns the current solution (before or after as step) or + stage value (during step solve). ---------------------------------------------------------------*/ -int ARKodeSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) +int arkGetCurrentState(void* arkode_mem, N_Vector* state) { - int retval; - ARKodeHAdaptMem hadapt_mem; ARKodeMem ark_mem; - 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) + if (arkode_mem == NULL) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_STEPPER_UNSUPPORTED); + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; - /* if argument legal set it, otherwise set default */ - if (etamx1 <= ONE) { hadapt_mem->etamx1 = ETAMX1; } - else { hadapt_mem->etamx1 = etamx1; } - + *state = ark_mem->ycur; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetMaxEFailGrowth: + arkGetCurrentTime: - 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. + Returns the current value of the independent variable ---------------------------------------------------------------*/ -int ARKodeSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) +int arkGetCurrentTime(void* arkode_mem, sunrealtype* tcur) { - int retval; - ARKodeHAdaptMem hadapt_mem; ARKodeMem ark_mem; - 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) + if (arkode_mem == NULL) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_STEPPER_UNSUPPORTED); + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; - /* if argument legal set it, otherwise set default */ - if ((etamxf <= ZERO) || (etamxf > ONE)) { hadapt_mem->etamxf = ETAMXF; } - else { hadapt_mem->etamxf = etamxf; } - + *tcur = ark_mem->tcur; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetSmallNumEFails: + arkGetTolScaleFactor: - Specifies the user-provided time step adaptivity constant - small_nef. Legal values are > 0. Illegal values - imply a reset to the default value. + Returns a suggested factor for scaling tolerances ---------------------------------------------------------------*/ -int ARKodeSetSmallNumEFails(void* arkode_mem, int small_nef) +int arkGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) { - int retval; - ARKodeHAdaptMem hadapt_mem; ARKodeMem ark_mem; - 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) + if (arkode_mem == NULL) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_STEPPER_UNSUPPORTED); + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; - /* 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; } - + *tolsfact = ark_mem->tolsf; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetMaxCFailGrowth: + arkGetErrWeights: - 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. + This routine returns the current error weight vector. ---------------------------------------------------------------*/ -int ARKodeSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) +int arkGetErrWeights(void* arkode_mem, N_Vector eweight) { - int retval; - ARKodeHAdaptMem hadapt_mem; ARKodeMem ark_mem; - 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) + if (arkode_mem == NULL) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_STEPPER_UNSUPPORTED); + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; - /* if argument legal set it, otherwise set default */ - if ((etacf <= ZERO) || (etacf > ONE)) { hadapt_mem->etacf = ETACF; } - else { hadapt_mem->etacf = etacf; } - + N_VScale(ONE, ark_mem->ewt, eweight); return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetStabilityFn: + arkGetResWeights: - Specifies the user-provided explicit time step stability - function to use. A NULL input function implies a reset to - the default function (empty). + This routine returns the current residual weight vector. ---------------------------------------------------------------*/ -int ARKodeSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) +int arkGetResWeights(void* arkode_mem, N_Vector rweight) { - int retval; - ARKodeHAdaptMem hadapt_mem; ARKodeMem ark_mem; - 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) - { - hadapt_mem->expstab = arkExpStab; - hadapt_mem->estab_data = ark_mem; - } - else + if (arkode_mem == NULL) { - hadapt_mem->expstab = EStab; - hadapt_mem->estab_data = estab_data; + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; + N_VScale(ONE, ark_mem->rwt, rweight); return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetMaxErrTestFails: + arkGetWorkSpace: - Specifies the maximum number of error test failures during one - step try. A non-positive input implies a reset to - the default value. + Returns integrator work space requirements ---------------------------------------------------------------*/ -int ARKodeSetMaxErrTestFails(void* arkode_mem, int maxnef) +int arkGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1935,30 +1715,20 @@ int ARKodeSetMaxErrTestFails(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; } + *leniw = ark_mem->liw; + *lenrw = ark_mem->lrw; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetMaxConvFails: + arkGetNumGEvals: - Specifies the maximum number of nonlinear convergence failures - during one step try. A non-positive input implies a reset to - the default value. + Returns the current number of calls to g (for rootfinding) ---------------------------------------------------------------*/ -int ARKodeSetMaxConvFails(void* arkode_mem, int maxncf) +int arkGetNumGEvals(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__, @@ -1966,33 +1736,27 @@ int ARKodeSetMaxConvFails(void* arkode_mem, int maxncf) 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) + if (ark_mem->root_mem == NULL) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_STEPPER_UNSUPPORTED); + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } - - /* argument <= 0 sets default, otherwise set input */ - if (maxncf <= 0) { ark_mem->maxncf = MAXNCF; } - else { ark_mem->maxncf = maxncf; } + ark_root_mem = (ARKodeRootMem)ark_mem->root_mem; + *ngevals = ark_root_mem->nge; return (ARK_SUCCESS); } -/*=============================================================== - ARKODE optional output utility functions - ===============================================================*/ - /*--------------------------------------------------------------- - ARKodeGetNumStepAttempts: + arkGetRootInfo: - Returns the current number of steps attempted by the solver + Returns pointer to array rootsfound showing roots found ---------------------------------------------------------------*/ -int ARKodeGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) +int arkGetRootInfo(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__, @@ -2000,37 +1764,27 @@ int ARKodeGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) return (ARK_MEM_NULL); } ark_mem = (ARKodeMem)arkode_mem; - - *nstep_attempts = ark_mem->nst_attempts; - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - ARKodeGetNumSteps: - - Returns the current number of integration steps - ---------------------------------------------------------------*/ -int ARKodeGetNumSteps(void* arkode_mem, long int* nsteps) -{ - ARKodeMem ark_mem; - if (arkode_mem == NULL) + if (ark_mem->root_mem == NULL) { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } - ark_mem = (ARKodeMem)arkode_mem; - - *nsteps = ark_mem->nst; + 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); } /*--------------------------------------------------------------- - ARKodeGetActualInitStep: + arkGetStepStats: - Returns the step size used on the first step + Returns step statistics ---------------------------------------------------------------*/ -int ARKodeGetActualInitStep(void* arkode_mem, sunrealtype* hinused) +int arkGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, + sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2041,16 +1795,20 @@ int ARKodeGetActualInitStep(void* arkode_mem, 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); } /*--------------------------------------------------------------- - ARKodeGetLastStep: + arkGetNumConstrFails: - Returns the step size used on the last successful step + Returns the current number of constraint fails ---------------------------------------------------------------*/ -int ARKodeGetLastStep(void* arkode_mem, sunrealtype* hlast) +int arkGetNumConstrFails(void* arkode_mem, long int* nconstrfails) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2061,16 +1819,16 @@ int ARKodeGetLastStep(void* arkode_mem, sunrealtype* hlast) } ark_mem = (ARKodeMem)arkode_mem; - *hlast = ark_mem->hold; + *nconstrfails = ark_mem->nconstrfails; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetCurrentStep: + arkGetNumExpSteps: - Returns the step size to be attempted on the next step + Returns the current number of stability-limited steps ---------------------------------------------------------------*/ -int ARKodeGetCurrentStep(void* arkode_mem, sunrealtype* hcur) +int arkGetNumExpSteps(void* arkode_mem, long int* nsteps) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2081,17 +1839,16 @@ int ARKodeGetCurrentStep(void* arkode_mem, sunrealtype* hcur) } ark_mem = (ARKodeMem)arkode_mem; - *hcur = ark_mem->next_h; + *nsteps = ark_mem->hadapt_mem->nst_exp; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetCurrentState: + arkGetNumAccSteps: - Returns the current solution (before or after as step) or - stage value (during step solve). + Returns the current number of accuracy-limited steps ---------------------------------------------------------------*/ -int ARKodeGetCurrentState(void* arkode_mem, N_Vector* state) +int arkGetNumAccSteps(void* arkode_mem, long int* nsteps) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2102,16 +1859,16 @@ int ARKodeGetCurrentState(void* arkode_mem, N_Vector* state) } ark_mem = (ARKodeMem)arkode_mem; - *state = ark_mem->ycur; + *nsteps = ark_mem->hadapt_mem->nst_acc; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetEstLocalErrors: + arkGetNumErrTestFails: - Returns an estimate of the local error + Returns the current number of error test failures ---------------------------------------------------------------*/ -int ARKodeGetEstLocalErrors(void* arkode_mem, N_Vector ele) +int arkGetNumErrTestFails(void* arkode_mem, long int* netfails) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2122,25 +1879,17 @@ int ARKodeGetEstLocalErrors(void* arkode_mem, N_Vector ele) } 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); - } + *netfails = ark_mem->netf; + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetCurrentTime: + arkGetNumStepSolveFails: - Returns the current value of the independent variable + Returns the current number of failed steps due to an algebraic + solver convergence failure. ---------------------------------------------------------------*/ -int ARKodeGetCurrentTime(void* arkode_mem, sunrealtype* tcur) +int arkGetNumStepSolveFails(void* arkode_mem, long int* nncfails) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2151,14 +1900,16 @@ int ARKodeGetCurrentTime(void* arkode_mem, sunrealtype* tcur) } ark_mem = (ARKodeMem)arkode_mem; - *tcur = ark_mem->tcur; + *nncfails = ark_mem->ncfn; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetCurrentGamma: Returns the current value of gamma + arkGetUserData: + + Returns the user data pointer ---------------------------------------------------------------*/ -int ARKodeGetCurrentGamma(void* arkode_mem, sunrealtype* gamma) +int arkGetUserData(void* arkode_mem, void** user_data) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2169,36 +1920,23 @@ int ARKodeGetCurrentGamma(void* arkode_mem, sunrealtype* gamma) } 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); - } + *user_data = ark_mem->user_data; - /* 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); - } + return (ARK_SUCCESS); } -/*--------------------------------------------------------------- - ARKodeGetTolScaleFactor: +/*----------------------------------------------------------------- + arkPrintAllStats - Returns a suggested factor for scaling tolerances + Prints the current value of all statistics ---------------------------------------------------------------*/ -int ARKodeGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) + +int arkPrintAllStats(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__, @@ -2207,106 +1945,242 @@ int ARKodeGetTolScaleFactor(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)) + switch (fmt) { - 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); -} - -/*--------------------------------------------------------------- - ARKodeGetErrWeights: - - This routine returns the current error weight vector. - ---------------------------------------------------------------*/ -int ARKodeGetErrWeights(void* arkode_mem, N_Vector eweight) -{ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_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) + { + 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); } - 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)) + /* Print relaxation stats */ + if (ark_mem->relax_enabled) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not use tolerances"); - return (ARK_STEPPER_UNSUPPORTED); + retval = arkRelaxPrintAllStats(arkode_mem, outfile, fmt); + if (retval != ARK_SUCCESS) { return (retval); } } - N_VScale(ONE, ark_mem->ewt, eweight); return (ARK_SUCCESS); } -/*--------------------------------------------------------------- - ARKodeGetResWeights: +/*-----------------------------------------------------------------*/ - This routine returns the current residual weight vector. - ---------------------------------------------------------------*/ -int ARKodeGetResWeights(void* arkode_mem, N_Vector rweight) +char* arkGetReturnFlagName(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 time steppers that do not support mass matrices */ - if (!ark_mem->step_supports_massmatrix) + switch (flag) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not support non-identity mass matrices"); - 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_CONTROLLER_ERR: sprintf(name, "ARK_CONTROLLER_ERR"); break; + case ARK_UNRECOGNIZED_ERROR: sprintf(name, "ARK_UNRECOGNIZED_ERROR"); break; + default: sprintf(name, "NONE"); } - N_VScale(ONE, ark_mem->rwt, rweight); - return (ARK_SUCCESS); + return (name); } +/*=============================================================== + ARKODE parameter output utility routine + ===============================================================*/ + /*--------------------------------------------------------------- - ARKodeGetWorkSpace: + arkodeWriteParameters: - Returns integrator work space requirements + Outputs all solver parameters to the provided file pointer. ---------------------------------------------------------------*/ -int ARKodeGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +int arkWriteParameters(ARKodeMem ark_mem, FILE* fp) { - ARKodeMem ark_mem; - if (arkode_mem == NULL) + if (ark_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; + /* 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) + { + fprintf(fp, " User provided error weight function\n"); + } + else + { + 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"); } + } + if (!ark_mem->rwt_is_ewt) + { + 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"); } + } + } + 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) + { + fprintf(fp, " Default explicit stability function\n"); + } + else { fprintf(fp, " User provided explicit stability function\n"); } + (void)SUNAdaptController_Write(ark_mem->hadapt_mem->hcontroller, fp); + + fprintf(fp, " Maximum number of error test failures = %i\n", ark_mem->maxnef); + fprintf(fp, " Maximum number of convergence test failures = %i\n", + ark_mem->maxncf); + return (ARK_SUCCESS); } +/*=============================================================== + ARKODE + XBraid interface utility functions + ===============================================================*/ + /*--------------------------------------------------------------- - ARKodeGetNumGEvals: + arkSetForcePass: - Returns the current number of calls to g (for rootfinding) + Ignore the value of kflag after the temporal error test and + force the step to pass. ---------------------------------------------------------------*/ -int ARKodeGetNumGEvals(void* arkode_mem, long int* ngevals) +int arkSetForcePass(void* arkode_mem, sunbooleantype force_pass) { ARKodeMem ark_mem; - ARKodeRootMem ark_root_mem; if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, @@ -2314,27 +2188,20 @@ int ARKodeGetNumGEvals(void* arkode_mem, long int* ngevals) 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; + + ark_mem->force_pass = force_pass; + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetRootInfo: + arkGetLastKFlag: - Returns pointer to array rootsfound showing roots found + The last kflag value retured by the temporal error test. ---------------------------------------------------------------*/ -int ARKodeGetRootInfo(void* arkode_mem, int* rootsfound) +int arkGetLastKFlag(void* arkode_mem, int* last_kflag) { - int i; ARKodeMem ark_mem; - ARKodeRootMem ark_root_mem; if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, @@ -2342,971 +2209,12 @@ int ARKodeGetRootInfo(void* arkode_mem, int* rootsfound) 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 ARKodeGetNumErrTestFails(void* arkode_mem, long int* netfails) -{ - 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; - - *netfails = ark_mem->netf; - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - 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 ARKodeGetNumStepSolveFails(void* arkode_mem, long int* nncfails) -{ - 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; - - *nncfails = ark_mem->ncfn; - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - 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 ARKodeGetUserData(void* arkode_mem, 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; - - *user_data = ark_mem->user_data; - - return (ARK_SUCCESS); -} - -/*----------------------------------------------------------------- - ARKodePrintAllStats - - Prints the current value of all statistics - ---------------------------------------------------------------*/ - -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__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - - switch (fmt) - { - 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); - } - - /* Print relaxation stats */ - if (ark_mem->relax_enabled) - { - 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* 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: - - Outputs all solver parameters to the provided file pointer. - ---------------------------------------------------------------*/ -int ARKodeWriteParameters(void* arkode_mem, FILE* fp) -{ - 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"); - 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) - { - fprintf(fp, " User provided error weight function\n"); - } - else - { - 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"); } - } - if (!ark_mem->rwt_is_ewt) - { - 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"); } - } - } - 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) - { - fprintf(fp, " Default explicit stability function\n"); - } - else { fprintf(fp, " User provided explicit stability function\n"); } - (void)SUNAdaptController_Write(ark_mem->hadapt_mem->hcontroller, fp); - - fprintf(fp, " Maximum number of error test failures = %i\n", ark_mem->maxnef); - fprintf(fp, " Maximum number of convergence test failures = %i\n", - ark_mem->maxncf); - - /* Call stepper routine (if provided) */ - if (ark_mem->step_writeparameters) - { - return (ark_mem->step_writeparameters(ark_mem, fp)); - } - - 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); -} - -/*=============================================================== - Deprecated functions - ===============================================================*/ - -/*--------------------------------------------------------------- - arkSetAdaptivityMethod: - - Specifies the built-in time step adaptivity algorithm (and - optionally, its associated parameters) to use. All parameters - will be checked for validity when used by the solver. - - 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; + *last_kflag = ark_mem->last_kflag; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - arkSetAdaptivityFn: - - 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); -} - -/*=============================================================== EOF - ===============================================================*/ + ---------------------------------------------------------------*/ diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index 646b87ab6f..bf43998744 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -35,17 +35,17 @@ /* 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* arkode_mem, N_Vector tmp1, + sunrealtype gamma, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /*=============================================================== - Exported routines + ARKLS utility routines (called by time-stepper modules) ===============================================================*/ /*--------------------------------------------------------------- - ARKodeSetLinearSolver specifies the linear solver. + arkLSSetLinearSolver specifies the linear solver. ---------------------------------------------------------------*/ -int ARKodeSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) +int arkLSSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) { ARKodeMem ark_mem; ARKLsMem arkls_mem; @@ -57,20 +57,12 @@ int ARKodeSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) /* Return immediately if either arkode_mem or LS inputs are NULL */ if (arkode_mem == NULL) { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); + arkProcessError(NULL, ARKLS_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_LS_ARKMEM_NULL); + return (ARKLS_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__, @@ -189,7 +181,7 @@ int ARKodeSetLinearSolver(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(ark_mem); + arkls_mem->Jt_f = ark_mem->step_getimplicitrhs(arkode_mem); if (arkls_mem->Jt_f == NULL) { @@ -285,7 +277,7 @@ int ARKodeSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) else { arkls_mem->scalesol = SUNFALSE; } /* Attach ARKLs interface to time stepper module */ - retval = ark_mem->step_attachlinsol(ark_mem, arkLsInitialize, arkLsSetup, + retval = ark_mem->step_attachlinsol(arkode_mem, arkLsInitialize, arkLsSetup, arkLsSolve, arkLsFree, LSType, arkls_mem); if (retval != ARK_SUCCESS) { @@ -302,12 +294,12 @@ int ARKodeSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) } /*--------------------------------------------------------------- - ARKodeSetMassLinearSolver specifies the iterative mass-matrix + arkLSSetMassLinearSolver specifies the iterative mass-matrix linear solver and user-supplied routine to perform the mass-matrix-vector product. ---------------------------------------------------------------*/ -int ARKodeSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, - sunbooleantype time_dep) +int arkLSSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, + sunbooleantype time_dep) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; @@ -319,20 +311,12 @@ int ARKodeSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, /* Return immediately if either arkode_mem or LS inputs are NULL */ if (arkode_mem == NULL) { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); + arkProcessError(NULL, ARKLS_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_LS_ARKMEM_NULL); + return (ARKLS_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__, @@ -518,7 +502,7 @@ int ARKodeSetMassLinearSolver(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(ark_mem, arkLsMassInitialize, + retval = ark_mem->step_attachmasssol(arkode_mem, arkLsMassInitialize, arkLsMassSetup, arkLsMTimes, arkLsMassSolve, arkLsMassFree, time_dep, LSType, arkls_mem); @@ -536,34 +520,21 @@ 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. + arkLSSetJacFn specifies the Jacobian function. ---------------------------------------------------------------*/ -int ARKodeSetJacFn(void* arkode_mem, ARKLsJacFn jac) +int arkLSSetJacFn(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(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* return with failure if jac cannot be used */ @@ -597,33 +568,16 @@ int ARKodeSetJacFn(void* arkode_mem, ARKLsJacFn jac) } /*--------------------------------------------------------------- - ARKodeSetMassFn specifies the mass matrix function. + arkLSSetMassFn specifies the mass matrix function. ---------------------------------------------------------------*/ -int ARKodeSetMassFn(void* arkode_mem, ARKLsMassFn mass) +int arkLSSetMassFn(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(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* return with failure if mass cannot be used */ @@ -648,75 +602,38 @@ int ARKodeSetMassFn(void* arkode_mem, ARKLsMassFn mass) } /*--------------------------------------------------------------- - ARKodeSetEpsLin specifies the nonlinear -> linear tolerance + arkLSSetEpsLin specifies the nonlinear -> linear tolerance scale factor. ---------------------------------------------------------------*/ -int ARKodeSetEpsLin(void* arkode_mem, sunrealtype eplifac) +int arkLSSetEpsLin(void* arkode_mem, sunrealtype eplifac) { 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(ark_mem, __func__, &arkls_mem); + /* access ARKLsMem structure; store input and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* store input and return */ arkls_mem->eplifac = (eplifac <= ZERO) ? ARKLS_EPLIN : eplifac; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetLSNormFactor sets or computes the factor to use when + arkLSSetNormFactor sets or computes the factor to use when converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm). ---------------------------------------------------------------*/ -int ARKodeSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) +int arkLSSetNormFactor(void* arkode_mem, sunrealtype nrmfac) { 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(ark_mem, __func__, &arkls_mem); + /* access ARKLsMem structure; store input and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* store input and return */ if (nrmfac > ZERO) { /* set user-provided factor */ @@ -738,71 +655,35 @@ int ARKodeSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) } /*--------------------------------------------------------------- - ARKodeSetJacEvalFrequency specifies the frequency for + arkLSSetJacEvalFrequency specifies the frequency for recomputing the Jacobian matrix and/or preconditioner. ---------------------------------------------------------------*/ -int ARKodeSetJacEvalFrequency(void* arkode_mem, long int msbj) +int arkLSSetJacEvalFrequency(void* arkode_mem, long int msbj) { 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(ark_mem, __func__, &arkls_mem); + /* access ARKLsMem structure; store input and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* store input and return */ arkls_mem->msbj = (msbj <= ZERO) ? ARKLS_MSBJ : msbj; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetLinearSolutionScaling enables or disables scaling the + arkLSSetLinearSolutionScaling enables or disables scaling the linear solver solution to account for changes in gamma. ---------------------------------------------------------------*/ -int ARKodeSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) +int arkLSSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) { 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(ark_mem, __func__, &arkls_mem); + /* access ARKLsMem structure; store input and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* check for valid solver type */ @@ -815,11 +696,11 @@ int ARKodeSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) } /*--------------------------------------------------------------- - ARKodeSetPreconditioner specifies the user-supplied + arkLSSetPreconditioner specifies the user-supplied preconditioner setup and solve routines. ---------------------------------------------------------------*/ -int ARKodeSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, - ARKLsPrecSolveFn psolve) +int arkLSSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, + ARKLsPrecSolveFn psolve) { ARKodeMem ark_mem; ARKLsMem arkls_mem; @@ -827,25 +708,8 @@ int ARKodeSetPreconditioner(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(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* issue error if LS object does not allow user-supplied preconditioning */ @@ -877,35 +741,18 @@ int ARKodeSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, } /*--------------------------------------------------------------- - ARKodeSetJacTimes specifies the user-supplied Jacobian-vector + arkLSSetJacTimes specifies the user-supplied Jacobian-vector product setup and multiply routines. ---------------------------------------------------------------*/ -int ARKodeSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, - ARKLsJacTimesVecFn jtimes) +int arkLSSetJacTimes(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(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* issue error if LS object does not allow user-supplied ATimes */ @@ -931,7 +778,7 @@ int ARKodeSetJacTimes(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(ark_mem); + arkls_mem->Jt_f = ark_mem->step_getimplicitrhs(arkode_mem); if (arkls_mem->Jt_f == NULL) { @@ -945,35 +792,18 @@ int ARKodeSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, } /*--------------------------------------------------------------- - ARKodeSetJacTimesRhsFn specifies an alternative user-supplied + arkLSSetJacTimesRhsFn specifies an alternative user-supplied ODE right-hand side function to use in the internal finite difference Jacobian-vector product. ---------------------------------------------------------------*/ -int ARKodeSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) +int arkLSSetJacTimesRhsFn(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(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* check if using internal finite difference approximation */ @@ -988,7 +818,7 @@ int ARKodeSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) if (jtimesRhsFn != NULL) { arkls_mem->Jt_f = jtimesRhsFn; } else { - arkls_mem->Jt_f = ark_mem->step_getimplicitrhs(ark_mem); + arkls_mem->Jt_f = ark_mem->step_getimplicitrhs(arkode_mem); if (arkls_mem->Jt_f == NULL) { @@ -1001,32 +831,15 @@ int ARKodeSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) return (ARKLS_SUCCESS); } -/* ARKodeSetLinSysFn specifies the linear system setup function. */ -int ARKodeSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) +/* arkLSSetLinSysFn specifies the linear system setup function. */ +int arkLSSetLinSysFn(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(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARKLS_SUCCESS) { return (retval); } /* return with failure if linsys cannot be used */ @@ -1054,105 +867,80 @@ int ARKodeSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) return (ARKLS_SUCCESS); } -int ARKodeGetJac(void* arkode_mem, SUNMatrix* J) +/* arkLSSetUserData sets user_data pointers in arkLS */ +int arkLSSetUserData(void* arkode_mem, void* user_data) { 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; + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + if (retval != ARKLS_SUCCESS) { return (retval); } - /* Return NULL for incompatible steppers */ - if (!ark_mem->step_supports_implicit) - { - *J = NULL; - return (ARK_SUCCESS); - } + /* Set data for Jacobian */ + if (!arkls_mem->jacDQ) { arkls_mem->J_data = user_data; } - /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); - if (retval != ARKLS_SUCCESS) { return retval; } + /* Set data for Jtimes */ + if (!arkls_mem->jtimesDQ) { arkls_mem->Jt_data = user_data; } - /* set output and return */ - *J = arkls_mem->savedJ; - return ARKLS_SUCCESS; + /* 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); } -int ARKodeGetJacTime(void* arkode_mem, sunrealtype* t_J) +/*=============================================================== + Optional Get functions (called by time-stepper modules) + ===============================================================*/ + +int arkLSGetJac(void* arkode_mem, SUNMatrix* J) { 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; + /* access ARKLsMem structure; set output and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + if (retval != ARKLS_SUCCESS) { return retval; } + *J = arkls_mem->savedJ; + return ARKLS_SUCCESS; +} - /* 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); - } +int arkLSGetJacTime(void* arkode_mem, sunrealtype* t_J) +{ + ARKodeMem ark_mem; + ARKLsMem arkls_mem; + int retval; - /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); + /* access ARKLsMem structure; set output and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARKLS_SUCCESS) { return retval; } - - /* set output and return */ *t_J = arkls_mem->tnlj; return ARKLS_SUCCESS; } -int ARKodeGetJacNumSteps(void* arkode_mem, long int* nst_J) +int arkLSGetJacNumSteps(void* arkode_mem, long int* nst_J) { 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; - - /* 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); + /* access ARKLsMem structure; set output and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARKLS_SUCCESS) { return retval; } - - /* set output and return */ *nst_J = arkls_mem->nstlj; return ARKLS_SUCCESS; } /*--------------------------------------------------------------- - ARKodeGetLinWorkSpace returns the length of workspace allocated for + arkLSGetWorkSpace returns the length of workspace allocated for the ARKLS linear solver interface. ---------------------------------------------------------------*/ -int ARKodeGetLinWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +int arkLSGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) { ARKodeMem ark_mem; ARKLsMem arkls_mem; @@ -1160,24 +948,8 @@ int ARKodeGetLinWorkSpace(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(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* start with fixed sizes plus vector/matrix pointers */ @@ -1221,361 +993,181 @@ int ARKodeGetLinWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) } /*--------------------------------------------------------------- - ARKodeGetNumJacEvals returns the number of Jacobian evaluations + arkLSGetNumJacEvals returns the number of Jacobian evaluations ---------------------------------------------------------------*/ -int ARKodeGetNumJacEvals(void* arkode_mem, long int* njevals) +int arkLSGetNumJacEvals(void* arkode_mem, long int* njevals) { 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; - - /* 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); + /* access ARKLsMem structure; set output value and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *njevals = arkls_mem->nje; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumLinRhsEvals returns the number of calls to the ODE + arkLSGetNumRhsEvals returns the number of calls to the ODE function needed for the DQ Jacobian approximation or J*v product approximation. ---------------------------------------------------------------*/ -int ARKodeGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) +int arkLSGetNumRhsEvals(void* arkode_mem, long int* nfevalsLS) { 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; - - /* 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); + /* access ARKLsMem structure; set output value and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *nfevalsLS = arkls_mem->nfeDQ; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumPrecEvals returns the number of calls to the + arkLSGetNumPrecEvals returns the number of calls to the user- or ARKODE-supplied preconditioner setup routine. ---------------------------------------------------------------*/ -int ARKodeGetNumPrecEvals(void* arkode_mem, long int* npevals) +int arkLSGetNumPrecEvals(void* arkode_mem, long int* npevals) { 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; - - /* 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); + /* access ARKLsMem structure; set output value and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *npevals = arkls_mem->npe; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumPrecSolves returns the number of calls to the + arkLSGetNumPrecSolves returns the number of calls to the user- or ARKODE-supplied preconditioner solve routine. ---------------------------------------------------------------*/ -int ARKodeGetNumPrecSolves(void* arkode_mem, long int* npsolves) +int arkLSGetNumPrecSolves(void* arkode_mem, long int* npsolves) { 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; - - /* 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); + /* access ARKLsMem structure; set output value and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *npsolves = arkls_mem->nps; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumLinIters returns the number of linear iterations + arkLSGetNumLinIters returns the number of linear iterations (if accessible from the LS object). ---------------------------------------------------------------*/ -int ARKodeGetNumLinIters(void* arkode_mem, long int* nliters) +int arkLSGetNumLinIters(void* arkode_mem, long int* nliters) { 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; - - /* 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); + /* access ARKLsMem structure; set output value and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *nliters = arkls_mem->nli; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumLinConvFails returns the number of linear solver + arkLSGetNumConvFails returns the number of linear solver convergence failures (as reported by the LS object). ---------------------------------------------------------------*/ -int ARKodeGetNumLinConvFails(void* arkode_mem, long int* nlcfails) +int arkLSGetNumConvFails(void* arkode_mem, long int* nlcfails) { 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; - - /* 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); + /* access ARKLsMem structure; set output value and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *nlcfails = arkls_mem->ncfl; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumJTSetupEvals returns the number of calls to the + arkLSGetNumJTSetupEvals returns the number of calls to the user-supplied Jacobian-vector product setup routine. ---------------------------------------------------------------*/ -int ARKodeGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups) +int arkLSGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups) { 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; - - /* 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); + /* access ARKLsMem structure; set output value and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *njtsetups = arkls_mem->njtsetup; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumJtimesEvals returns the number of calls to the + arkLSGetNumJtimesEvals returns the number of calls to the Jacobian-vector product multiply routine. ---------------------------------------------------------------*/ -int ARKodeGetNumJtimesEvals(void* arkode_mem, long int* njvevals) +int arkLSGetNumJtimesEvals(void* arkode_mem, long int* njvevals) { 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; - - /* 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); + /* access ARKLsMem structure; set output value and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *njvevals = arkls_mem->njtimes; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumMassMultSetups returns the number of calls to the + arkLSGetNumMassMatvecSetups returns the number of calls to the mass matrix-vector setup routine. ---------------------------------------------------------------*/ -int ARKodeGetNumMassMultSetups(void* arkode_mem, long int* nmvsetups) +int arkLSGetNumMassMatvecSetups(void* arkode_mem, long int* nmvsetups) { 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; - - /* 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); + /* access ARKMassMem structure; set output value and return */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *nmvsetups = arkls_mem->nmvsetup; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetLastLinFlag returns the last flag set in a ARKLS + arkLSGetLastFlag returns the last flag set in a ARKLS function. ---------------------------------------------------------------*/ -int ARKodeGetLastLinFlag(void* arkode_mem, long int* flag) +int arkLSGetLastFlag(void* arkode_mem, long int* flag) { 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; - - /* 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); + /* access ARKLsMem structure; set output value and return */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *flag = arkls_mem->last_flag; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetLinReturnFlagName translates from the integer error code + arkLSGetReturnFlagName translates from the integer error code returned by an ARKLs routine to the corresponding string equivalent for that flag ---------------------------------------------------------------*/ -char* ARKodeGetLinReturnFlagName(long int flag) +char* arkLSGetReturnFlagName(long int flag) { char* name = (char*)malloc(30 * sizeof(char)); @@ -1600,75 +1192,38 @@ char* ARKodeGetLinReturnFlagName(long int flag) } /*--------------------------------------------------------------- - ARKodeSetMassEpsLin specifies the nonlinear -> linear tolerance + arkLSSetMassEpsLin specifies the nonlinear -> linear tolerance scale factor for mass matrix linear systems. ---------------------------------------------------------------*/ -int ARKodeSetMassEpsLin(void* arkode_mem, sunrealtype eplifac) +int arkLSSetMassEpsLin(void* arkode_mem, sunrealtype eplifac) { 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(ark_mem, __func__, &arkls_mem); + /* access ARKLsMassMem structure; store input and return */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* store input and return */ arkls_mem->eplifac = (eplifac <= ZERO) ? ARKLS_EPLIN : eplifac; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeSetMassLSNormFactor sets or computes the factor to use when + arkLSSetMassNormFactor sets or computes the factor to use when converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm). ---------------------------------------------------------------*/ -int ARKodeSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac) +int arkLSSetMassNormFactor(void* arkode_mem, sunrealtype nrmfac) { 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 ARKLsMem structures */ - retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); + /* access ARKLsMem structure; store input and return */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* store input and return */ if (nrmfac > ZERO) { /* set user-provided factor */ @@ -1690,11 +1245,11 @@ int ARKodeSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac) } /*--------------------------------------------------------------- - ARKodeSetMassPreconditioner specifies the user-supplied + arkLSSetMassPreconditioner specifies the user-supplied preconditioner setup and solve routines. ---------------------------------------------------------------*/ -int ARKodeSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, - ARKLsMassPrecSolveFn psolve) +int arkLSSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, + ARKLsMassPrecSolveFn psolve) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; @@ -1702,25 +1257,8 @@ int ARKodeSetMassPreconditioner(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(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* issue error if LS object does not allow user-supplied preconditioning */ @@ -1752,35 +1290,18 @@ int ARKodeSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, } /*--------------------------------------------------------------- - ARKodeSetMassTimes specifies the user-supplied mass + arkLSSetMassTimes specifies the user-supplied mass matrix-vector product setup and multiply routines. ---------------------------------------------------------------*/ -int ARKodeSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn mtsetup, - ARKLsMassTimesVecFn mtimes, void* mtimes_data) +int arkLSSetMassTimes(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(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* issue error if mtimes function is unusable */ @@ -1817,10 +1338,32 @@ int ARKodeSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn mtsetup, return (ARKLS_SUCCESS); } +/* arkLSMassSetUserData sets user_data pointers in arkLSMass */ +int arkLSSetMassUserData(void* arkode_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); + 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 + arkLSGetMassWorkSpace ---------------------------------------------------------------*/ -int ARKodeGetMassWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +int arkLSGetMassWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; @@ -1828,24 +1371,8 @@ int ARKodeGetMassWorkSpace(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(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* start with fixed sizes plus vector/matrix pointers */ @@ -1889,350 +1416,170 @@ int ARKodeGetMassWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) } /*--------------------------------------------------------------- - ARKodeGetNumMassSetups returns the number of mass matrix + arkLSGetNumMassSetups returns the number of mass matrix solver 'setup' calls ---------------------------------------------------------------*/ -int ARKodeGetNumMassSetups(void* arkode_mem, long int* nmsetups) +int arkLSGetNumMassSetups(void* arkode_mem, long int* nmsetups) { 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; - - /* 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); + /* access ARKLsMassMem structure; set output value and return */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *nmsetups = arkls_mem->nmsetups; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumMassMult returns the number of calls to the user- + arkLSGetNumMassMult returns the number of calls to the user- supplied or internal mass matrix-vector product multiply routine. ---------------------------------------------------------------*/ -int ARKodeGetNumMassMult(void* arkode_mem, long int* nmvevals) +int arkLSGetNumMassMult(void* arkode_mem, long int* nmvevals) { 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; - - /* 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); + /* access ARKLsMassMem structure; set output value and return */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *nmvevals = arkls_mem->nmtimes; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumMassSolves returns the number of mass matrix + arkLSGetNumMassSolves returns the number of mass matrix solver 'solve' calls ---------------------------------------------------------------*/ -int ARKodeGetNumMassSolves(void* arkode_mem, long int* nmsolves) +int arkLSGetNumMassSolves(void* arkode_mem, long int* nmsolves) { 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; - - /* 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); + /* access ARKLsMassMem structure; set output value and return */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *nmsolves = arkls_mem->nmsolves; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumMassPrecEvals returns the number of calls to the + arkLSGetNumMassPrecEvals returns the number of calls to the user- or ARKODE-supplied preconditioner setup routine. ---------------------------------------------------------------*/ -int ARKodeGetNumMassPrecEvals(void* arkode_mem, long int* npevals) +int arkLSGetNumMassPrecEvals(void* arkode_mem, long int* npevals) { 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; - - /* 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); + /* access ARKLsMassMem structure; set output value and return */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *npevals = arkls_mem->npe; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumMassPrecSolves returns the number of calls to the + arkLSGetNumMassPrecSolves returns the number of calls to the user- or ARKODE-supplied preconditioner solve routine. ---------------------------------------------------------------*/ -int ARKodeGetNumMassPrecSolves(void* arkode_mem, long int* npsolves) +int arkLSGetNumMassPrecSolves(void* arkode_mem, long int* npsolves) { 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; - - /* 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); + /* access ARKLsMassMem structure; set output value and return */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *npsolves = arkls_mem->nps; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumMassIters returns the number of mass matrix solver + arkLSGetNumMassIters returns the number of mass matrix solver linear iterations (if accessible from the LS object). ---------------------------------------------------------------*/ -int ARKodeGetNumMassIters(void* arkode_mem, long int* nmiters) +int arkLSGetNumMassIters(void* arkode_mem, long int* nmiters) { 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; - - /* 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); + /* access ARKLsMassMem structure; set output value and return */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *nmiters = arkls_mem->nli; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumMassConvFails returns the number of linear solver + arkLSGetNumMassConvFails returns the number of linear solver convergence failures (as reported by the LS object). ---------------------------------------------------------------*/ -int ARKodeGetNumMassConvFails(void* arkode_mem, long int* nmcfails) +int arkLSGetNumMassConvFails(void* arkode_mem, long int* nmcfails) { 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; - - /* 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); + /* access ARKLsMassMem structure; set output value and return */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *nmcfails = arkls_mem->ncfl; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetCurrentMassMatrix returns the current mass matrix. + arkLSGetMassMatrix returns the current mass matrix. ---------------------------------------------------------------*/ -int ARKodeGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M) +int arkLSGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M) { 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; - - /* 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); + /* access ARKLsMassMem structure; set output value and return */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *M = arkls_mem->M; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumMTSetups returns the number of calls to the + arkLSGetNumMTSetups returns the number of calls to the user-supplied mass matrix-vector product setup routine. ---------------------------------------------------------------*/ -int ARKodeGetNumMTSetups(void* arkode_mem, long int* nmtsetups) +int arkLSGetNumMTSetups(void* arkode_mem, long int* nmtsetups) { 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; - - /* 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); + /* access ARKLsMassMem structure; set output value and return */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output value and return */ *nmtsetups = arkls_mem->nmtsetup; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetLastMassFlag returns the last flag set in a ARKLS + arkLSGetLastMassFlag returns the last flag set in a ARKLS function. ---------------------------------------------------------------*/ -int ARKodeGetLastMassFlag(void* arkode_mem, long int* flag) +int arkLSGetLastMassFlag(void* arkode_mem, long int* flag) { 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; - - /* 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); + /* access ARKLsMassMem structure; set output value and return */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } - - /* set output and return */ *flag = arkls_mem->last_flag; return (ARKLS_SUCCESS); } @@ -2241,52 +1588,6 @@ 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: @@ -2307,8 +1608,8 @@ int arkLsATimes(void* arkode_mem, N_Vector v, N_Vector z) sunrealtype gamma, gamrat; sunbooleantype dgamma_fail, *jcur; - /* access ARKodeMem and ARKLsMem structures */ - retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Access mass matrix solver (if it exists) */ @@ -2366,8 +1667,8 @@ int arkLsPSetup(void* arkode_mem) sunbooleantype dgamma_fail, *jcur; int retval; - /* access ARKodeMem and ARKLsMem structures */ - retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* get gamma values from time step module */ @@ -2407,8 +1708,8 @@ int arkLsPSolve(void* arkode_mem, N_Vector r, N_Vector z, sunrealtype tol, int l sunbooleantype dgamma_fail, *jcur; int retval; - /* access ARKodeMem and ARKLsMem structures */ - retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* get gamma values from time step module */ @@ -2442,8 +1743,8 @@ int arkLsMTimes(void* arkode_mem, N_Vector v, N_Vector z) ARKLsMassMem arkls_mem; int retval; - /* access ARKodeMem and ARKLsMassMem structures */ - retval = arkLs_AccessARKODEMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKLsMassMem structure */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* perform multiply by either calling the user-supplied routine @@ -2498,8 +1799,8 @@ int arkLsMPSetup(void* arkode_mem) ARKLsMassMem arkls_mem; int retval; - /* access ARKodeMem and ARKLsMassMem structures */ - retval = arkLs_AccessARKODEMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKLsMassMem structure */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* only proceed if the mass matrix is time-independent or if @@ -2529,8 +1830,8 @@ int arkLsMPSolve(void* arkode_mem, N_Vector r, N_Vector z, sunrealtype tol, int ARKLsMassMem arkls_mem; int retval; - /* access ARKodeMem and ARKLsMassMem structures */ - retval = arkLs_AccessARKODEMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKLsMassMem structure */ + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* call the user-supplied psolve routine, and accumulate count */ @@ -2547,16 +1848,15 @@ 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, - SUNDIALS_MAYBE_UNUSED N_Vector tmp3) + void* arkode_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { ARKodeMem ark_mem; ARKLsMem arkls_mem; ARKRhsFn fi; int retval; - /* access ARKodeMem and ARKLsMem structures */ - retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* verify that Jac is non-NULL */ @@ -2775,7 +2075,7 @@ int arkLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, } /* Evaluate f with incremented y */ - retval = fi(t, ytemp, ftemp, ark_mem->user_data); + retval = fi(ark_mem->tcur, ytemp, ftemp, ark_mem->user_data); arkls_mem->nfeDQ++; if (retval != 0) { break; } @@ -2829,8 +2129,8 @@ int arkLsDQJtimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, sunrealtype sig, siginv; int iter, retval; - /* access ARKodeMem and ARKLsMem structures */ - retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Initialize perturbation to 1/||v|| */ @@ -2875,8 +2175,8 @@ static int arkLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, ARKLsMem arkls_mem; int retval; - /* access ARKodeMem and ARKLsMem structures */ - retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARKLS_SUCCESS) { return (retval); } /* Check if Jacobian needs to be updated */ @@ -2960,23 +2260,25 @@ 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(ARKodeMem ark_mem) +int arkLsInitialize(void* arkode_mem) { + ARKodeMem ark_mem; ARKLsMem arkls_mem; ARKLsMassMem arkls_massmem; int retval; /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &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(ark_mem) != NULL) + if (ark_mem->step_getmassmem(arkode_mem) != NULL) { - retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_massmem); + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, + &arkls_massmem); if (retval != ARK_SUCCESS) { return (retval); } } } @@ -3117,13 +2419,13 @@ int arkLsInitialize(ARKodeMem ark_mem) if ((arkls_mem->A == NULL) && (arkls_mem->pset == NULL) && (ark_mem->step_disablelsetup != NULL)) { - ark_mem->step_disablelsetup(ark_mem); + ark_mem->step_disablelsetup(arkode_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(ark_mem); + ark_mem->step_disablelsetup(arkode_mem); arkls_mem->scalesol = SUNFALSE; } @@ -3145,10 +2447,11 @@ int arkLsInitialize(ARKodeMem ark_mem) This routine then calls the LS 'setup' routine with A. ---------------------------------------------------------------*/ -int arkLsSetup(ARKodeMem ark_mem, int convfail, sunrealtype tpred, +int arkLsSetup(void* arkode_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; @@ -3157,7 +2460,7 @@ int arkLsSetup(ARKodeMem ark_mem, int convfail, sunrealtype tpred, int retval; /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Immediately return when using matrix-embedded linear solver */ @@ -3174,7 +2477,7 @@ int arkLsSetup(ARKodeMem ark_mem, int convfail, sunrealtype tpred, arkls_mem->fcur = fpred; /* get gamma values from time step module */ - arkls_mem->last_flag = ark_mem->step_getgammas(ark_mem, &gamma, &gamrat, + arkls_mem->last_flag = ark_mem->step_getgammas(arkode_mem, &gamma, &gamrat, &jcur, &dgamma_fail); if (arkls_mem->last_flag) { @@ -3195,7 +2498,7 @@ int arkLsSetup(ARKodeMem ark_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(ark_mem); + ark_step_massmem = ark_mem->step_getmassmem(arkode_mem); } if (ark_step_massmem) @@ -3204,7 +2507,8 @@ int arkLsSetup(ARKodeMem ark_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(ark_mem, tpred, vtemp1, vtemp2, vtemp3); + arkls_mem->last_flag = arkLsMassSetup(arkode_mem, tpred, vtemp1, vtemp2, + vtemp3); if (arkls_mem->last_flag) { arkProcessError(ark_mem, ARKLS_SUNMAT_FAIL, __LINE__, __func__, __FILE__, @@ -3287,10 +2591,11 @@ int arkLsSetup(ARKodeMem ark_mem, int convfail, sunrealtype tpred, When using a non-NULL SUNMatrix, this will additionally scale the solution appropriately when gamrat != 1. ---------------------------------------------------------------*/ -int arkLsSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype tnow, N_Vector ynow, +int arkLsSolve(void* arkode_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; @@ -3298,7 +2603,7 @@ int arkLsSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype tnow, N_Vector ynow, int nli_inc, retval; /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Set scalar tcur and vectors ycur and fcur for use by the @@ -3392,7 +2697,7 @@ int arkLsSolve(ARKodeMem ark_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(ark_mem, &gamma, &gamrat, + arkls_mem->last_flag = ark_mem->step_getgammas(arkode_mem, &gamma, &gamrat, &jcur, &dgamma_fail); if (arkls_mem->last_flag != ARK_SUCCESS) { @@ -3482,14 +2787,16 @@ int arkLsSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype tnow, N_Vector ynow, arkLsFree frees memory associates with the ARKLs system solver interface. ---------------------------------------------------------------*/ -int arkLsFree(ARKodeMem ark_mem) +int arkLsFree(void* arkode_mem) { + ARKodeMem ark_mem; ARKLsMem arkls_mem; void* ark_step_lmem; /* Return immediately if ARKodeMem, ARKLsMem are NULL */ - if (ark_mem == NULL) { return (ARKLS_SUCCESS); } - ark_step_lmem = ark_mem->step_getlinmem(ark_mem); + if (arkode_mem == NULL) { return (ARKLS_SUCCESS); } + ark_mem = (ARKodeMem)arkode_mem; + ark_step_lmem = ark_mem->step_getlinmem(arkode_mem); if (ark_step_lmem == NULL) { return (ARKLS_SUCCESS); } arkls_mem = (ARKLsMem)ark_step_lmem; @@ -3532,13 +2839,14 @@ int arkLsFree(ARKodeMem ark_mem) arkLsMassInitialize performs remaining initializations specific to the mass matrix solver interface (and solver itself) ---------------------------------------------------------------*/ -int arkLsMassInitialize(ARKodeMem ark_mem) +int arkLsMassInitialize(void* arkode_mem) { + ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; /* access ARKLsMassMem structure */ - retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* reset counters */ @@ -3590,13 +2898,13 @@ int arkLsMassInitialize(ARKodeMem ark_mem) if ((arkls_mem->M == NULL) && (arkls_mem->pset == NULL) && (arkls_mem->mtsetup == NULL) && (ark_mem->step_disablemsetup != NULL)) { - ark_mem->step_disablemsetup(ark_mem); + ark_mem->step_disablemsetup(arkode_mem); } /* When using a matrix-embedded linear solver, disable lsetup call */ if (SUNLinSolGetType(arkls_mem->LS) == SUNLINEARSOLVER_MATRIX_EMBEDDED) { - ark_mem->step_disablemsetup(ark_mem); + ark_mem->step_disablemsetup(arkode_mem); } /* Call LS initialize routine */ @@ -3607,15 +2915,16 @@ int arkLsMassInitialize(ARKodeMem ark_mem) /*--------------------------------------------------------------- arkLsMassSetup calls the LS 'setup' routine. ---------------------------------------------------------------*/ -int arkLsMassSetup(ARKodeMem ark_mem, sunrealtype t, N_Vector vtemp1, +int arkLsMassSetup(void* arkode_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(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Immediately return when using matrix-embedded linear solver */ @@ -3760,15 +3069,16 @@ int arkLsMassSetup(ARKodeMem ark_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(ARKodeMem ark_mem, N_Vector b, sunrealtype nlscoef) +int arkLsMassSolve(void* arkode_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(ark_mem, __func__, &arkls_mem); + retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Set input tolerance for iterative solvers (in 2-norm) */ @@ -3904,14 +3214,16 @@ int arkLsMassSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype nlscoef) arkLsMassFree frees memory associates with the ARKLs mass matrix solver interface. ---------------------------------------------------------------*/ -int arkLsMassFree(ARKodeMem ark_mem) +int arkLsMassFree(void* arkode_mem) { + ARKodeMem ark_mem; ARKLsMassMem arkls_mem; void* ark_step_massmem; /* Return immediately if ARKodeMem, ARKLsMassMem are NULL */ - if (ark_mem == NULL) { return (ARKLS_SUCCESS); } - ark_step_massmem = ark_mem->step_getmassmem(ark_mem); + if (arkode_mem == NULL) { return (ARKLS_SUCCESS); } + ark_mem = (ARKodeMem)arkode_mem; + ark_step_massmem = ark_mem->step_getmassmem(arkode_mem); if (ark_step_massmem == NULL) { return (ARKLS_SUCCESS); } arkls_mem = (ARKLsMassMem)ark_step_massmem; @@ -3997,16 +3309,14 @@ int arkLsInitializeMassCounters(ARKLsMassMem arkls_mem) } /*--------------------------------------------------------------- - arkLs_AccessARKODELMem, arkLs_AccessLMem, - arkLs_AccessARKODEMassMem and arkLs_AccessMassMem: + arkLs_AccessLMem and arkLs_AccessMassMem: Shortcut routines to unpack ark_mem, ls_mem and mass_mem - structures from void* pointer and ark_mem structure. If any - is missing it returns ARKLS_MEM_NULL, ARKLS_LMEM_NULL or - ARKLS_MASSMEM_NULL. + structures from void* pointer. If any is missing it returns + ARKLS_MEM_NULL, ARKLS_LMEM_NULL or ARKLS_MASSMEM_NULL. ---------------------------------------------------------------*/ -int arkLs_AccessARKODELMem(void* arkode_mem, const char* fname, - ARKodeMem* ark_mem, ARKLsMem* arkls_mem) +int arkLs_AccessLMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, + ARKLsMem* arkls_mem) { void* ark_step_lmem; if (arkode_mem == NULL) @@ -4016,7 +3326,7 @@ int arkLs_AccessARKODELMem(void* arkode_mem, const char* fname, return (ARKLS_MEM_NULL); } *ark_mem = (ARKodeMem)arkode_mem; - ark_step_lmem = (*ark_mem)->step_getlinmem(*ark_mem); + ark_step_lmem = (*ark_mem)->step_getlinmem(arkode_mem); if (ark_step_lmem == NULL) { arkProcessError(*ark_mem, ARKLS_LMEM_NULL, __LINE__, fname, __FILE__, @@ -4027,22 +3337,8 @@ int arkLs_AccessARKODELMem(void* arkode_mem, const char* fname, return (ARKLS_SUCCESS); } -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) +int arkLs_AccessMassMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, + ARKLsMassMem* arkls_mem) { void* ark_step_massmem; if (arkode_mem == NULL) @@ -4052,7 +3348,7 @@ int arkLs_AccessARKODEMassMem(void* arkode_mem, const char* fname, return (ARKLS_MEM_NULL); } *ark_mem = (ARKodeMem)arkode_mem; - ark_step_massmem = (*ark_mem)->step_getmassmem(*ark_mem); + ark_step_massmem = (*ark_mem)->step_getmassmem(arkode_mem); if (ark_step_massmem == NULL) { arkProcessError(*ark_mem, ARKLS_MASSMEM_NULL, __LINE__, fname, __FILE__, @@ -4063,21 +3359,6 @@ int arkLs_AccessARKODEMassMem(void* arkode_mem, const char* fname, 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 8a296d83d5..8dc2723c2f 100644 --- a/src/arkode/arkode_ls_impl.h +++ b/src/arkode/arkode_ls_impl.h @@ -11,8 +11,7 @@ * 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,40 +217,97 @@ 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(ARKodeMem ark_mem); -int arkLsSetup(ARKodeMem ark_mem, int convfail, sunrealtype tpred, +int arkLsInitialize(void* arkode_mem); + +int arkLsSetup(void* arkode_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, + +int arkLsSolve(void* arkode_mem, N_Vector b, sunrealtype tcur, N_Vector ycur, N_Vector fcur, sunrealtype eRnrm, int mnewt); -int arkLsFree(ARKodeMem ark_mem); + +int arkLsFree(void* arkode_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, +int arkLsMassInitialize(void* arkode_mem); + +int arkLsMassSetup(void* arkode_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); + +int arkLsMassSolve(void* arkode_mem, N_Vector b, sunrealtype nlscoef); + +int arkLsMassFree(void* arkode_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, + +int arkLs_AccessLMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, + ARKLsMem* arkls_mem); + +int arkLs_AccessMassMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, 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, +int arkLSSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A); + +int arkLSSetMassLinearSolver(void* arkode_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); + +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); /*--------------------------------------------------------------- Error Messages diff --git a/src/arkode/arkode_mri_tables.def b/src/arkode/arkode_mri_tables.def index 999ef71f95..13c5635b43 100644 --- a/src/arkode/arkode_mri_tables.def +++ b/src/arkode/arkode_mri_tables.def @@ -31,49 +31,24 @@ 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 - ----------------------------------------------------- + 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 + ------------------------------------------------ */ - 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); @@ -81,20 +56,6 @@ 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); @@ -116,31 +77,6 @@ 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); @@ -186,21 +122,6 @@ 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); @@ -222,23 +143,6 @@ 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); @@ -353,64 +257,6 @@ 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 3e856a724a..8c0e94d9a6 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -16,20 +16,26 @@ * 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" /*=============================================================== - Exported functions + MRIStep Exported functions -- Required ===============================================================*/ +/*--------------------------------------------------------------- + Create MRIStep integrator memory struct + ---------------------------------------------------------------*/ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, MRIStepInnerStepper stepper, SUNContext sunctx) { @@ -90,63 +96,35 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, } /* Allocate ARKodeMRIStepMem structure, and initialize to zero */ - step_mem = (ARKodeMRIStepMem)calloc(1, sizeof(*step_mem)); + step_mem = NULL; + step_mem = (ARKodeMRIStepMem)malloc(sizeof(struct ARKodeMRIStepMemRec)); if (step_mem == NULL) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, MSG_ARK_ARKMEM_FAIL); - ARKodeFree((void**)&ark_mem); + MRIStepFree((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_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); + 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); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Error setting default solver options"); - ARKodeFree((void**)&ark_mem); + MRIStepFree((void**)&ark_mem); return (NULL); } @@ -178,15 +156,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"); - ARKodeFree((void**)&ark_mem); + MRIStepFree((void**)&ark_mem); return (NULL); } - retval = ARKodeSetNonlinearSolver(ark_mem, NLS); + retval = MRIStepSetNonlinearSolver(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); + MRIStepFree((void**)&ark_mem); return (NULL); } step_mem->ownNLS = SUNTRUE; @@ -221,7 +199,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"); - ARKodeFree((void**)&ark_mem); + MRIStepFree((void**)&ark_mem); return (NULL); } @@ -234,7 +212,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"); - ARKodeFree((void**)&ark_mem); + MRIStepFree((void**)&ark_mem); return (NULL); } @@ -243,125 +221,26 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, } /*--------------------------------------------------------------- - 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: + MRIStepResize: This routine resizes the memory within the MRIStep module. + It first resizes the main ARKODE infrastructure memory, and + then resizes its own 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) +int MRIStepResize(void* arkode_mem, N_Vector y0, 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(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* Determine change in vector sizes */ + /* Determing change in vector sizes */ lrw1 = liw1 = 0; if (y0->ops->nvspace != NULL) { N_VSpace(y0, &lrw1, &liw1); } lrw_diff = lrw1 - ark_mem->lrw1; @@ -369,6 +248,15 @@ int mriStep_Resize(ARKodeMem ark_mem, N_Vector y0, 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) { @@ -446,8 +334,8 @@ int mriStep_Resize(ARKodeMem ark_mem, N_Vector y0, return (ARK_MEM_FAIL); } - /* attach new Newton NLS object */ - retval = ARKodeSetNonlinearSolver(ark_mem, NLS); + /* attach new Newton NLS object to MRIStep */ + retval = MRIStepSetNonlinearSolver(ark_mem, NLS); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, @@ -474,22 +362,128 @@ int mriStep_Resize(ARKodeMem ark_mem, N_Vector y0, } /*--------------------------------------------------------------- - mriStep_Reset: + 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 ARKodeMRIStepMem structure */ + retval = mriStep_AccessStepMem(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"); + MRIStepFree((void**)&ark_mem); + return (ARK_MEM_FAIL); + } + retval = MRIStepSetNonlinearSolver(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); + 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); +} + +/*--------------------------------------------------------------- + MRIStepReset: 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). It is called after the main ARKODE - infrastructure is reset. + values are retained). ---------------------------------------------------------------*/ -int mriStep_Reset(ARKodeMem ark_mem, sunrealtype tR, N_Vector yR) +int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_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); + } + /* Reset the inner integrator with this same state */ retval = mriStepInnerStepper_Reset(step_mem->stepper, tR, yR); if (retval != ARK_SUCCESS) { return (ARK_INNERSTEP_FAIL); } @@ -498,17 +492,136 @@ int mriStep_Reset(ARKodeMem ark_mem, sunrealtype tR, N_Vector yR) } /*--------------------------------------------------------------- - mriStep_ComputeState: + 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: Computes y based on the current prediction and given correction. ---------------------------------------------------------------*/ -int mriStep_ComputeState(ARKodeMem ark_mem, N_Vector zcor, N_Vector z) +int MRIStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) { int retval; + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } N_VLinearSum(ONE, step_mem->zpred, ONE, zcor, z); @@ -517,17 +630,20 @@ int mriStep_ComputeState(ARKodeMem ark_mem, N_Vector zcor, N_Vector z) } /*--------------------------------------------------------------- - mriStep_Free frees all MRIStep memory. + MRIStepFree frees all MRIStep memory, and then calls an ARKODE + utility routine to free the ARKODE infrastructure memory. ---------------------------------------------------------------*/ -void mriStep_Free(ARKodeMem ark_mem) +void MRIStepFree(void** arkode_mem) { sunindextype Cliw, Clrw; + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; - /* nothing to do if ark_mem is already NULL */ - if (ark_mem == NULL) { return; } + /* nothing to do if arkode_mem is already NULL */ + if (*arkode_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; @@ -632,23 +748,35 @@ void mriStep_Free(ARKodeMem ark_mem) free(ark_mem->step_mem); ark_mem->step_mem = NULL; } + + /* free memory for overall ARKODE infrastructure */ + arkFree(arkode_mem); } /*--------------------------------------------------------------- - mriStep_PrintMem: + MRIStepPrintMem: - This routine outputs the memory from the MRIStep structure to - a specified file pointer (useful when debugging). + This routine outputs the memory from the MRIStep structure and + the main ARKODE infrastructure to a specified file pointer + (useful when debugging). ---------------------------------------------------------------*/ -void mriStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) +void MRIStepPrintMem(void* arkode_mem, FILE* outfile) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int i, retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &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); @@ -732,9 +860,18 @@ void mriStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) /* print the inner stepper memory */ mriStepInnerStepper_PrintMem(step_mem->stepper, outfile); + return; } +/*=============================================================== + MRIStep Private functions + ===============================================================*/ + +/*--------------------------------------------------------------- + Interface routines supplied to ARKODE + ---------------------------------------------------------------*/ + /*--------------------------------------------------------------- mriStep_AttachLinsol: @@ -742,21 +879,21 @@ void mriStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) interface routines, data structure, and solver type to the MRIStep module. ---------------------------------------------------------------*/ -int mriStep_AttachLinsol(ARKodeMem ark_mem, ARKLinsolInitFn linit, +int mriStep_AttachLinsol(void* arkode_mem, ARKLinsolInitFn linit, ARKLinsolSetupFn lsetup, ARKLinsolSolveFn lsolve, ARKLinsolFreeFn lfree, - SUNDIALS_MAYBE_UNUSED SUNLinearSolver_Type lsolve_type, - void* lmem) + SUNLinearSolver_Type lsolve_type, void* lmem) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* free any existing system solver */ - if (step_mem->lfree != NULL) { step_mem->lfree(ark_mem); } + if (step_mem->lfree != NULL) { step_mem->lfree(arkode_mem); } /* Attach the provided routines, data structure and solve type */ step_mem->linit = linit; @@ -778,13 +915,14 @@ int mriStep_AttachLinsol(ARKodeMem ark_mem, ARKLinsolInitFn linit, This routine NULLifies the lsetup function pointer in the MRIStep module. ---------------------------------------------------------------*/ -void mriStep_DisableLSetup(ARKodeMem ark_mem) +void mriStep_DisableLSetup(void* arkode_mem) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return; } /* nullify the lsetup function pointer */ @@ -797,13 +935,14 @@ void mriStep_DisableLSetup(ARKodeMem ark_mem) This routine returns the system linear solver interface memory structure, lmem. ---------------------------------------------------------------*/ -void* mriStep_GetLmem(ARKodeMem ark_mem) +void* mriStep_GetLmem(void* arkode_mem) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure, and return lmem */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (NULL); } return (step_mem->lmem); } @@ -813,13 +952,14 @@ void* mriStep_GetLmem(ARKodeMem ark_mem) This routine returns the implicit RHS function pointer, fi. ---------------------------------------------------------------*/ -ARKRhsFn mriStep_GetImplicitRHS(ARKodeMem ark_mem) +ARKRhsFn mriStep_GetImplicitRHS(void* arkode_mem) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure, and return fi */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (NULL); } if (step_mem->implicit_rhs) { return (step_mem->fsi); } else { return (NULL); } @@ -831,14 +971,15 @@ ARKRhsFn mriStep_GetImplicitRHS(ARKodeMem ark_mem) This routine fills the current value of gamma, and states whether the gamma ratio fails the dgmax criteria. ---------------------------------------------------------------*/ -int mriStep_GetGammas(ARKodeMem ark_mem, sunrealtype* gamma, sunrealtype* gamrat, +int mriStep_GetGammas(void* arkode_mem, sunrealtype* gamma, sunrealtype* gamrat, sunbooleantype** jcur, sunbooleantype* dgamma_fail) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set outputs */ @@ -864,14 +1005,15 @@ int mriStep_GetGammas(ARKodeMem ark_mem, sunrealtype* gamma, sunrealtype* gamrat With other initialization types, this routine does nothing. ---------------------------------------------------------------*/ -int mriStep_Init(ARKodeMem ark_mem, int init_type) +int mriStep_Init(void* arkode_mem, int init_type) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval, j; sunbooleantype reset_efun; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* immediately return if reset */ @@ -918,23 +1060,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->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; + step_mem->stage_map = (int*)calloc(step_mem->stages, sizeof(int)); + ark_mem->liw += step_mem->stages; + retval = mriStepCoupling_GetStageMap(step_mem->MRIC, step_mem->stage_map, &(step_mem->nstages_active)); if (retval != ARK_SUCCESS) @@ -948,18 +1090,12 @@ 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->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 = (int*)calloc(step_mem->stages, sizeof(int)); + ark_mem->liw += step_mem->stages; + for (j = 0; j < step_mem->stages; j++) { step_mem->stagetypes[j] = mriStepCoupling_GetStageType(step_mem->MRIC, j); } @@ -968,70 +1104,23 @@ 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->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; + step_mem->Ae_row = (sunrealtype*)calloc(step_mem->stages, + sizeof(sunrealtype)); + ark_mem->lrw += step_mem->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->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; + step_mem->Ai_row = (sunrealtype*)calloc(step_mem->stages, + sizeof(sunrealtype)); + ark_mem->lrw += step_mem->stages; /* Allocate MRI RHS vector memory, update storage requirements */ /* Allocate Fse[0] ... Fse[nstages_active - 1] and */ @@ -1108,6 +1197,23 @@ 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); @@ -1118,25 +1224,28 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) return (ARK_MEM_FAIL); } - /* Override the interpolant degree (if needed), used in arkInitialSetup */ - if (step_mem->q > 1 && ark_mem->interp_degree > (step_mem->q - 1)) - { - /* 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) + /* Limit max interpolant degree (negative input only overwrites the current + interpolant degree if it is greater than abs(input). */ + if (ark_mem->interp != NULL) { - /* 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 (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)); + } - /* 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; + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Unable to update interpolation polynomial degree"); + return (ARK_ILL_INPUT); + } } } @@ -1196,14 +1305,15 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) Presently ff(t,y) is always called with ARK_FULLRHS_OTHER mode. ----------------------------------------------------------------------------*/ -int mriStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, +int mriStep_FullRHS(void* arkode_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(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* ensure that inner stepper provides fullrhs function */ @@ -1434,8 +1544,9 @@ int mriStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, reduce step and retry (if possible) <0 => step encountered unrecoverable failure ---------------------------------------------------------------*/ -int mriStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) +int mriStep_TakeStep(void* arkode_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 */ @@ -1446,7 +1557,7 @@ int mriStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) *dsmPtr = ZERO; /* access the MRIStep mem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* call nonlinear solver setup if it exists */ @@ -1497,19 +1608,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 +1666,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 +1704,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 +1734,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 +1744,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 @@ -1647,18 +1758,18 @@ int mriStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) return (ARK_SUCCESS); } -/*=============================================================== +/*--------------------------------------------------------------- Internal utility routines - ===============================================================*/ + ---------------------------------------------------------------*/ /*--------------------------------------------------------------- - mriStep_AccessARKODEStepMem: + mriStep_AccessStepMem: Shortcut routine to unpack ark_mem and step_mem structures from void* pointer. If either is missing it returns ARK_MEM_NULL. ---------------------------------------------------------------*/ -int mriStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, - ARKodeMem* ark_mem, ARKodeMRIStepMem* step_mem) +int mriStep_AccessStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeMRIStepMem* step_mem) { /* access ARKodeMem structure */ if (arkode_mem == NULL) @@ -1668,8 +1779,6 @@ int mriStep_AccessARKODEStepMem(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__, @@ -1680,26 +1789,6 @@ int mriStep_AccessARKODEStepMem(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: @@ -1727,8 +1816,6 @@ 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) @@ -1738,57 +1825,72 @@ 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 (q_actual) + 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_2; break; - case 4: table_id = MRISTEP_DEFAULT_IMEX_SD_2; break; + 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; } /**** implicit methods ****/ } else if (step_mem->implicit_rhs) { - switch (q_actual) + 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; + 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; } /**** explicit methods ****/ } else { - switch (q_actual) + 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 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; } } - step_mem->MRIC = MRIStepCoupling_LoadTable(table_id); if (step_mem->MRIC == NULL) { arkProcessError(ark_mem, ARK_INVALID_TABLE, __LINE__, __func__, __FILE__, @@ -2110,10 +2212,8 @@ 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, - SUNDIALS_MAYBE_UNUSED ARKodeMRIStepMem step_mem, - SUNDIALS_MAYBE_UNUSED int is, - SUNDIALS_MAYBE_UNUSED int* nflagPtr) +int mriStep_StageDIRKFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, int is, + int* nflagPtr) { #ifdef SUNDIALS_DEBUG printf(" MRIStep DIRK fast stage\n"); @@ -2161,7 +2261,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 +2277,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 @@ -2244,9 +2344,8 @@ int mriStep_StageDIRKNoFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, ARK_SUCCESS -- successful evaluation ---------------------------------------------------------------*/ -int mriStep_ComputeInnerForcing(SUNDIALS_MAYBE_UNUSED ARKodeMem ark_mem, - ARKodeMRIStepMem step_mem, int stage, - sunrealtype cdiff) +int mriStep_ComputeInnerForcing(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, + int stage, sunrealtype cdiff) { sunrealtype rcdiff; int j, k, nmat, nstore, retval; @@ -2316,7 +2415,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 @@ -2590,9 +2689,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) { @@ -2625,6 +2724,18 @@ int MRIStepInnerStepper_Create(SUNContext sunctx, MRIStepInnerStepper* stepper) return (ARK_SUCCESS); } +int MRIStepInnerStepper_CreateFromSUNStepper(SUNStepper sunstepper, + MRIStepInnerStepper* stepper) +{ + MRIStepInnerStepper_Create(sunstepper->sunctx, stepper); + MRIStepInnerStepper_SetContent(*stepper, sunstepper); + MRIStepInnerStepper_SetEvolveFn(*stepper, mriStepInnerStepper_EvolveSUNStepper); + MRIStepInnerStepper_SetFullRhsFn(*stepper, + mriStepInnerStepper_FullRhsSUNStepper); + MRIStepInnerStepper_SetResetFn(*stepper, mriStepInnerStepper_ResetSUNStepper); + return (ARK_SUCCESS); +} + int MRIStepInnerStepper_Free(MRIStepInnerStepper* stepper) { if (*stepper == NULL) { return ARK_SUCCESS; } @@ -2786,9 +2897,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) @@ -2825,6 +2936,18 @@ int mriStepInnerStepper_Evolve(MRIStepInnerStepper stepper, sunrealtype t0, return stepper->last_flag; } +int mriStepInnerStepper_EvolveSUNStepper(MRIStepInnerStepper stepper, + sunrealtype t0, sunrealtype tout, + N_Vector y) +{ + SUNStepper sunstepper = (SUNStepper)stepper->content; + sunrealtype tret; + int stop_reason; + stepper->last_flag = sunstepper->ops->advance(sunstepper, t0, tout, y, &tret, + &stop_reason); + return stepper->last_flag; +} + /* 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. */ @@ -2839,6 +2962,15 @@ 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 mode) +{ + SUNStepper sunstepper = (SUNStepper)stepper->content; + stepper->last_flag = sunstepper->ops->fullrhs(sunstepper, t, y, f, mode); + return stepper->last_flag; +} + /* Reset the inner (fast) stepper state */ int mriStepInnerStepper_Reset(MRIStepInnerStepper stepper, sunrealtype tR, N_Vector yR) @@ -2864,6 +2996,14 @@ int mriStepInnerStepper_Reset(MRIStepInnerStepper stepper, sunrealtype tR, } } +int mriStepInnerStepper_ResetSUNStepper(MRIStepInnerStepper stepper, + sunrealtype tR, N_Vector yR) +{ + SUNStepper sunstepper = (SUNStepper)stepper->content; + stepper->last_flag = sunstepper->ops->reset(sunstepper, tR, yR); + return stepper->last_flag; +} + /* Allocate MRI forcing and fused op workspace vectors if necessary */ int mriStepInnerStepper_AllocVecs(MRIStepInnerStepper stepper, int count, N_Vector tmpl) @@ -2906,7 +3046,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); @@ -2916,7 +3056,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 29caf263c3..2f31628917 100644 --- a/src/arkode/arkode_mristep_impl.h +++ b/src/arkode/arkode_mristep_impl.h @@ -37,17 +37,13 @@ extern "C" { #define MRISTAGE_DIRK_FAST 3 /* Implicit solver constants (duplicate from arkode_arkstep_impl.h) */ -/* 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 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 */ #define NLSCOEF SUN_RCONST(0.1) /*=============================================================== @@ -190,59 +186,23 @@ struct _MRIStepInnerStepper ===============================================================*/ /* Interface routines supplied to ARKODE */ -int mriStep_AttachLinsol(ARKodeMem ark_mem, ARKLinsolInitFn linit, +int mriStep_AttachLinsol(void* arkode_mem, ARKLinsolInitFn linit, ARKLinsolSetupFn lsetup, ARKLinsolSolveFn lsolve, ARKLinsolFreeFn lfree, SUNLinearSolver_Type lsolve_type, void* lmem); -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, +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, sunbooleantype** jcur, sunbooleantype* dgamma_fail); -int mriStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, +int mriStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); -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); +int mriStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr); /* Internal utility routines */ -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); +int mriStep_AccessStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeMRIStepMem* step_mem); sunbooleantype mriStep_CheckNVector(N_Vector tmpl); int mriStep_SetCoupling(ARKodeMem ark_mem); int mriStep_CheckCoupling(ARKodeMem ark_mem); @@ -270,10 +230,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_mristep_io.c b/src/arkode/arkode_mristep_io.c index d803141044..376bcb2385 100644 --- a/src/arkode/arkode_mristep_io.c +++ b/src/arkode/arkode_mristep_io.c @@ -24,197 +24,287 @@ #include "arkode_mristep_impl.h" /*=============================================================== - Exported optional input functions. + MRIStep Optional input functions (wrappers for generic ARKODE + utility routines). All are documented in arkode_io.c. ===============================================================*/ +int MRIStepSetDenseOrder(void* arkode_mem, int dord) +{ + return (MRIStepSetInterpolantDegree(arkode_mem, dord)); +} -/*--------------------------------------------------------------- - MRIStepSetCoupling: +int MRIStepSetInterpolantDegree(void* arkode_mem, int degree) +{ + if (degree < 0) { degree = ARK_INTERP_MAX_DEGREE; } + return (arkSetInterpolantDegree(arkode_mem, degree)); +} - Specifies to use a customized coupling structure for the slow - portion of the system. - ---------------------------------------------------------------*/ -int MRIStepSetCoupling(void* arkode_mem, MRIStepCoupling MRIC) +int MRIStepSetInterpolantType(void* arkode_mem, int itype) { - int retval; - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - sunindextype Tlrw, Tliw; + return (arkSetInterpolantType(arkode_mem, itype)); +} - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int MRIStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) +{ + return (arkSetMaxNumSteps(arkode_mem, mxsteps)); +} - /* check for illegal inputs */ - if (MRIC == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_MRISTEP_NO_COUPLING); - return (ARK_ILL_INPUT); - } +int MRIStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) +{ + return (arkSetMaxHnilWarns(arkode_mem, mxhnil)); +} - /* 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; +int MRIStepSetStopTime(void* arkode_mem, sunrealtype tstop) +{ + return (arkSetStopTime(arkode_mem, tstop)); +} - /* set the relevant parameters */ - step_mem->stages = MRIC->stages; - step_mem->q = MRIC->q; - step_mem->p = MRIC->p; +int MRIStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) +{ + return (arkSetInterpolateStopTime(arkode_mem, interp)); +} - /* 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 MRIStepClearStopTime(void* arkode_mem) +{ + return (arkClearStopTime(arkode_mem)); +} - return (ARK_SUCCESS); +int MRIStepSetRootDirection(void* arkode_mem, int* rootdir) +{ + return (arkSetRootDirection(arkode_mem, rootdir)); } -/*--------------------------------------------------------------- - MRIStepSetPreInnerFn: +int MRIStepSetNoInactiveRootWarn(void* arkode_mem) +{ + return (arkSetNoInactiveRootWarn(arkode_mem)); +} - Sets the user-supplied function called BEFORE the inner evolve +int MRIStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) +{ + return (arkSetPostprocessStepFn(arkode_mem, ProcessStep)); +} + +int MRIStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) +{ + return (arkSetPostprocessStageFn(arkode_mem, ProcessStage)); +} + +/*--------------------------------------------------------------- + These wrappers for ARKLs module 'set' routines all are + documented in arkode_mristep.h. ---------------------------------------------------------------*/ -int MRIStepSetPreInnerFn(void* arkode_mem, MRIStepPreInnerFn prefn) +int MRIStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) { - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - int retval; + return (arkLSSetLinearSolver(arkode_mem, LS, A)); +} - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int MRIStepSetJacFn(void* arkode_mem, ARKLsJacFn jac) +{ + return (arkLSSetJacFn(arkode_mem, jac)); +} - /* Set pre inner evolve function */ - step_mem->pre_inner_evolve = prefn; +int MRIStepSetJacEvalFrequency(void* arkode_mem, long int msbj) +{ + return (arkLSSetJacEvalFrequency(arkode_mem, msbj)); +} - return (ARK_SUCCESS); +int MRIStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) +{ + return (arkLSSetLinearSolutionScaling(arkode_mem, onoff)); } -/*--------------------------------------------------------------- - MRIStepSetPostInnerFn: +int MRIStepSetEpsLin(void* arkode_mem, sunrealtype eplifac) +{ + return (arkLSSetEpsLin(arkode_mem, eplifac)); +} - Sets the user-supplied function called AFTER the inner evolve - ---------------------------------------------------------------*/ -int MRIStepSetPostInnerFn(void* arkode_mem, MRIStepPostInnerFn postfn) +int MRIStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) { - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - int retval; + return (arkLSSetNormFactor(arkode_mem, nrmfac)); +} - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int MRIStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, + ARKLsPrecSolveFn psolve) +{ + return (arkLSSetPreconditioner(arkode_mem, psetup, psolve)); +} - /* Set pre inner evolve function */ - step_mem->post_inner_evolve = postfn; +int MRIStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, + ARKLsJacTimesVecFn jtimes) +{ + return (arkLSSetJacTimes(arkode_mem, jtsetup, jtimes)); +} - return (ARK_SUCCESS); +int MRIStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) +{ + return (arkLSSetJacTimesRhsFn(arkode_mem, jtimesRhsFn)); +} + +int MRIStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) +{ + return (arkLSSetLinSysFn(arkode_mem, linsys)); } /*=============================================================== - Exported optional output functions. + 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 (arkGetNumSteps(arkode_mem, nssteps)); +} -/*--------------------------------------------------------------- - MRIStepGetNumRhsEvals: +int MRIStepGetLastStep(void* arkode_mem, sunrealtype* hlast) +{ + return (arkGetLastStep(arkode_mem, hlast)); +} - Returns the current number of calls to fse and fsi - ---------------------------------------------------------------*/ -int MRIStepGetNumRhsEvals(void* arkode_mem, long int* nfse_evals, - long int* nfsi_evals) +int MRIStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) { - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - int retval; + return (arkGetCurrentTime(arkode_mem, tcur)); +} - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int MRIStepGetCurrentState(void* arkode_mem, N_Vector* state) +{ + return (arkGetCurrentState(arkode_mem, state)); +} - /* get number of fse and fsi evals from step_mem */ - *nfse_evals = step_mem->nfse; - *nfsi_evals = step_mem->nfsi; +int MRIStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) +{ + return (arkGetTolScaleFactor(arkode_mem, tolsfact)); +} - return (ARK_SUCCESS); +int MRIStepGetErrWeights(void* arkode_mem, N_Vector eweight) +{ + return (arkGetErrWeights(arkode_mem, eweight)); } -/*--------------------------------------------------------------- - MRIStepGetCurrentCoupling: +int MRIStepGetNumGEvals(void* arkode_mem, long int* ngevals) +{ + return (arkGetNumGEvals(arkode_mem, ngevals)); +} - Sets pointer to the slow coupling structure currently in use. - ---------------------------------------------------------------*/ -int MRIStepGetCurrentCoupling(void* arkode_mem, MRIStepCoupling* MRIC) +int MRIStepGetRootInfo(void* arkode_mem, int* rootsfound) { - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - int retval; + return (arkGetRootInfo(arkode_mem, rootsfound)); +} - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int MRIStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails) +{ + return (arkGetNumStepSolveFails(arkode_mem, nncfails)); +} - /* get coupling structure from step_mem */ - *MRIC = step_mem->MRIC; +int MRIStepGetUserData(void* arkode_mem, void** user_data) +{ + return (arkGetUserData(arkode_mem, user_data)); +} - return (ARK_SUCCESS); +char* MRIStepGetReturnFlagName(long int flag) +{ + return (arkGetReturnFlagName(flag)); } /*--------------------------------------------------------------- - MRIStepGetLastInnerStepFlag: - - Returns the last return value from the inner stepper. + These wrappers for ARKLs module 'get' routines all are + documented in arkode_mristep.h. ---------------------------------------------------------------*/ -int MRIStepGetLastInnerStepFlag(void* arkode_mem, int* flag) +int MRIStepGetJac(void* arkode_mem, SUNMatrix* J) { - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - int retval; + return arkLSGetJac(arkode_mem, J); +} - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int MRIStepGetJacTime(void* arkode_mem, sunrealtype* t_J) +{ + return arkLSGetJacTime(arkode_mem, t_J); +} - /* get the last return value from the inner stepper */ - *flag = step_mem->stepper->last_flag; +int MRIStepGetJacNumSteps(void* arkode_mem, long* nst_J) +{ + return arkLSGetJacNumSteps(arkode_mem, nst_J); +} - return (ARK_SUCCESS); +int MRIStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, long int* leniwLS) +{ + return (arkLSGetWorkSpace(arkode_mem, lenrwLS, leniwLS)); +} + +int MRIStepGetNumJacEvals(void* arkode_mem, long int* njevals) +{ + return (arkLSGetNumJacEvals(arkode_mem, njevals)); +} + +int MRIStepGetNumPrecEvals(void* arkode_mem, long int* npevals) +{ + return (arkLSGetNumPrecEvals(arkode_mem, npevals)); +} + +int MRIStepGetNumPrecSolves(void* arkode_mem, long int* npsolves) +{ + return (arkLSGetNumPrecSolves(arkode_mem, npsolves)); +} + +int MRIStepGetNumLinIters(void* arkode_mem, long int* nliters) +{ + return (arkLSGetNumLinIters(arkode_mem, nliters)); +} + +int MRIStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails) +{ + return (arkLSGetNumConvFails(arkode_mem, nlcfails)); +} + +int MRIStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups) +{ + return (arkLSGetNumJTSetupEvals(arkode_mem, njtsetups)); +} + +int MRIStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals) +{ + return (arkLSGetNumJtimesEvals(arkode_mem, njvevals)); +} + +int MRIStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) +{ + return (arkLSGetNumRhsEvals(arkode_mem, nfevalsLS)); +} + +int MRIStepGetLastLinFlag(void* arkode_mem, long int* flag) +{ + return (arkLSGetLastFlag(arkode_mem, flag)); +} + +char* MRIStepGetLinReturnFlagName(long int flag) +{ + return (arkLSGetReturnFlagName(flag)); } /*=============================================================== - Private functions attached to ARKODE + MRIStep optional input functions -- stepper-specific ===============================================================*/ /*--------------------------------------------------------------- - mriStep_SetUserData: + MRIStepSetUserData: - Passes user-data pointer to attached linear solver module. + Wrapper for generic arkSetUserData and arkLSSetUserData + routines. ---------------------------------------------------------------*/ -int mriStep_SetUserData(ARKodeMem ark_mem, void* user_data) +int MRIStepSetUserData(void* arkode_mem, void* user_data) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + 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); if (retval != ARK_SUCCESS) { return (retval); } /* set user data in ARKODELS mem */ if (step_mem->lmem != NULL) { - retval = arkLSSetUserData(ark_mem, user_data); + retval = arkLSSetUserData(arkode_mem, user_data); if (retval != ARKLS_SUCCESS) { return (retval); } } @@ -222,19 +312,20 @@ int mriStep_SetUserData(ARKodeMem ark_mem, void* user_data) } /*--------------------------------------------------------------- - mriStep_SetDefaults: + MRIStepSetDefaults: Resets all MRIStep optional inputs to their default values. Does not change problem-defining function pointers or user_data pointer. ---------------------------------------------------------------*/ -int mriStep_SetDefaults(ARKodeMem ark_mem) +int MRIStepSetDefaults(void* arkode_mem) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Set default values for integrator optional inputs */ @@ -257,13 +348,14 @@ int mriStep_SetDefaults(ARKodeMem ark_mem) step_mem->jcur = SUNFALSE; step_mem->convfail = ARK_NO_FAILURES; step_mem->stage_predict = NULL; /* no user-supplied stage predictor */ + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - mriStep_SetLinear: + MRIStepSetLinear: - Specifies that the implicit slow function, fsi(t,y), is linear + Specifies that the implicit slow function, fs(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 @@ -275,13 +367,14 @@ int mriStep_SetDefaults(ARKodeMem ark_mem) using an iterative linear solver this flag denotes time dependence of the preconditioner. ---------------------------------------------------------------*/ -int mriStep_SetLinear(ARKodeMem ark_mem, int timedepend) +int MRIStepSetLinear(void* arkode_mem, int timedepend) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set parameters */ @@ -293,20 +386,21 @@ int mriStep_SetLinear(ARKodeMem ark_mem, int timedepend) } /*--------------------------------------------------------------- - mriStep_SetNonlinear: + MRIStepSetNonlinear: - Specifies that the implicit slow function, fsi(t,y), is + Specifies that the implicit slow function, fs(t,y), is nonlinear in y. Used to undo a previous call to - mriStep_SetLinear. Automatically loosens DeltaGammaMax back to + MRIStepSetLinear. Automatically loosens DeltaGammaMax back to default value. ---------------------------------------------------------------*/ -int mriStep_SetNonlinear(ARKodeMem ark_mem) +int MRIStepSetNonlinear(void* arkode_mem) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set parameters */ @@ -318,22 +412,26 @@ int mriStep_SetNonlinear(ARKodeMem ark_mem) } /*--------------------------------------------------------------- - mriStep_SetOrder: + MRIStepSetOrder: Specifies the method order + + NOTE: This should not be called along with MRIStepSetCoupling. + Any user-supplied coupling table will specify the order. ---------------------------------------------------------------*/ -int mriStep_SetOrder(ARKodeMem ark_mem, int ord) +int MRIStepSetOrder(void* arkode_mem, int ord) { int retval; + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; sunindextype Tlrw, Tliw; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval) { return (retval); } /* check for illegal inputs */ - if (ord <= 0) { step_mem->q = 3; } + if (ord < 3 || ord > 4) { step_mem->q = 3; } else { step_mem->q = ord; } /* Clear tables, the user is requesting a change in method or a reset to @@ -350,19 +448,145 @@ int mriStep_SetOrder(ARKodeMem ark_mem, int ord) } /*--------------------------------------------------------------- - mriStep_SetNonlinCRDown: + MRIStepSetCoupling: + + 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 ARKodeMRIStepMem structure */ + retval = mriStep_AccessStepMem(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 ARKodeMRIStepMem structure */ + retval = mriStep_AccessStepMem(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 ARKodeMRIStepMem structure */ + retval = mriStep_AccessStepMem(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); +} + +/*--------------------------------------------------------------- + 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: 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) +int MRIStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if argument legal set it, otherwise set default */ @@ -373,19 +597,20 @@ int mriStep_SetNonlinCRDown(ARKodeMem ark_mem, sunrealtype crdown) } /*--------------------------------------------------------------- - mriStep_SetNonlinRDiv: + MRIStepSetNonlinRDiv: Specifies the user-provided nonlinear convergence constant rdiv. Legal values are strictly positive; illegal values imply a reset to the default. ---------------------------------------------------------------*/ -int mriStep_SetNonlinRDiv(ARKodeMem ark_mem, sunrealtype rdiv) +int MRIStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if argument legal set it, otherwise set default */ @@ -396,19 +621,20 @@ int mriStep_SetNonlinRDiv(ARKodeMem ark_mem, sunrealtype rdiv) } /*--------------------------------------------------------------- - mriStep_SetDeltaGammaMax: + MRIStepSetDeltaGammaMax: Specifies the user-provided linear setup decision constant dgmax. Legal values are strictly positive; illegal values imply a reset to the default. ---------------------------------------------------------------*/ -int mriStep_SetDeltaGammaMax(ARKodeMem ark_mem, sunrealtype dgmax) +int MRIStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if argument legal set it, otherwise set default */ @@ -419,20 +645,21 @@ int mriStep_SetDeltaGammaMax(ARKodeMem ark_mem, sunrealtype dgmax) } /*--------------------------------------------------------------- - mriStep_SetLSetupFrequency: + MRIStepSetLSetupFrequency: 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 mriStep_SetLSetupFrequency(ARKodeMem ark_mem, int msbp) +int MRIStepSetLSetupFrequency(void* arkode_mem, int msbp) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if argument legal set it, otherwise set default */ @@ -443,19 +670,20 @@ int mriStep_SetLSetupFrequency(ARKodeMem ark_mem, int msbp) } /*--------------------------------------------------------------- - mriStep_SetPredictorMethod: + MRIStepSetPredictorMethod: 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 mriStep_SetPredictorMethod(ARKodeMem ark_mem, int pred_method) +int MRIStepSetPredictorMethod(void* arkode_mem, int pred_method) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set parameter */ @@ -465,19 +693,20 @@ int mriStep_SetPredictorMethod(ARKodeMem ark_mem, int pred_method) } /*--------------------------------------------------------------- - mriStep_SetMaxNonlinIters: + MRIStepSetMaxNonlinIters: Specifies the maximum number of nonlinear iterations during one solve. A non-positive input implies a reset to the default value. ---------------------------------------------------------------*/ -int mriStep_SetMaxNonlinIters(ARKodeMem ark_mem, int maxcor) +int MRIStepSetMaxNonlinIters(void* arkode_mem, int maxcor) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Return error message if no NLS module is present */ @@ -505,18 +734,19 @@ int mriStep_SetMaxNonlinIters(ARKodeMem ark_mem, int maxcor) } /*--------------------------------------------------------------- - mriStep_SetNonlinConvCoef: + MRIStepSetNonlinConvCoef: Specifies the coefficient in the nonlinear solver convergence test. A non-positive input implies a reset to the default value. ---------------------------------------------------------------*/ -int mriStep_SetNonlinConvCoef(ARKodeMem ark_mem, sunrealtype nlscoef) +int MRIStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* argument <= 0 sets default, otherwise set input */ @@ -527,17 +757,18 @@ int mriStep_SetNonlinConvCoef(ARKodeMem ark_mem, sunrealtype nlscoef) } /*--------------------------------------------------------------- - mriStep_SetStagePredictFn: Specifies a user-provided step + MRIStepSetStagePredictFn: Specifies a user-provided step predictor function having type ARKStagePredictFn. A NULL input function disables calls to this routine. ---------------------------------------------------------------*/ -int mriStep_SetStagePredictFn(ARKodeMem ark_mem, ARKStagePredictFn PredictStage) +int MRIStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure and set function pointer */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } step_mem->stage_predict = PredictStage; @@ -545,7 +776,7 @@ int mriStep_SetStagePredictFn(ARKodeMem ark_mem, ARKStagePredictFn PredictStage) } /*--------------------------------------------------------------- - mriStep_SetDeduceImplicitRhs: + MRIStepSetDeduceImplicitRhs: Specifies if an optimization is used to avoid an evaluation of fi after a nonlinear solve for an implicit stage. If stage @@ -556,44 +787,116 @@ int mriStep_SetStagePredictFn(ARKodeMem ark_mem, ARKStagePredictFn PredictStage) fi(z_i), and SUNFALSE indicates that fi(z_i) is computed with an additional evaluation of fi. ---------------------------------------------------------------*/ -int mriStep_SetDeduceImplicitRhs(ARKodeMem ark_mem, sunbooleantype deduce) +int MRIStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure and set function pointer */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } step_mem->deduce_rhs = deduce; return (ARK_SUCCESS); } +/*=============================================================== + 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: + + 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 ARKodeMRIStepMem structure */ + retval = mriStep_AccessStepMem(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 + MRIStepGetCurrentGamma: Returns the current value of gamma ---------------------------------------------------------------*/ -int mriStep_GetCurrentGamma(ARKodeMem ark_mem, sunrealtype* gamma) +int MRIStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma) { int retval; + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } *gamma = step_mem->gamma; return (retval); } /*--------------------------------------------------------------- - mriStep_GetNumLinSolvSetups: + 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 ARKodeMRIStepMem structure */ + retval = mriStep_AccessStepMem(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); +} + +/*--------------------------------------------------------------- + MRIStepGetNumLinSolvSetups: Returns the current number of calls to the lsetup routine ---------------------------------------------------------------*/ -int mriStep_GetNumLinSolvSetups(ARKodeMem ark_mem, long int* nlinsetups) +int MRIStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* get value from step_mem */ @@ -603,17 +906,18 @@ int mriStep_GetNumLinSolvSetups(ARKodeMem ark_mem, long int* nlinsetups) } /*--------------------------------------------------------------- - mriStep_GetNumNonlinSolvIters: + MRIStepGetNumNonlinSolvIters: Returns the current number of nonlinear solver iterations ---------------------------------------------------------------*/ -int mriStep_GetNumNonlinSolvIters(ARKodeMem ark_mem, long int* nniters) +int MRIStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } *nniters = step_mem->nls_iters; @@ -622,17 +926,18 @@ int mriStep_GetNumNonlinSolvIters(ARKodeMem ark_mem, long int* nniters) } /*--------------------------------------------------------------- - mriStep_GetNumNonlinSolvConvFails: + MRIStepGetNumNonlinSolvConvFails: Returns the current number of nonlinear solver convergence fails ---------------------------------------------------------------*/ -int mriStep_GetNumNonlinSolvConvFails(ARKodeMem ark_mem, long int* nnfails) +int MRIStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set output from step_mem */ @@ -642,18 +947,19 @@ int mriStep_GetNumNonlinSolvConvFails(ARKodeMem ark_mem, long int* nnfails) } /*--------------------------------------------------------------- - mriStep_GetNonlinSolvStats: + MRIStepGetNonlinSolvStats: Returns nonlinear solver statistics ---------------------------------------------------------------*/ -int mriStep_GetNonlinSolvStats(ARKodeMem ark_mem, long int* nniters, - long int* nnfails) +int MRIStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, + long int* nnfails) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } *nniters = step_mem->nls_iters; @@ -663,18 +969,44 @@ int mriStep_GetNonlinSolvStats(ARKodeMem ark_mem, long int* nniters, } /*--------------------------------------------------------------- - mriStep_PrintAllStats: + 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 ARKodeMRIStepMem structure */ + retval = mriStep_AccessStepMem(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); +} + +/*--------------------------------------------------------------- + MRIStepPrintAllStats: Prints integrator statistics ---------------------------------------------------------------*/ -int mriStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) +int MRIStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; ARKLsMem arkls_mem; int retval; /* access ARKode MRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + 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); if (retval != ARK_SUCCESS) { return (retval); } switch (fmt) @@ -695,9 +1027,9 @@ int mriStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) /* linear solver stats */ fprintf(outfile, "LS setups = %ld\n", step_mem->nsetups); - if (ark_mem->step_getlinmem(ark_mem)) + if (ark_mem->step_getlinmem(arkode_mem)) { - arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(ark_mem)); + arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(arkode_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); @@ -737,9 +1069,9 @@ int mriStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) /* linear solver stats */ fprintf(outfile, ",LS setups,%ld", step_mem->nsetups); - if (ark_mem->step_getlinmem(ark_mem)) + if (ark_mem->step_getlinmem(arkode_mem)) { - arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(ark_mem)); + arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(arkode_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); @@ -776,392 +1108,51 @@ int mriStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) return (ARK_SUCCESS); } +/*=============================================================== + MRIStep parameter output + ===============================================================*/ + /*--------------------------------------------------------------- - mriStep_WriteParameters: + MRIStepWriteParameters: Outputs all solver parameters to the provided file pointer. ---------------------------------------------------------------*/ -int mriStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) +int MRIStepWriteParameters(void* arkode_mem, FILE* fp) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* 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) - { - 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) + /* output ARKODE infrastructure parameters first */ + retval = arkWriteParameters(arkode_mem, fp); + if (retval != ARK_SUCCESS) { - 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); + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "Error writing ARKODE infrastructure parameters"); + return (retval); } - fprintf(fp, "\n"); return (ARK_SUCCESS); } -/*=============================================================== - Exported-but-deprecated user-callable functions. - ===============================================================*/ +/*--------------------------------------------------------------- + MRIStepWriteCoupling: -int MRIStepResize(void* arkode_mem, N_Vector y0, sunrealtype t0, - ARKVecResizeFn resize, void* resize_data) + Outputs coupling structure to the provided file pointer. + ---------------------------------------------------------------*/ +int MRIStepWriteCoupling(void* arkode_mem, FILE* fp) { - return (ARKodeResize(arkode_mem, y0, ONE, t0, resize, resize_data)); -} + ARKodeMem ark_mem; + ARKodeMRIStepMem step_mem; + int retval; -int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) -{ - return (ARKodeReset(arkode_mem, tR, yR)); -} - -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 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); } + /* access ARKodeMRIStepMem structure */ + retval = mriStep_AccessStepMem(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) @@ -1178,113 +1169,6 @@ int MRIStepWriteCoupling(void* arkode_mem, FILE* 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 882eedad75..a48ae86d56 100644 --- a/src/arkode/arkode_mristep_nls.c +++ b/src/arkode/arkode_mristep_nls.c @@ -24,22 +24,23 @@ #include "arkode_mristep_impl.h" /*=============================================================== - Interface routines supplied to ARKODE + Exported functions ===============================================================*/ /*--------------------------------------------------------------- - mriStep_SetNonlinearSolver: + MRIStepSetNonlinearSolver: This routine attaches a SUNNonlinearSolver object to the MRIStep module. ---------------------------------------------------------------*/ -int mriStep_SetNonlinearSolver(ARKodeMem ark_mem, SUNNonlinearSolver NLS) +int MRIStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Return immediately if NLS input is NULL */ @@ -93,7 +94,7 @@ int mriStep_SetNonlinearSolver(ARKodeMem ark_mem, SUNNonlinearSolver NLS) /* set convergence test function */ retval = SUNNonlinSolSetConvTestFn(step_mem->NLS, mriStep_NlsConvTest, - (void*)ark_mem); + arkode_mem); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, @@ -128,19 +129,20 @@ int mriStep_SetNonlinearSolver(ARKodeMem ark_mem, SUNNonlinearSolver NLS) } /*--------------------------------------------------------------- - mriStep_SetNlsRhsFn: + MRIStepSetNlsRhsFn: This routine sets an alternative user-supplied slow ODE right-hand side function to use in the evaluation of nonlinear system functions. ---------------------------------------------------------------*/ -int mriStep_SetNlsRhsFn(ARKodeMem ark_mem, ARKRhsFn nls_fsi) +int MRIStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fsi) { + ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } if (nls_fsi) { step_mem->nls_fsi = nls_fsi; } @@ -150,21 +152,22 @@ int mriStep_SetNlsRhsFn(ARKodeMem ark_mem, ARKRhsFn nls_fsi) } /*--------------------------------------------------------------- - mriStep_GetNonlinearSystemData: + MRIStepGetNonlinearSystemData: This routine provides access to the relevant data needed to compute the nonlinear system function. ---------------------------------------------------------------*/ -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) +int MRIStepGetNonlinearSystemData(void* arkode_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(ark_mem, __func__, &step_mem); + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } *tcur = ark_mem->tcur; @@ -178,9 +181,9 @@ int mriStep_GetNonlinearSystemData(ARKodeMem ark_mem, sunrealtype* tcur, return (ARK_SUCCESS); } -/*=============================================================== +/*--------------------------------------------------------------- Utility routines called by MRIStep - ===============================================================*/ + ---------------------------------------------------------------*/ /*--------------------------------------------------------------- mriStep_NlsInit: @@ -328,7 +331,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 @@ -353,9 +356,9 @@ int mriStep_Nls(ARKodeMem ark_mem, int nflag) return (retval); } -/*=============================================================== +/*--------------------------------------------------------------- Interface routines supplied to the SUNNonlinearSolver module - ===============================================================*/ + ---------------------------------------------------------------*/ /*--------------------------------------------------------------- mriStep_NlsLSetup: @@ -369,8 +372,8 @@ int mriStep_NlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* arkode_me ARKodeMRIStepMem step_mem; int retval; - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMRIStepMem structure */ + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update convfail based on jbad flag */ @@ -412,8 +415,8 @@ int mriStep_NlsLSolve(N_Vector b, void* arkode_mem) ARKodeMRIStepMem step_mem; int retval, nonlin_iter; - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMRIStepMem structure */ + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* retrieve nonlinear solver iteration from module */ @@ -459,8 +462,8 @@ int mriStep_NlsResidual(N_Vector zcor, N_Vector r, void* arkode_mem) sunrealtype c[3]; N_Vector X[3]; - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMRIStepMem structure */ + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update 'ycur' value as stored predictor + current corrector */ @@ -514,8 +517,8 @@ int mriStep_NlsFPFunction(N_Vector zcor, N_Vector g, void* arkode_mem) ARKodeMRIStepMem step_mem; int retval; - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMRIStepMem structure */ + retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update 'ycur' value as stored predictor + current corrector */ @@ -556,8 +559,7 @@ 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, - SUNDIALS_MAYBE_UNUSED N_Vector y, N_Vector del, +int mriStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, sunrealtype tol, N_Vector ewt, void* arkode_mem) { /* temporary variables */ @@ -566,8 +568,8 @@ int mriStep_NlsConvTest(SUNNonlinearSolver NLS, sunrealtype delnrm, dcon; int m, retval; - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMRIStepMem structure */ + retval = mriStep_AccessStepMem(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 c911077580..f9de44e45c 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 */ -static int arkRelaxSolve(ARKodeMem ark_mem, ARKodeRelaxMem relax_mem, - sunrealtype* relax_val_out) +int arkRelaxSolve(ARKodeMem ark_mem, ARKodeRelaxMem relax_mem, + sunrealtype* relax_val_out) { int retval; @@ -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 @@ -415,31 +415,7 @@ static int arkRelaxSolve(ARKodeMem ark_mem, ARKodeRelaxMem relax_mem, * Set functions * ---------------------------------------------------------------------------*/ -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 arkRelaxSetEtaFail(void* arkode_mem, sunrealtype eta_fail) { int retval; ARKodeMem ark_mem; @@ -448,21 +424,13 @@ int ARKodeSetRelaxEtaFail(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 ARKodeSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) +int arkRelaxSetLowerBound(void* arkode_mem, sunrealtype lower) { int retval; ARKodeMem ark_mem; @@ -471,21 +439,13 @@ int ARKodeSetRelaxLowerBound(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 ARKodeSetRelaxMaxFails(void* arkode_mem, int max_fails) +int arkRelaxSetMaxFails(void* arkode_mem, int max_fails) { int retval; ARKodeMem ark_mem; @@ -494,21 +454,13 @@ int ARKodeSetRelaxMaxFails(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 ARKodeSetRelaxMaxIters(void* arkode_mem, int max_iters) +int arkRelaxSetMaxIters(void* arkode_mem, int max_iters) { int retval; ARKodeMem ark_mem; @@ -517,21 +469,13 @@ int ARKodeSetRelaxMaxIters(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 ARKodeSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver) +int arkRelaxSetSolver(void* arkode_mem, ARKRelaxSolver solver) { int retval; ARKodeMem ark_mem; @@ -540,14 +484,6 @@ int ARKodeSetRelaxSolver(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__, @@ -560,7 +496,7 @@ int ARKodeSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver) return ARK_SUCCESS; } -int ARKodeSetRelaxResTol(void* arkode_mem, sunrealtype res_tol) +int arkRelaxSetResTol(void* arkode_mem, sunrealtype res_tol) { int retval; ARKodeMem ark_mem; @@ -569,21 +505,13 @@ int ARKodeSetRelaxResTol(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 ARKodeSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) +int arkRelaxSetTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) { int retval; ARKodeMem ark_mem; @@ -592,14 +520,6 @@ int ARKodeSetRelaxTol(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; } @@ -609,7 +529,7 @@ int ARKodeSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol return ARK_SUCCESS; } -int ARKodeSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) +int arkRelaxSetUpperBound(void* arkode_mem, sunrealtype upper) { int retval; ARKodeMem ark_mem; @@ -618,14 +538,6 @@ int ARKodeSetRelaxUpperBound(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; } @@ -636,7 +548,7 @@ int ARKodeSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) * Get functions * ---------------------------------------------------------------------------*/ -int ARKodeGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals) +int arkRelaxGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals) { int retval; ARKodeMem ark_mem; @@ -645,20 +557,12 @@ int ARKodeGetNumRelaxFnEvals(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 ARKodeGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) +int arkRelaxGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) { int retval; ARKodeMem ark_mem; @@ -667,20 +571,12 @@ int ARKodeGetNumRelaxJacEvals(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 ARKodeGetNumRelaxFails(void* arkode_mem, long int* relax_fails) +int arkRelaxGetNumRelaxFails(void* arkode_mem, long int* relax_fails) { int retval; ARKodeMem ark_mem; @@ -689,20 +585,12 @@ int ARKodeGetNumRelaxFails(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 ARKodeGetNumRelaxSolveFails(void* arkode_mem, long int* fails) +int arkRelaxGetNumRelaxSolveFails(void* arkode_mem, long int* fails) { int retval; ARKodeMem ark_mem; @@ -711,20 +599,12 @@ int ARKodeGetNumRelaxSolveFails(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 ARKodeGetNumRelaxBoundFails(void* arkode_mem, long int* fails) +int arkRelaxGetNumRelaxBoundFails(void* arkode_mem, long int* fails) { int retval; ARKodeMem ark_mem; @@ -733,20 +613,12 @@ int ARKodeGetNumRelaxBoundFails(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 ARKodeGetNumRelaxSolveIters(void* arkode_mem, long int* iters) +int arkRelaxGetNumRelaxSolveIters(void* arkode_mem, long int* iters) { int retval; ARKodeMem ark_mem; @@ -755,16 +627,50 @@ int ARKodeGetNumRelaxSolveIters(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) + *iters = relax_mem->nls_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) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not support relaxation"); - return (ARK_STEPPER_UNSUPPORTED); + 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; } - *iters = relax_mem->nls_iters; - return ARK_SUCCESS; } @@ -773,10 +679,21 @@ int ARKodeGetNumRelaxSolveIters(void* arkode_mem, long int* iters) * ===========================================================================*/ /* Constructor called by stepper */ -int arkRelaxCreate(ARKodeMem ark_mem, ARKRelaxFn relax_fn, +int arkRelaxCreate(void* arkode_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) { @@ -857,7 +774,8 @@ int arkRelaxDestroy(ARKodeRelaxMem relax_mem) } /* Compute and apply relaxation, called by driver */ -int arkRelax(ARKodeMem ark_mem, int* relax_fails, sunrealtype* dsm_inout) +int arkRelax(ARKodeMem ark_mem, int* relax_fails, sunrealtype* dsm_inout, + int* nflag_out) { int retval; sunrealtype relax_val; @@ -923,49 +841,6 @@ 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_relaxation_impl.h b/src/arkode/arkode_relaxation_impl.h index 57830d38ff..c52cb2521c 100644 --- a/src/arkode/arkode_relaxation_impl.h +++ b/src/arkode/arkode_relaxation_impl.h @@ -99,13 +99,30 @@ struct ARKodeRelaxMemRec * ---------------------------------------------------------------------------*/ /* Driver and Stepper Functions */ -int arkRelaxCreate(ARKodeMem ark_mem, ARKRelaxFn relax_fn, +int arkRelaxCreate(void* arkode_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 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 05d0a4a08c..a0e02df7e7 100644 --- a/src/arkode/arkode_root.c +++ b/src/arkode/arkode_root.c @@ -24,34 +24,28 @@ #include "arkode_impl.h" -/*=============================================================== - Exported functions - ===============================================================*/ - /*--------------------------------------------------------------- - ARKodeRootInit: + arkRootInit: - ARKodeRootInit initializes a rootfinding problem to be solved + arkRootInit initializes a rootfinding problem to be solved during the integration of the ODE system. It loads the root function pointer and the number of root functions, 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 ARKodeRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) +int arkRootInit(ARKodeMem ark_mem, int nrtfn, ARKRootFn g) { int i, nrt; - /* unpack ark_mem */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) + /* Check ark_mem pointer */ + if (ark_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } - ark_mem = (ARKodeMem)arkode_mem; - nrt = (nrtfn < 0) ? 0 : nrtfn; + nrt = (nrtfn < 0) ? 0 : nrtfn; /* Ensure that stepper provides fullrhs function */ if (nrt > 0) @@ -97,7 +91,7 @@ int ARKodeRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) ark_mem->liw += ARK_ROOT_LIW; } - /* If rerunning ARKodeRootInit() with a different number of root + /* If rerunning arkRootInit() 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)) @@ -119,7 +113,7 @@ int ARKodeRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) ark_mem->liw -= 3 * (ark_mem->root_mem->nrtfn); } - /* If ARKodeRootInit() was called with nrtfn == 0, then set + /* If arkRootInit() was called with nrtfn == 0, then set nrtfn to zero and gfun to NULL before returning */ if (nrt == 0) { @@ -128,7 +122,7 @@ int ARKodeRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) return (ARK_SUCCESS); } - /* If rerunning ARKodeRootInit() with the same number of root + /* If rerunning arkRootInit() 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 @@ -271,10 +265,6 @@ int ARKodeRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) return (ARK_SUCCESS); } -/*=============================================================== - Private functions - ===============================================================*/ - /*--------------------------------------------------------------- arkRootFree @@ -509,7 +499,7 @@ int arkRootCheck2(void* arkode_mem) if (rootmem->irfnd == 0) { return (ARK_SUCCESS); } /* Set ark_ycur = y(tlo) */ - (void)ARKodeGetDky(ark_mem, rootmem->tlo, 0, ark_mem->ycur); + (void)arkGetDky(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, @@ -549,7 +539,7 @@ int arkRootCheck2(void* arkode_mem) else { /* set ark_ycur = y(tplus) via interpolation */ - (void)ARKodeGetDky(ark_mem, tplus, 0, ark_mem->ycur); + (void)arkGetDky(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); @@ -619,7 +609,7 @@ int arkRootCheck3(void* arkode_mem) else { rootmem->thi = rootmem->toutc; - (void)ARKodeGetDky(ark_mem, rootmem->thi, 0, ark_mem->ycur); + (void)arkGetDky(ark_mem, rootmem->thi, 0, ark_mem->ycur); } } @@ -647,7 +637,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)ARKodeGetDky(ark_mem, rootmem->trout, 0, ark_mem->ycur); + (void)arkGetDky(ark_mem, rootmem->trout, 0, ark_mem->ycur); return (RTFOUND); } @@ -836,7 +826,7 @@ int arkRootfind(void* arkode_mem) tmid = rootmem->thi - fracsub * (rootmem->thi - rootmem->tlo); } - (void)ARKodeGetDky(ark_mem, tmid, 0, ark_mem->ycur); + (void)arkGetDky(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_root_impl.h b/src/arkode/arkode_root_impl.h index 8e410b6927..6b4d66704b 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 +#define ARK_ROOT_LIW 12 /* int, ptr, etc */ /* Numeric constants */ -#define HUND SUN_RCONST(100.0) +#define HUND SUN_RCONST(100.0) /* real 100.0 */ /*=============================================================== ARKODE Root-finding Data Structure diff --git a/src/arkode/arkode_sprk.c b/src/arkode/arkode_sprk.c index a7d0349416..65d1a07069 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" -static ARKodeSPRKTable arkodeSymplecticEuler(void) +ARKodeSPRKTable ARKodeSymplecticEuler(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(1); if (!sprk_table) { return NULL; } @@ -43,7 +43,7 @@ static ARKodeSPRKTable arkodeSymplecticEuler(void) https://doi.org/10.1016/0021-9991(91)90299-Z. */ -static ARKodeSPRKTable arkodeSymplecticLeapfrog2(void) +ARKodeSPRKTable ARKodeSymplecticLeapfrog2(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(2); if (!sprk_table) { return NULL; } @@ -56,7 +56,7 @@ static ARKodeSPRKTable arkodeSymplecticLeapfrog2(void) return sprk_table; } -static ARKodeSPRKTable arkodeSymplecticPseudoLeapfrog2(void) +ARKodeSPRKTable ARKodeSymplecticPseudoLeapfrog2(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(2); if (!sprk_table) { return NULL; } @@ -69,7 +69,7 @@ static ARKodeSPRKTable arkodeSymplecticPseudoLeapfrog2(void) return sprk_table; } -static ARKodeSPRKTable arkodeSymplecticCandyRozmus4(void) +ARKodeSPRKTable ARKodeSymplecticCandyRozmus4(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(4); if (!sprk_table) { return NULL; } @@ -108,7 +108,7 @@ static ARKodeSPRKTable arkodeSymplecticCandyRozmus4(void) https://accelconf.web.cern.ch/p83/PDF/PAC1983_2669.PDF */ -static ARKodeSPRKTable arkodeSymplecticRuth3(void) +ARKodeSPRKTable ARKodeSymplecticRuth3(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(3); if (!sprk_table) { return NULL; } @@ -130,14 +130,14 @@ static ARKodeSPRKTable arkodeSymplecticRuth3(void) Nonlinearity. 5, 541–562 (1992). https://doi.org/10.1088/0951-7715/5/2/011 */ -static ARKodeSPRKTable arkodeSymplecticMcLachlan2(void) +ARKodeSPRKTable ARKodeSymplecticMcLachlan2(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(2); 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(SUN_RCONST(2.0)); + sprk_table->a[1] = SUN_RCONST(1.0) - + (SUN_RCONST(1.0) / SUN_RCONST(2.0)) * SUNRsqrt(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])); @@ -145,11 +145,11 @@ static ARKodeSPRKTable arkodeSymplecticMcLachlan2(void) return sprk_table; } -static ARKodeSPRKTable arkodeSymplecticMcLachlan3(void) +ARKodeSPRKTable ARKodeSymplecticMcLachlan3(void) { - sunrealtype w = SUN_RCONST(0.0); - sunrealtype y = SUN_RCONST(0.0); - sunrealtype z = SUN_RCONST(0.0); + sunrealtype w = 0.0; + sunrealtype y = 0.0; + sunrealtype z = 0.0; ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(3); if (!sprk_table) { return NULL; } @@ -157,8 +157,7 @@ static 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(SUN_RCONST(3.0))), + SUN_RCONST(1.0) / (SUN_RCONST(9.0) * SUNRsqrt(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; @@ -175,7 +174,7 @@ static ARKodeSPRKTable arkodeSymplecticMcLachlan3(void) return sprk_table; } -static ARKodeSPRKTable arkodeSymplecticMcLachlan4(void) +ARKodeSPRKTable ARKodeSymplecticMcLachlan4(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(4); if (!sprk_table) { return NULL; } @@ -192,7 +191,7 @@ static ARKodeSPRKTable arkodeSymplecticMcLachlan4(void) return sprk_table; } -static ARKodeSPRKTable arkodeSymplecticMcLachlan5(void) +ARKodeSPRKTable ARKodeSymplecticMcLachlan5(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(6); if (!sprk_table) { return NULL; } @@ -222,7 +221,7 @@ static ARKodeSPRKTable arkodeSymplecticMcLachlan5(void) */ -static ARKodeSPRKTable arkodeSymplecticYoshida6(void) +ARKodeSPRKTable ARKodeSymplecticYoshida6(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(8); if (!sprk_table) { return NULL; } @@ -261,7 +260,7 @@ static ARKodeSPRKTable arkodeSymplecticYoshida6(void) */ -static ARKodeSPRKTable arkodeSymplecticSuzukiUmeno816(void) +ARKodeSPRKTable ARKodeSymplecticSuzukiUmeno816(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(16); if (!sprk_table) { return NULL; } @@ -311,7 +310,7 @@ static ARKodeSPRKTable arkodeSymplecticSuzukiUmeno816(void) */ -static ARKodeSPRKTable arkodeSymplecticSofroniou10(void) +ARKodeSPRKTable ARKodeSymplecticSofroniou10(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(36); if (!sprk_table) { return NULL; } @@ -404,15 +403,16 @@ static ARKodeSPRKTable arkodeSymplecticSofroniou10(void) ARKodeSPRKTable ARKodeSPRKTable_Create(int s, int q, const sunrealtype* a, const sunrealtype* ahat) { - if (s < 1 || !a || !ahat) { return NULL; } + int i = 0; + ARKodeSPRKTable sprk_table = NULL; - ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(s); + sprk_table = (ARKodeSPRKTable)malloc(sizeof(struct ARKodeSPRKTableMem)); if (!sprk_table) { return NULL; } sprk_table->stages = s; sprk_table->q = q; - for (int i = 0; i < s; i++) + for (i = 0; i < s; i++) { sprk_table->a[i] = a[i]; sprk_table->ahat[i] = ahat[i]; @@ -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.c b/src/arkode/arkode_sprkstep.c index 0ae21c2741..7ac45ee764 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -30,7 +30,7 @@ #include "arkode_sprkstep_impl.h" /*=============================================================== - Exported functions + SPRKStep Exported functions -- Required ===============================================================*/ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, @@ -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))) { - ARKodeFree((void**)&ark_mem); + SPRKStepFree((void**)&ark_mem); return (NULL); } @@ -111,29 +111,23 @@ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, { if (!arkAllocVec(ark_mem, y0, &(step_mem->yerr))) { - ARKodeFree((void**)&ark_mem); + SPRKStepFree((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_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); + 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); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Error setting default solver options"); - ARKodeFree((void**)&ark_mem); + SPRKStepFree((void**)&ark_mem); return (NULL); } @@ -151,7 +145,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. */ - ARKodeSetInterpolantType(ark_mem, ARK_INTERP_LAGRANGE); + arkSetInterpolantType(ark_mem, ARK_INTERP_LAGRANGE); /* Initialize main ARKODE infrastructure */ retval = arkInit(ark_mem, t0, y0, FIRST_INIT); @@ -159,7 +153,7 @@ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Unable to initialize main ARKODE infrastructure"); - ARKodeFree((void**)&ark_mem); + SPRKStepFree((void**)&ark_mem); return (NULL); } @@ -184,9 +178,8 @@ int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, 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(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Check if ark_mem was allocated */ @@ -237,91 +230,102 @@ int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, return (ARK_SUCCESS); } -/*=============================================================== - Interface routines supplied to ARKODE - ===============================================================*/ - /*--------------------------------------------------------------- - sprkStep_Resize: + SPRKStepReset: - This routine resizes the memory within the SPRKStep module. + 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 sprkStep_Resize(ARKodeMem ark_mem, N_Vector y0, - SUNDIALS_MAYBE_UNUSED sunrealtype hscale, - SUNDIALS_MAYBE_UNUSED sunrealtype t0, ARKVecResizeFn resize, - void* resize_data) +int SPRKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) { + ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; - sunindextype lrw1, liw1, lrw_diff, liw_diff; - int retval; + int retval = 0; /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &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); - } + /* Initialize main ARKODE infrastructure */ + retval = arkInit(ark_mem, tR, yR, RESET_INIT); - if (step_mem->yerr) + if (retval != ARK_SUCCESS) { - 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); - } + 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); } /*--------------------------------------------------------------- - sprkStep_Reset: + SPRKStepEvolve: - 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). + This is the main time-integration driver (wrappers for general + ARKODE utility routine) ---------------------------------------------------------------*/ -int sprkStep_Reset(ARKodeMem ark_mem, SUNDIALS_MAYBE_UNUSED sunrealtype tR, - SUNDIALS_MAYBE_UNUSED N_Vector yR) +int SPRKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask) { - ARKodeSPRKStepMem step_mem = NULL; - int retval = 0; + /* 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); +} - /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +/*--------------------------------------------------------------- + SPRKStepGetDky: - N_VConst(SUN_RCONST(0.0), step_mem->yerr); - return (ARK_SUCCESS); + 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); } /*--------------------------------------------------------------- - sprkStep_Free frees all SPRKStep memory. + SPRKStepFree frees all SPRKStep memory, and then calls an ARKODE + utility routine to free the ARKODE infrastructure memory. ---------------------------------------------------------------*/ -void sprkStep_Free(ARKodeMem ark_mem) +void SPRKStepFree(void** arkode_mem) { + ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; - /* nothing to do if ark_mem is already NULL */ - if (ark_mem == NULL) { return; } + /* nothing to do if arkode_mem is already NULL */ + if (*arkode_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; @@ -343,8 +347,19 @@ void sprkStep_Free(ARKodeMem ark_mem) free(ark_mem->step_mem); ark_mem->step_mem = NULL; } + + /* free memory for overall ARKODE infrastructure */ + arkFree(arkode_mem); } +/*=============================================================== + SPRKStep Private functions + ===============================================================*/ + +/*--------------------------------------------------------------- + Interface routines supplied to ARKODE + ---------------------------------------------------------------*/ + /*--------------------------------------------------------------- sprkStep_Init: @@ -361,13 +376,14 @@ 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(void* arkode_mem, int init_type) { + ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; int retval = 0; /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* immediately return if reset */ @@ -413,23 +429,49 @@ int sprkStep_Init(ARKodeMem ark_mem, int init_type) } } - /* Override the interpolant degree (if needed), used in arkInitialSetup */ - if (step_mem->method->q > 1 && - ark_mem->interp_degree > (step_mem->method->q - 1)) + /* Limit max interpolant degree (negative input only overwrites the current + interpolant degree if it is greater than abs(input). */ + if (ark_mem->interp != NULL) { - /* 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; + 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); + } } 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) @@ -469,14 +511,15 @@ 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(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, +int sprkStep_FullRHS(void* arkode_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(ark_mem, __func__, &step_mem); + retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* perform RHS functions contingent on 'mode' argument */ @@ -521,8 +564,9 @@ int sprkStep_FullRHS(ARKodeMem ark_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(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) +int sprkStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr) { + ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; N_Vector prev_stage = NULL; N_Vector curr_stage = NULL; @@ -532,7 +576,7 @@ int sprkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) int retval = 0; /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } prev_stage = ark_mem->yn; @@ -596,9 +640,10 @@ int sprkStep_TakeStep(ARKodeMem ark_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(ARKodeMem ark_mem, sunrealtype* dsmPtr, +int sprkStep_TakeStep_Compensated(void* arkode_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; @@ -609,7 +654,7 @@ int sprkStep_TakeStep_Compensated(ARKodeMem ark_mem, sunrealtype* dsmPtr, int retval = 0; /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Vector shortcuts */ @@ -696,18 +741,18 @@ int sprkStep_TakeStep_Compensated(ARKodeMem ark_mem, sunrealtype* dsmPtr, return 0; } -/*=============================================================== +/*--------------------------------------------------------------- Internal utility routines - ===============================================================*/ + ---------------------------------------------------------------*/ /*--------------------------------------------------------------- - sprkStep_AccessARKODEStepMem: + sprkStep_AccessStepMem: Shortcut routine to unpack ark_mem and step_mem structures from void* pointer. If either is missing it returns ARK_MEM_NULL. ---------------------------------------------------------------*/ -int sprkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, - ARKodeMem* ark_mem, ARKodeSPRKStepMem* step_mem) +int sprkStep_AccessStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeSPRKStepMem* step_mem) { /* access ARKodeMem structure */ if (arkode_mem == NULL) @@ -717,8 +762,6 @@ int sprkStep_AccessARKODEStepMem(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__, @@ -729,26 +772,6 @@ int sprkStep_AccessARKODEStepMem(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: @@ -765,7 +788,3 @@ 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 0493106586..720e9732ee 100644 --- a/src/arkode/arkode_sprkstep_impl.h +++ b/src/arkode/arkode_sprkstep_impl.h @@ -66,35 +66,20 @@ 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 sprkStep_Init(void* arkode_mem, int init_type); +int sprkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); -int sprkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); -int sprkStep_TakeStep_Compensated(ARKodeMem ark_mem, sunrealtype* dsmPtr, +int sprkStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr); +int sprkStep_TakeStep_Compensated(void* arkode_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_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); +int sprkStep_AccessStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, 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 88378f14ca..d26c5410eb 100644 --- a/src/arkode/arkode_sprkstep_io.c +++ b/src/arkode/arkode_sprkstep_io.c @@ -29,8 +29,169 @@ #include "arkode_sprkstep_impl.h" /*=============================================================== - Exported optional input functions. + SPRKStep Optional input functions (wrappers for generic ARKODE + utility routines). All are documented in arkode_io.c. ===============================================================*/ +int SPRKStepSetInterpolantDegree(void* arkode_mem, int degree) +{ + if (degree < 0) { degree = ARK_INTERP_MAX_DEGREE; } + return (arkSetInterpolantDegree(arkode_mem, degree)); +} + +int SPRKStepSetInterpolantType(void* arkode_mem, int itype) +{ + return (arkSetInterpolantType(arkode_mem, itype)); +} + +int SPRKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) +{ + return (arkSetMaxNumSteps(arkode_mem, mxsteps)); +} + +int SPRKStepSetStopTime(void* arkode_mem, sunrealtype tstop) +{ + return (arkSetStopTime(arkode_mem, tstop)); +} + +int SPRKStepSetRootDirection(void* arkode_mem, int* rootdir) +{ + return (arkSetRootDirection(arkode_mem, rootdir)); +} + +int SPRKStepSetNoInactiveRootWarn(void* arkode_mem) +{ + return (arkSetNoInactiveRootWarn(arkode_mem)); +} + +int SPRKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) +{ + return (arkSetMaxNumConstrFails(arkode_mem, maxfails)); +} + +int SPRKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) +{ + return (arkSetPostprocessStepFn(arkode_mem, ProcessStep)); +} + +int SPRKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) +{ + return (arkSetPostprocessStageFn(arkode_mem, ProcessStage)); +} + +int SPRKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) +{ + return (arkSetFixedStep(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 (arkGetNumStepAttempts(arkode_mem, nstep_attempts)); +} + +int SPRKStepGetNumSteps(void* arkode_mem, long int* nsteps) +{ + return (arkGetNumSteps(arkode_mem, nsteps)); +} + +int SPRKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) +{ + return (arkGetLastStep(arkode_mem, hlast)); +} + +int SPRKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) +{ + return (arkGetCurrentStep(arkode_mem, hcur)); +} + +int SPRKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) +{ + return (arkGetCurrentTime(arkode_mem, tcur)); +} + +int SPRKStepGetCurrentState(void* arkode_mem, N_Vector* state) +{ + return (arkGetCurrentState(arkode_mem, state)); +} + +int SPRKStepGetRootInfo(void* arkode_mem, int* rootsfound) +{ + return (arkGetRootInfo(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)); +} + +int SPRKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) +{ + return (arkGetNumConstrFails(arkode_mem, nconstrfails)); +} + +int SPRKStepGetUserData(void* arkode_mem, void** user_data) +{ + return (arkGetUserData(arkode_mem, user_data)); +} + +char* SPRKStepGetReturnFlagName(long int flag) +{ + return (arkGetReturnFlagName(flag)); +} + +/*=============================================================== + SPRKStep optional input functions -- stepper-specific + ===============================================================*/ + +/*--------------------------------------------------------------- + SPRKStepSetUserData: + + Wrapper for generic arkSetUserData and arkLSSetUserData + routines. + ---------------------------------------------------------------*/ +int SPRKStepSetUserData(void* arkode_mem, void* user_data) +{ + return (arkSetUserData(arkode_mem, user_data)); +} + +/*--------------------------------------------------------------- + SPRKStepSetDefaults: + + 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 SPRKStepSetDefaults(void* arkode_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); +} /*--------------------------------------------------------------- SPRKStepSetUseCompensatedSums: @@ -43,15 +204,14 @@ int SPRKStepSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff) 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(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } if (onoff) { - ark_mem->use_compensated_sums = SUNTRUE; - ark_mem->step = sprkStep_TakeStep_Compensated; + arkSetUseCompensatedSums(arkode_mem, SUNTRUE); + ark_mem->step = sprkStep_TakeStep_Compensated; if (!step_mem->yerr) { if (!arkAllocVec(ark_mem, ark_mem->yn, &(step_mem->yerr))) @@ -62,11 +222,11 @@ int SPRKStepSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff) } else { - ark_mem->use_compensated_sums = SUNFALSE; - ark_mem->step = sprkStep_TakeStep; + arkSetUseCompensatedSums(arkode_mem, SUNFALSE); + ark_mem->step = sprkStep_TakeStep; } - return (retval); + return (ARK_SUCCESS); } /*--------------------------------------------------------------- @@ -75,7 +235,7 @@ int SPRKStepSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff) Specifies the SPRK method ** Note in documentation that this should not be called along - with ARKodeSetOrder. ** + with SPRKStepSetOrder. ** ---------------------------------------------------------------*/ int SPRKStepSetMethod(void* arkode_mem, ARKodeSPRKTable sprk_storage) { @@ -83,9 +243,8 @@ int SPRKStepSetMethod(void* arkode_mem, ARKodeSPRKTable sprk_storage) 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(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } if (step_mem->method) @@ -110,9 +269,8 @@ int SPRKStepSetMethodName(void* arkode_mem, const char* method) 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(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } if (step_mem->method) @@ -126,31 +284,44 @@ int SPRKStepSetMethodName(void* arkode_mem, const char* method) return step_mem->method ? ARK_SUCCESS : ARK_ILL_INPUT; } -/*=============================================================== - Exported optional output functions. - ===============================================================*/ - /*--------------------------------------------------------------- - SPRKStepGetCurrentMethod: + SPRKStepSetOrder: - Returns the stepper method structure. + Specifies the method order + + ** Note in documentation that this should not be called along + with SPRKStepSetMethod. ** ---------------------------------------------------------------*/ -int SPRKStepGetCurrentMethod(void* arkode_mem, ARKodeSPRKTable* sprk_storage) +int SPRKStepSetOrder(void* arkode_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(arkode_mem, __func__, &ark_mem, &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); } +/*=============================================================== + SPRKStep optional output functions -- stepper-specific + ===============================================================*/ + /*--------------------------------------------------------------- SPRKStepGetNumRhsEvals: @@ -162,9 +333,8 @@ int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, long int* nf2) 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(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } *nf1 = step_mem->nf1; @@ -173,67 +343,43 @@ int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, long int* nf2) return (ARK_SUCCESS); } -/*=============================================================== - Private functions attached to ARKODE - ===============================================================*/ - /*--------------------------------------------------------------- - 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)); -} - -/*--------------------------------------------------------------- - 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); + retval = sprkStep_AccessStepMem(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_PrintAllStats: + SPRKStepPrintAllStats: Prints integrator statistics ---------------------------------------------------------------*/ -int sprkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) +int SPRKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) { + ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; int retval = 0; /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); + 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); if (retval != ARK_SUCCESS) { return (retval); } switch (fmt) @@ -257,20 +403,35 @@ int sprkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt return (ARK_SUCCESS); } +/*=============================================================== + SPRKStep parameter output + ===============================================================*/ + /*--------------------------------------------------------------- - sprkStep_WriteParameters: + SPRKStepWriteParameters: Outputs all solver parameters to the provided file pointer. ---------------------------------------------------------------*/ -int sprkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) +int SPRKStepWriteParameters(void* arkode_mem, FILE* fp) { + ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; + int flag = 0; int retval = 0; /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); + retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &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); @@ -279,155 +440,6 @@ 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)); -} - -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)); -} - -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 d10dbf923c..b8cfeb3655 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) @@ -96,14 +96,15 @@ SUNAdaptController ARKUserControl(SUNContext sunctx, void* arkode_mem, * ----------------------------------------------------------------- */ SUNAdaptController_Type SUNAdaptController_GetType_ARKUserControl( - SUNDIALS_MAYBE_UNUSED SUNAdaptController C) + SUNAdaptController C) { return SUN_ADAPTCONTROLLER_H; } -SUNErrCode SUNAdaptController_EstimateStep_ARKUserControl( - SUNAdaptController C, sunrealtype h, SUNDIALS_MAYBE_UNUSED int p, - sunrealtype dsm, sunrealtype* hnew) +SUNErrCode SUNAdaptController_EstimateStep_ARKUserControl(SUNAdaptController C, + sunrealtype h, 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 @@ -154,8 +155,9 @@ SUNErrCode SUNAdaptController_UpdateH_ARKUserControl(SUNAdaptController C, return SUN_SUCCESS; } -SUNErrCode SUNAdaptController_Space_ARKUserControl( - SUNDIALS_MAYBE_UNUSED SUNAdaptController C, long int* lenrw, long int* leniw) +SUNErrCode SUNAdaptController_Space_ARKUserControl(SUNAdaptController C, + long int* lenrw, + long int* leniw) { *lenrw = 4; *leniw = 2; diff --git a/src/arkode/fmod_int32/CMakeLists.txt b/src/arkode/fmod/CMakeLists.txt similarity index 100% rename from src/arkode/fmod_int32/CMakeLists.txt rename to src/arkode/fmod/CMakeLists.txt diff --git a/src/arkode/fmod_int64/farkode_arkstep_mod.c b/src/arkode/fmod/farkode_arkstep_mod.c similarity index 100% rename from src/arkode/fmod_int64/farkode_arkstep_mod.c rename to src/arkode/fmod/farkode_arkstep_mod.c index 4791bedcdc..8da0515350 100644 --- a/src/arkode/fmod_int64/farkode_arkstep_mod.c +++ b/src/arkode/fmod/farkode_arkstep_mod.c @@ -253,203 +253,43 @@ SWIGEXPORT void * _wrap_FARKStepCreate(ARKRhsFn farg1, ARKRhsFn farg2, double co } -SWIGEXPORT int _wrap_FARKStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3, double const *farg4, N_Vector farg5) { +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 ; - ARKRhsFn arg2 = (ARKRhsFn) 0 ; - ARKRhsFn arg3 = (ARKRhsFn) 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); - 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); + arg5 = (ARKVecResizeFn)(farg5); + arg6 = (void *)(farg6); + result = (int)ARKStepResize(arg1,arg2,arg3,arg4,arg5,arg6); fresult = (int)(result); return fresult; } -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; } @@ -743,6 +583,42 @@ 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 ; @@ -757,6 +633,58 @@ 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 ; @@ -1641,6 +1569,22 @@ 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 ; @@ -1669,6 +1613,22 @@ 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 ; @@ -1966,6 +1926,32 @@ 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 ; @@ -2443,6 +2429,20 @@ 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_int64/farkode_arkstep_mod.f90 b/src/arkode/fmod/farkode_arkstep_mod.f90 similarity index 99% rename from src/arkode/fmod_int64/farkode_arkstep_mod.f90 rename to src/arkode/fmod/farkode_arkstep_mod.f90 index cc0373f1eb..6d065d9f19 100644 --- a/src/arkode/fmod_int64/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod/farkode_arkstep_mod.f90 @@ -26,7 +26,6 @@ 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 @@ -35,7 +34,6 @@ 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 @@ -49,22 +47,8 @@ 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 :: 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 :: FARKStepReInit public :: FARKStepReset public :: FARKStepSStolerances public :: FARKStepSVtolerances @@ -85,7 +69,17 @@ 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 @@ -147,8 +141,10 @@ module farkode_arkstep_mod public :: FARKStepGetNumExpSteps public :: FARKStepGetNumAccSteps public :: FARKStepGetNumStepAttempts + public :: FARKStepGetNumRhsEvals public :: FARKStepGetNumLinSolvSetups public :: FARKStepGetNumErrTestFails + public :: FARKStepGetCurrentButcherTables public :: FARKStepGetEstLocalErrors public :: FARKStepGetWorkSpace public :: FARKStepGetNumSteps @@ -170,6 +166,7 @@ module farkode_arkstep_mod public :: FARKStepGetReturnFlagName public :: FARKStepWriteParameters public :: FARKStepWriteButcher + public :: FARKStepGetTimestepperStats public :: FARKStepGetStepStats public :: FARKStepGetNonlinearSystemData public :: FARKStepGetNumNonlinSolvIters @@ -203,6 +200,7 @@ module farkode_arkstep_mod public :: FARKStepGetLinReturnFlagName public :: FARKStepFree public :: FARKStepPrintMem + public :: FARKStepCreateMRIStepInnerStepper public :: FARKStepSetRelaxFn public :: FARKStepSetRelaxEtaFail public :: FARKStepSetRelaxLowerBound @@ -233,129 +231,28 @@ function swigc_FARKStepCreate(farg1, farg2, farg3, farg4, 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") & +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 -type(C_PTR), value :: farg3 -type(C_PTR), value :: farg4 -type(C_PTR), value :: farg5 +real(C_DOUBLE), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_FUNPTR), 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") & +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 :: farg6 +type(C_PTR), value :: farg5 integer(C_INT) :: fresult end function @@ -543,6 +440,30 @@ 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) @@ -552,6 +473,39 @@ 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) @@ -1116,6 +1070,16 @@ 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) @@ -1134,6 +1098,16 @@ 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) @@ -1330,6 +1304,21 @@ 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) @@ -1635,6 +1624,15 @@ 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) @@ -1781,260 +1779,24 @@ 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 +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 = arkode_mem -farg2 = c_loc(stepper) -fresult = swigc_FARKStepCreateMRIStepInnerStepper(farg1, farg2) +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 @@ -2066,6 +1828,31 @@ 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 @@ -2398,6 +2185,45 @@ 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 @@ -2414,6 +2240,89 @@ 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 @@ -3435,6 +3344,25 @@ 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 @@ -3467,6 +3395,25 @@ 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 @@ -3821,6 +3768,41 @@ 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 @@ -4375,6 +4357,22 @@ 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_int32/farkode_erkstep_mod.c b/src/arkode/fmod/farkode_erkstep_mod.c similarity index 100% rename from src/arkode/fmod_int32/farkode_erkstep_mod.c rename to src/arkode/fmod/farkode_erkstep_mod.c index 5def57befc..c401460048 100644 --- a/src/arkode/fmod_int32/farkode_erkstep_mod.c +++ b/src/arkode/fmod/farkode_erkstep_mod.c @@ -251,133 +251,41 @@ SWIGEXPORT void * _wrap_FERKStepCreate(ARKRhsFn farg1, double const *farg2, N_Ve } -SWIGEXPORT int _wrap_FERKStepReInit(void *farg1, ARKRhsFn farg2, double const *farg3, N_Vector farg4) { +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 ; - ARKRhsFn arg2 = (ARKRhsFn) 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); - 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); + 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_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; } @@ -529,6 +437,48 @@ 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 ; @@ -1051,6 +1001,20 @@ SWIGEXPORT int _wrap_FERKStepGetNumStepAttempts(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_FERKStepGetNumErrTestFails(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -1065,6 +1029,20 @@ SWIGEXPORT int _wrap_FERKStepGetNumErrTestFails(void *farg1, long *farg2) { } +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 ; @@ -1306,6 +1284,28 @@ 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_int64/farkode_erkstep_mod.f90 b/src/arkode/fmod/farkode_erkstep_mod.f90 similarity index 99% rename from src/arkode/fmod_int64/farkode_erkstep_mod.f90 rename to src/arkode/fmod/farkode_erkstep_mod.f90 index 291dc643d5..98a6a5f817 100644 --- a/src/arkode/fmod_int64/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod/farkode_erkstep_mod.f90 @@ -26,7 +26,6 @@ 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 @@ -36,18 +35,8 @@ 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 :: 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 :: FERKStepReInit public :: FERKStepReset public :: FERKStepSStolerances public :: FERKStepSVtolerances @@ -58,6 +47,13 @@ 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 @@ -94,7 +90,9 @@ module farkode_erkstep_mod public :: FERKStepGetNumExpSteps public :: FERKStepGetNumAccSteps public :: FERKStepGetNumStepAttempts + public :: FERKStepGetNumRhsEvals public :: FERKStepGetNumErrTestFails + public :: FERKStepGetCurrentButcherTable public :: FERKStepGetEstLocalErrors public :: FERKStepGetWorkSpace public :: FERKStepGetNumSteps @@ -112,6 +110,7 @@ module farkode_erkstep_mod public :: FERKStepGetReturnFlagName public :: FERKStepWriteParameters public :: FERKStepWriteButcher + public :: FERKStepGetTimestepperStats public :: FERKStepGetStepStats public :: FERKStepFree public :: FERKStepPrintMem @@ -144,86 +143,27 @@ function swigc_FERKStepCreate(farg1, farg2, farg3, 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") & +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 -type(C_PTR), value :: farg3 -type(C_PTR), value :: farg4 -type(C_PTR), value :: farg5 +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_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 :: farg6 +type(C_PTR), value :: farg4 integer(C_INT) :: fresult end function @@ -320,6 +260,34 @@ 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) @@ -653,6 +621,15 @@ function swigc_FERKStepGetNumStepAttempts(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_FERKStepGetNumErrTestFails(farg1, farg2) & bind(C, name="_wrap_FERKStepGetNumErrTestFails") & result(fresult) @@ -662,6 +639,15 @@ function swigc_FERKStepGetNumErrTestFails(farg1, 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) @@ -822,6 +808,19 @@ 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) @@ -1012,155 +1011,6 @@ 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 @@ -1189,6 +1039,28 @@ 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 @@ -1358,6 +1230,73 @@ 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 @@ -1961,6 +1900,22 @@ function FERKStepGetNumStepAttempts(arkode_mem, step_attempts) & 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 FERKStepGetNumErrTestFails(arkode_mem, netfails) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -1977,6 +1932,22 @@ function FERKStepGetNumErrTestFails(arkode_mem, netfails) & 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 @@ -2267,6 +2238,34 @@ 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 new file mode 100644 index 0000000000..a66b1b0dcd --- /dev/null +++ b/src/arkode/fmod/farkode_mod.c @@ -0,0 +1,1058 @@ +/* ---------------------------------------------------------------------------- + * 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" + + +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 int _wrap_FARKBandPrecInit(void *farg1, int64_t const *farg2, int64_t const *farg3, int64_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, int64_t const *farg2, int64_t const *farg3, int64_t const *farg4, int64_t const *farg5, int64_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, int64_t const *farg2, int64_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, int64_t *farg2, int64_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 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 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, int64_t *farg2, int64_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; +} + + + diff --git a/src/arkode/fmod/farkode_mod.f90 b/src/arkode/fmod/farkode_mod.f90 new file mode 100644 index 0000000000..7724193873 --- /dev/null +++ b/src/arkode/fmod/farkode_mod.f90 @@ -0,0 +1,1665 @@ +! 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_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_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 :: 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_MAX_DIRK_NUM = ARKODE_ARK2_DIRK_3_1_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_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) + 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_MAX_ERK_NUM = ARKODE_VERNER_16_8_9 + end enum + integer, parameter, public :: ARKODE_ERKTableID = kind(ARKODE_ERK_NONE) + public :: ARKODE_ERK_NONE, ARKODE_MIN_ERK_NUM, ARKODE_HEUN_EULER_2_1_2, ARKODE_BOGACKI_SHAMPINE_4_2_3, & + ARKODE_ARK324L2SA_ERK_4_2_3, ARKODE_ZONNEVELD_5_3_4, ARKODE_ARK436L2SA_ERK_6_3_4, ARKODE_SAYFY_ABURUB_6_3_4, & + ARKODE_CASH_KARP_6_4_5, ARKODE_FEHLBERG_6_4_5, ARKODE_DORMAND_PRINCE_7_4_5, ARKODE_ARK548L2SA_ERK_8_4_5, & + ARKODE_VERNER_8_5_6, ARKODE_FEHLBERG_13_7_8, ARKODE_KNOTH_WOLKE_3_3, ARKODE_ARK437L2SA_ERK_7_3_4, & + ARKODE_ARK548L2SAb_ERK_8_4_5, ARKODE_ARK2_ERK_3_1_2, ARKODE_SOFRONIOU_SPALETTA_5_3_4, ARKODE_SHU_OSHER_3_2_3, & + ARKODE_VERNER_9_5_6, ARKODE_VERNER_10_6_7, ARKODE_VERNER_13_7_8, ARKODE_VERNER_16_8_9, ARKODE_MAX_ERK_NUM + public :: FARKodeButcherTable_LoadERK + public :: FARKodeButcherTable_LoadERKByName + ! typedef enum ARKODE_SPRKMethodID + 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 + +! WRAPPER DECLARATIONS +interface +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 + +end interface + + +contains + ! MODULE SUBPROGRAMS +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_INT64_T), intent(in) :: n +integer(C_INT64_T), intent(in) :: mu +integer(C_INT64_T), intent(in) :: ml +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT64_T) :: farg2 +integer(C_INT64_T) :: farg3 +integer(C_INT64_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_INT64_T), intent(in) :: nlocal +integer(C_INT64_T), intent(in) :: mudq +integer(C_INT64_T), intent(in) :: mldq +integer(C_INT64_T), intent(in) :: mukeep +integer(C_INT64_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_INT64_T) :: farg2 +integer(C_INT64_T) :: farg3 +integer(C_INT64_T) :: farg4 +integer(C_INT64_T) :: farg5 +integer(C_INT64_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_INT64_T), intent(in) :: mudq +integer(C_INT64_T), intent(in) :: mldq +real(C_DOUBLE), intent(in) :: dqrely +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT64_T) :: farg2 +integer(C_INT64_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_INT64_T), dimension(*), target, intent(inout) :: liw +integer(C_INT64_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_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 + +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_INT64_T), dimension(*), target, intent(inout) :: liw +integer(C_INT64_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 + + +end module diff --git a/src/arkode/fmod_int64/farkode_mristep_mod.c b/src/arkode/fmod/farkode_mristep_mod.c similarity index 100% rename from src/arkode/fmod_int64/farkode_mristep_mod.c rename to src/arkode/fmod/farkode_mristep_mod.c index c2e254fa54..c9fc9edf0c 100644 --- a/src/arkode/fmod_int64/farkode_mristep_mod.c +++ b/src/arkode/fmod/farkode_mristep_mod.c @@ -651,244 +651,6 @@ SWIGEXPORT void * _wrap_FMRIStepCreate(ARKRhsFn farg1, ARKRhsFn farg2, double co } -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 ; @@ -909,6 +671,26 @@ SWIGEXPORT int _wrap_FMRIStepResize(void *farg1, N_Vector farg2, double const *f } +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_FMRIStepReset(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; @@ -1125,6 +907,20 @@ 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 ; @@ -1251,29 +1047,29 @@ SWIGEXPORT int _wrap_FMRIStepSetMaxHnilWarns(void *farg1, int const *farg2) { } -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; } -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; } @@ -1373,6 +1169,34 @@ 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 ; @@ -1585,6 +1409,22 @@ 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 ; @@ -1599,6 +1439,20 @@ 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 ; @@ -1741,6 +1595,20 @@ 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 ; @@ -2111,4 +1979,136 @@ 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_int64/farkode_mristep_mod.f90 b/src/arkode/fmod/farkode_mristep_mod.f90 similarity index 98% rename from src/arkode/fmod_int64/farkode_mristep_mod.f90 rename to src/arkode/fmod/farkode_mristep_mod.f90 index 782c3c1df9..163f24f8f8 100644 --- a/src/arkode/fmod_int64/farkode_mristep_mod.f90 +++ b/src/arkode/fmod/farkode_mristep_mod.f90 @@ -47,35 +47,18 @@ module farkode_mristep_mod 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 + enumerator :: ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_GARK4 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 + ARKODE_IMEX_MRI_GARK3b, ARKODE_IMEX_MRI_GARK4, ARKODE_MAX_MRI_NUM + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_3 = ARKODE_MIS_KW3 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 @@ -125,23 +108,8 @@ module farkode_mristep_mod 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 :: FMRIStepReInit public :: FMRIStepReset public :: FMRIStepSStolerances public :: FMRIStepSVtolerances @@ -157,6 +125,7 @@ module farkode_mristep_mod public :: FMRIStepSetNlsRhsFn public :: FMRIStepSetLinear public :: FMRIStepSetNonlinear + public :: FMRIStepSetCoupling public :: FMRIStepSetMaxNumSteps public :: FMRIStepSetNonlinCRDown public :: FMRIStepSetNonlinRDiv @@ -166,8 +135,8 @@ module farkode_mristep_mod public :: FMRIStepSetMaxNonlinIters public :: FMRIStepSetNonlinConvCoef public :: FMRIStepSetMaxHnilWarns - public :: FMRIStepSetInterpolateStopTime public :: FMRIStepSetStopTime + public :: FMRIStepSetInterpolateStopTime public :: FMRIStepClearStopTime public :: FMRIStepSetFixedStep public :: FMRIStepSetRootDirection @@ -175,6 +144,8 @@ module farkode_mristep_mod public :: FMRIStepSetUserData public :: FMRIStepSetPostprocessStepFn public :: FMRIStepSetPostprocessStageFn + public :: FMRIStepSetPreInnerFn + public :: FMRIStepSetPostInnerFn public :: FMRIStepSetStagePredictFn public :: FMRIStepSetDeduceImplicitRhs public :: FMRIStepSetJacFn @@ -189,7 +160,9 @@ module farkode_mristep_mod public :: FMRIStepEvolve public :: FMRIStepGetDky public :: FMRIStepComputeState + public :: FMRIStepGetNumRhsEvals public :: FMRIStepGetNumLinSolvSetups + public :: FMRIStepGetCurrentCoupling public :: FMRIStepGetWorkSpace public :: FMRIStepGetNumSteps public :: FMRIStepGetLastStep @@ -200,6 +173,7 @@ module farkode_mristep_mod public :: FMRIStepGetErrWeights public :: FMRIStepGetNumGEvals public :: FMRIStepGetRootInfo + public :: FMRIStepGetLastInnerStepFlag public :: FMRIStepGetUserData public :: FMRIStepPrintAllStats public :: FMRIStepGetReturnFlagName @@ -226,6 +200,15 @@ 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 @@ -464,165 +447,26 @@ function swigc_FMRIStepCreate(farg1, farg2, farg3, farg4, farg5, 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") & +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 -type(C_PTR), value :: farg3 -type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg3 +type(C_FUNPTR), 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") & +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 @@ -765,6 +609,15 @@ 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) @@ -846,21 +699,21 @@ function swigc_FMRIStepSetMaxHnilWarns(farg1, 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 -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 @@ -925,6 +778,24 @@ 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) @@ -1059,6 +930,16 @@ 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) @@ -1068,6 +949,15 @@ 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) @@ -1159,8 +1049,8 @@ function swigc_FMRIStepGetRootInfo(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FMRIStepGetUserData(farg1, farg2) & -bind(C, name="_wrap_FMRIStepGetUserData") & +function swigc_FMRIStepGetLastInnerStepFlag(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetLastInnerStepFlag") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1168,9 +1058,18 @@ function swigc_FMRIStepGetUserData(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FMRIStepPrintAllStats(farg1, farg2, farg3) & -bind(C, name="_wrap_FMRIStepPrintAllStats") & -result(fresult) +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 @@ -1402,6 +1301,90 @@ 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 @@ -1810,305 +1793,53 @@ function FMRIStepCreate(fse, fsi, t0, y0, stepper, sunctx) & swig_result = fresult end function -function FMRIStepReInit(arkode_mem, fse, fsi, t0, y0) & +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(C_FUNPTR), intent(in), value :: fse -type(C_FUNPTR), intent(in), value :: fsi +type(N_Vector), target, intent(inout) :: ynew 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 +type(C_FUNPTR), intent(in), value :: resize +type(C_PTR) :: resize_data integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 -type(C_PTR) :: farg3 -type(C_PTR) :: farg4 +real(C_DOUBLE) :: farg3 +type(C_FUNPTR) :: 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) +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 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 @@ -2361,6 +2092,22 @@ 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 @@ -2505,35 +2252,35 @@ function FMRIStepSetMaxHnilWarns(arkode_mem, mxhnil) & 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 -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 @@ -2643,6 +2390,38 @@ 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 @@ -2891,6 +2670,25 @@ 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 @@ -2907,6 +2705,22 @@ 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 @@ -3070,6 +2884,22 @@ 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 @@ -3512,5 +3342,158 @@ 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_int32/farkode_sprkstep_mod.c b/src/arkode/fmod/farkode_sprkstep_mod.c similarity index 97% rename from src/arkode/fmod_int32/farkode_sprkstep_mod.c rename to src/arkode/fmod/farkode_sprkstep_mod.c index 28cfb297d4..d5858a372a 100644 --- a/src/arkode/fmod_int32/farkode_sprkstep_mod.c +++ b/src/arkode/fmod/farkode_sprkstep_mod.c @@ -273,78 +273,6 @@ SWIGEXPORT int _wrap_FSPRKStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3 } -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 ; @@ -377,39 +305,55 @@ SWIGEXPORT int _wrap_FSPRKStepRootInit(void *farg1, int const *farg2, ARKRootFn } -SWIGEXPORT int _wrap_FSPRKStepSetRootDirection(void *farg1, int *farg2) { +SWIGEXPORT int _wrap_FSPRKStepSetDefaults(void *farg1) { int fresult ; void *arg1 = (void *) 0 ; - int *arg2 = (int *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (int *)(farg2); - result = (int)SPRKStepSetRootDirection(arg1,arg2); + result = (int)SPRKStepSetDefaults(arg1); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FSPRKStepSetNoInactiveRootWarn(void *farg1) { +SWIGEXPORT int _wrap_FSPRKStepSetUseCompensatedSums(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; + int arg2 ; int result; arg1 = (void *)(farg1); - result = (int)SPRKStepSetNoInactiveRootWarn(arg1); + arg2 = (int)(*farg2); + result = (int)SPRKStepSetUseCompensatedSums(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FSPRKStepSetDefaults(void *farg1) { +SWIGEXPORT int _wrap_FSPRKStepSetMethod(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; + ARKodeSPRKTable arg2 = (ARKodeSPRKTable) 0 ; int result; arg1 = (void *)(farg1); - result = (int)SPRKStepSetDefaults(arg1); + 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; } @@ -592,6 +536,20 @@ 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 ; @@ -648,6 +606,22 @@ 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_int32/farkode_sprkstep_mod.f90 b/src/arkode/fmod/farkode_sprkstep_mod.f90 similarity index 95% rename from src/arkode/fmod_int32/farkode_sprkstep_mod.f90 rename to src/arkode/fmod/farkode_sprkstep_mod.f90 index 82217e7b1b..a6cc16db19 100644 --- a/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 +++ b/src/arkode/fmod/farkode_sprkstep_mod.f90 @@ -36,6 +36,9 @@ 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 @@ -43,13 +46,6 @@ 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 @@ -62,10 +58,12 @@ 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 @@ -101,53 +99,6 @@ function swigc_FSPRKStepReInit(farg1, farg2, farg3, farg4, 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) @@ -168,28 +119,39 @@ function swigc_FSPRKStepRootInit(farg1, farg2, farg3) & integer(C_INT) :: fresult end function -function swigc_FSPRKStepSetRootDirection(farg1, farg2) & -bind(C, name="_wrap_FSPRKStepSetRootDirection") & +function swigc_FSPRKStepSetDefaults(farg1) & +bind(C, name="_wrap_FSPRKStepSetDefaults") & result(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") & +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_FSPRKStepSetDefaults(farg1) & -bind(C, name="_wrap_FSPRKStepSetDefaults") & +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 @@ -311,6 +273,15 @@ 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) @@ -347,6 +318,16 @@ 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) @@ -476,108 +457,6 @@ 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 @@ -616,45 +495,83 @@ function FSPRKStepRootInit(arkode_mem, nrtfn, g) & swig_result = fresult end function -function FSPRKStepSetRootDirection(arkode_mem, rootdir) & +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), 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) +fresult = swigc_FSPRKStepSetDefaults(farg1) swig_result = fresult end function -function FSPRKStepSetNoInactiveRootWarn(arkode_mem) & +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 -fresult = swigc_FSPRKStepSetNoInactiveRootWarn(farg1) +farg2 = onoff +fresult = swigc_FSPRKStepSetUseCompensatedSums(farg1, farg2) swig_result = fresult end function -function FSPRKStepSetDefaults(arkode_mem) & +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 -fresult = swigc_FSPRKStepSetDefaults(farg1) +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 @@ -877,6 +794,22 @@ 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 @@ -941,6 +874,25 @@ 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 diff --git a/src/arkode/fmod_int32/farkode_arkstep_mod.c b/src/arkode/fmod_int32/farkode_arkstep_mod.c deleted file mode 100644 index 4791bedcdc..0000000000 --- a/src/arkode/fmod_int32/farkode_arkstep_mod.c +++ /dev/null @@ -1,2660 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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_int32/farkode_arkstep_mod.f90 b/src/arkode/fmod_int32/farkode_arkstep_mod.f90 deleted file mode 100644 index cc0373f1eb..0000000000 --- a/src/arkode/fmod_int32/farkode_arkstep_mod.f90 +++ /dev/null @@ -1,4625 +0,0 @@ -! 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_int32/farkode_erkstep_mod.f90 b/src/arkode/fmod_int32/farkode_erkstep_mod.f90 deleted file mode 100644 index 291dc643d5..0000000000 --- a/src/arkode/fmod_int32/farkode_erkstep_mod.f90 +++ /dev/null @@ -1,2566 +0,0 @@ -! 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_int32/farkode_mod.c b/src/arkode/fmod_int32/farkode_mod.c deleted file mode 100644 index 1423d2e582..0000000000 --- a/src/arkode/fmod_int32/farkode_mod.c +++ /dev/null @@ -1,3246 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 366867f40a..0000000000 --- a/src/arkode/fmod_int32/farkode_mod.f90 +++ /dev/null @@ -1,5769 +0,0 @@ -! 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 deleted file mode 100644 index 35721938c4..0000000000 --- a/src/arkode/fmod_int32/farkode_mristep_mod.c +++ /dev/null @@ -1,2114 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 74a3de5637..0000000000 --- a/src/arkode/fmod_int32/farkode_mristep_mod.f90 +++ /dev/null @@ -1,3516 +0,0 @@ -! 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_int64/CMakeLists.txt b/src/arkode/fmod_int64/CMakeLists.txt deleted file mode 100644 index 32e5c935d7..0000000000 --- a/src/arkode/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,59 +0,0 @@ -# --------------------------------------------------------------- -# 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_erkstep_mod.c b/src/arkode/fmod_int64/farkode_erkstep_mod.c deleted file mode 100644 index 5def57befc..0000000000 --- a/src/arkode/fmod_int64/farkode_erkstep_mod.c +++ /dev/null @@ -1,1563 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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_mod.c b/src/arkode/fmod_int64/farkode_mod.c deleted file mode 100644 index 7b2c3c9811..0000000000 --- a/src/arkode/fmod_int64/farkode_mod.c +++ /dev/null @@ -1,3246 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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, int64_t const *farg2, int64_t const *farg3, int64_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, int64_t const *farg2, int64_t const *farg3, int64_t const *farg4, int64_t const *farg5, int64_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, int64_t const *farg2, int64_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, int64_t *farg2, int64_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, int64_t *farg2, int64_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_int64/farkode_mod.f90 b/src/arkode/fmod_int64/farkode_mod.f90 deleted file mode 100644 index e627472572..0000000000 --- a/src/arkode/fmod_int64/farkode_mod.f90 +++ /dev/null @@ -1,5769 +0,0 @@ -! 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_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_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_INT64_T), intent(in) :: n -integer(C_INT64_T), intent(in) :: mu -integer(C_INT64_T), intent(in) :: ml -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT64_T) :: farg2 -integer(C_INT64_T) :: farg3 -integer(C_INT64_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_INT64_T), intent(in) :: nlocal -integer(C_INT64_T), intent(in) :: mudq -integer(C_INT64_T), intent(in) :: mldq -integer(C_INT64_T), intent(in) :: mukeep -integer(C_INT64_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_INT64_T) :: farg2 -integer(C_INT64_T) :: farg3 -integer(C_INT64_T) :: farg4 -integer(C_INT64_T) :: farg5 -integer(C_INT64_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_INT64_T), intent(in) :: mudq -integer(C_INT64_T), intent(in) :: mldq -real(C_DOUBLE), intent(in) :: dqrely -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT64_T) :: farg2 -integer(C_INT64_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_INT64_T), dimension(*), target, intent(inout) :: liw -integer(C_INT64_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_INT64_T), dimension(*), target, intent(inout) :: liw -integer(C_INT64_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_int64/farkode_sprkstep_mod.c b/src/arkode/fmod_int64/farkode_sprkstep_mod.c deleted file mode 100644 index 28cfb297d4..0000000000 --- a/src/arkode/fmod_int64/farkode_sprkstep_mod.c +++ /dev/null @@ -1,767 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 82217e7b1b..0000000000 --- a/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 +++ /dev/null @@ -1,1081 +0,0 @@ -! 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/arkode/xbraid/arkode_xbraid.c b/src/arkode/xbraid/arkode_xbraid.c index 208c2c2888..4bf73b07f1 100644 --- a/src/arkode/xbraid/arkode_xbraid.c +++ b/src/arkode/xbraid/arkode_xbraid.c @@ -20,6 +20,7 @@ #include "arkode_arkstep_impl.h" #include "arkode_xbraid_impl.h" #include "sundials/sundials_math.h" +#include "sundials/sundials_types.h" #define ONE SUN_RCONST(1.0) @@ -215,11 +216,6 @@ 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; } @@ -252,11 +248,6 @@ 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; } @@ -283,9 +274,8 @@ int ARKBraid_GetSolution(braid_App app, sunrealtype* tout, N_Vector yout) * -------------------------- */ /* Take a time step */ -int ARKBraid_Step(braid_App app, SUNDIALS_MAYBE_UNUSED braid_Vector ustop, - SUNDIALS_MAYBE_UNUSED braid_Vector fstop, braid_Vector u, - braid_StepStatus status) +int ARKBraid_Step(braid_App app, braid_Vector ustop, braid_Vector fstop, + braid_Vector u, braid_StepStatus status) { braid_Int braid_flag; /* braid function return flag */ int ark_flag; /* arkode step return flag */ @@ -332,7 +322,7 @@ int ARKBraid_Step(braid_App app, SUNDIALS_MAYBE_UNUSED braid_Vector ustop, { /* 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 = ARKodeGetCurrentStep((void*)(content->ark_mem), &hacc); + flag = ARKStepGetCurrentStep((void*)(content->ark_mem), &hacc); CHECK_ARKODE_RETURN(content->last_flag_arkode, flag); /* Set the refinement factor */ @@ -351,8 +341,7 @@ int ARKBraid_Step(braid_App app, SUNDIALS_MAYBE_UNUSED braid_Vector ustop, } /* Create and initialize vectors */ -int ARKBraid_Init(braid_App app, SUNDIALS_MAYBE_UNUSED sunrealtype t, - braid_Vector* u_ptr) +int ARKBraid_Init(braid_App app, sunrealtype t, braid_Vector* u_ptr) { int flag; /* return flag */ N_Vector y; /* output N_Vector */ @@ -450,51 +439,6 @@ int ARKBraid_Access(braid_App app, braid_Vector u, braid_AccessStatus astatus) int ARKBraid_TakeStep(void* arkode_mem, sunrealtype tstart, sunrealtype tstop, N_Vector y, int* ark_flag) { - int flag; /* generic return flag */ - int tmp_flag; /* evolve return flag */ - sunrealtype tret; /* return time */ - - /* Check inputs */ - if (arkode_mem == NULL) { return ARK_MEM_NULL; } - if (y == NULL) { return ARK_ILL_INPUT; } - - /* Reset ARKODE state */ - flag = ARKodeReset(arkode_mem, tstart, y); - if (flag != ARK_SUCCESS) { return flag; } - - /* Set the time step size */ - flag = ARKodeSetInitStep(arkode_mem, tstop - tstart); - if (flag != ARK_SUCCESS) { return flag; } - - /* Ignore temporal error test result and force step to pass */ - flag = arkSetForcePass(arkode_mem, SUNTRUE); - if (flag != ARK_SUCCESS) { return flag; } - - /* Take step, check flag below */ - tmp_flag = ARKodeEvolve(arkode_mem, tstop, y, &tret, ARK_ONE_STEP); - - /* Re-enable temporal error test check */ - flag = arkSetForcePass(arkode_mem, SUNFALSE); - if (flag != ARK_SUCCESS) { return flag; } - - /* Check if evolve call failed */ - if (tmp_flag < 0) - { - *ark_flag = STEP_FAILED; - return ARK_SUCCESS; - } - - /* Check if temporal error test failed */ - flag = arkGetLastKFlag(arkode_mem, &tmp_flag); - if (flag != ARK_SUCCESS) { return flag; } - - if (tmp_flag > 0) - { - *ark_flag = STEP_ADAPT; - return ARK_SUCCESS; - } - - /* Step was successful and passed the error test */ - *ark_flag = STEP_SUCCESS; - return ARK_SUCCESS; + sunrealtype tret; + return arkStep_TryStep(arkode_mem, tstart, tstop, y, &tret, ark_flag); } diff --git a/src/arkode/xbraid/arkode_xbraid_impl.h b/src/arkode/xbraid/arkode_xbraid_impl.h index eddb80a200..0fd216b1be 100644 --- a/src/arkode/xbraid/arkode_xbraid_impl.h +++ b/src/arkode/xbraid/arkode_xbraid_impl.h @@ -43,15 +43,6 @@ extern "C" { } \ while (0) -/* -------------------------- - * SUNBraid private constants - * -------------------------- */ - -/* TakeSetup step result flags */ -#define STEP_FAILED -1 -#define STEP_SUCCESS 0 -#define STEP_ADAPT 1 - /* ------------------------------ * ARKBraid app structure content * ------------------------------ */ diff --git a/src/cvode/CMakeLists.txt b/src/cvode/CMakeLists.txt index 7a3e01613a..7c30d3538c 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 @@ -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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/cvode/README.md b/src/cvode/README.md index 7e17d2a68c..fbc0a5e9d4 100644 --- a/src/cvode/README.md +++ b/src/cvode/README.md @@ -1,5 +1,5 @@ # CVODE -### Version 7.1.0 (Jun 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.1.0," - LLNL technical report UCRL-SM-208108, Jun 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.1.0," - LLNL technical report UCRL-SM-208110, Jun 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/cvode/cvode.c b/src/cvode/cvode.c index 0558991e85..379c0fa0c2 100644 --- a/src/cvode/cvode.c +++ b/src/cvode/cvode.c @@ -138,6 +138,16 @@ 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); @@ -173,6 +183,11 @@ 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); @@ -2704,7 +2719,7 @@ static void cvPredict(CVodeMem cv_mem) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODE::cvPredict", - "return", "zn_0(:) =", ""); + "return", "predictor =", ""); N_VPrintFile(cv_mem->cv_zn[0], CV_LOGGER->debug_fp); #endif } diff --git a/src/cvode/cvode_bandpre.c b/src/cvode/cvode_bandpre.c index b19c32e1e5..f421257440 100644 --- a/src/cvode/cvode_bandpre.c +++ b/src/cvode/cvode_bandpre.c @@ -435,12 +435,9 @@ 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(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) +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) { CVBandPrecData pdata; int retval; diff --git a/src/cvode/cvode_bbdpre.c b/src/cvode/cvode_bbdpre.c index 4cdefc1c28..6c8a28470b 100644 --- a/src/cvode/cvode_bbdpre.c +++ b/src/cvode/cvode_bbdpre.c @@ -467,10 +467,9 @@ 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, - SUNDIALS_MAYBE_UNUSED N_Vector fy, sunbooleantype jok, - sunbooleantype* jcurPtr, sunrealtype gamma, - void* bbd_data) +static int CVBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, + sunbooleantype jok, sunbooleantype* jcurPtr, + sunrealtype gamma, void* bbd_data) { CVBBDPrecData pdata; CVodeMem cv_mem; @@ -557,12 +556,9 @@ static int CVBBDPrecSetup(sunrealtype t, N_Vector y, The value returned by the CVBBDPrecSolve function is always 0, indicating success. -----------------------------------------------------------------*/ -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) +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) { int retval; CVBBDPrecData pdata; diff --git a/src/cvode/cvode_diag.c b/src/cvode/cvode_diag.c index 25af67fbe9..e24592c827 100644 --- a/src/cvode/cvode_diag.c +++ b/src/cvode/cvode_diag.c @@ -23,6 +23,20 @@ #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) @@ -320,10 +334,9 @@ static int CVDiagInit(CVodeMem cv_mem) * ----------------------------------------------------------------- */ -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) +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) { sunrealtype r; N_Vector ftemp, y; @@ -413,10 +426,8 @@ static int CVDiagSetup(CVodeMem cv_mem, SUNDIALS_MAYBE_UNUSED int convfail, * ----------------------------------------------------------------- */ -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) +static int CVDiagSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, + N_Vector ycur, N_Vector fcur) { sunbooleantype invOK; sunrealtype r; diff --git a/src/cvode/cvode_fused_stubs.c b/src/cvode/cvode_fused_stubs.c index 7bc41c5d6f..cd7aa6acd8 100644 --- a/src/cvode/cvode_fused_stubs.c +++ b/src/cvode/cvode_fused_stubs.c @@ -18,7 +18,6 @@ #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) @@ -122,11 +121,10 @@ int cvDiagSetup_formY(const sunrealtype h, const sunrealtype r, * ----------------------------------------------------------------- */ -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) +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) { 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 e2f3a36350..d7d9d08823 100644 --- a/src/cvode/cvode_impl.h +++ b/src/cvode/cvode_impl.h @@ -22,11 +22,10 @@ #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" { @@ -635,34 +634,6 @@ 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_io.c b/src/cvode/cvode_io.c index 1f23b850c0..1a545a0886 100644 --- a/src/cvode/cvode_io.c +++ b/src/cvode/cvode_io.c @@ -104,8 +104,6 @@ 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); @@ -1025,8 +1023,6 @@ 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 50c60c6e8b..a51ef16132 100644 --- a/src/cvode/cvode_ls.c +++ b/src/cvode/cvode_ls.c @@ -977,8 +977,7 @@ 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, - SUNDIALS_MAYBE_UNUSED N_Vector tmp3) + void* cvode_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { CVodeMem cv_mem; int retval; @@ -1214,7 +1213,7 @@ int cvLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, } /* Evaluate f with incremented y */ - retval = cv_mem->cv_f(t, ytemp, ftemp, cv_mem->cv_user_data); + retval = cv_mem->cv_f(cv_mem->cv_tn, ytemp, ftemp, cv_mem->cv_user_data); cvls_mem->nfeDQ++; if (retval != 0) { break; } diff --git a/src/cvode/cvode_nls.c b/src/cvode/cvode_nls.c index 7821bd976a..ade248a1b9 100644 --- a/src/cvode/cvode_nls.c +++ b/src/cvode/cvode_nls.c @@ -40,6 +40,12 @@ 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/cvode/fmod_int32/CMakeLists.txt b/src/cvode/fmod/CMakeLists.txt similarity index 100% rename from src/cvode/fmod_int32/CMakeLists.txt rename to src/cvode/fmod/CMakeLists.txt diff --git a/src/cvode/fmod_int64/fcvode_mod.c b/src/cvode/fmod/fcvode_mod.c similarity index 100% rename from src/cvode/fmod_int64/fcvode_mod.c rename to src/cvode/fmod/fcvode_mod.c diff --git a/src/cvode/fmod_int64/fcvode_mod.f90 b/src/cvode/fmod/fcvode_mod.f90 similarity index 100% rename from src/cvode/fmod_int64/fcvode_mod.f90 rename to src/cvode/fmod/fcvode_mod.f90 diff --git a/src/cvode/fmod_int32/fcvode_mod.c b/src/cvode/fmod_int32/fcvode_mod.c deleted file mode 100644 index d7ebeac053..0000000000 --- a/src/cvode/fmod_int32/fcvode_mod.c +++ /dev/null @@ -1,2020 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 6a597e65da..0000000000 --- a/src/cvode/fmod_int32/fcvode_mod.f90 +++ /dev/null @@ -1,3436 +0,0 @@ -! 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 deleted file mode 100644 index e27c43ae02..0000000000 --- a/src/cvode/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,47 +0,0 @@ -# --------------------------------------------------------------- -# 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/cvodes/CMakeLists.txt b/src/cvodes/CMakeLists.txt index 1879c49614..26d9323f7e 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/cvodes/README.md b/src/cvodes/README.md index 8e4259efdd..a5cf70488b 100644 --- a/src/cvodes/README.md +++ b/src/cvodes/README.md @@ -1,5 +1,5 @@ # CVODES -### Version 7.1.0 (Jun 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.1.0," - LLNL technical report UCRL-SM-208111, Jun 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.1.0," - LLNL technical report UCRL-SM-208115, Jun 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/cvodes/cvodea.c b/src/cvodes/cvodea.c index 2df97cf712..fd4ae06f97 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 = ZERO; + ck_mem->ck_h = 0.0; /* Do we need to carry quadratures */ ck_mem->ck_quadr = cv_mem->cv_quadr && cv_mem->cv_errconQ; diff --git a/src/cvodes/cvodes.c b/src/cvodes/cvodes.c index 55399d7349..4e2ac40d00 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", "zn_0(:) =", ""); + "forward", "predictor =", ""); 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", "znQ_0(:) =", ""); + "quad", "predictor =", ""); 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, znS_i(:) = ", i); + "sensi", " i = %d, predictor_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, znQS_i(:) = ", i); + "quad-sensi", " i = %d, predictor_i = ", i); N_VPrintFile(cv_mem->cv_znQS[0][i], CV_LOGGER->debug_fp); } #endif @@ -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(SUNDIALS_MAYBE_UNUSED CVodeMem cv_mem, - sunrealtype old_nrm, N_Vector xQ, N_Vector wQ) +static sunrealtype cvQuadUpdateNorm(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(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) +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) { CVodeMem cv_mem; int retval, method; diff --git a/src/cvodes/cvodes_bandpre.c b/src/cvodes/cvodes_bandpre.c index 55dbe1afbb..98a9308759 100644 --- a/src/cvodes/cvodes_bandpre.c +++ b/src/cvodes/cvodes_bandpre.c @@ -438,12 +438,9 @@ 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(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) +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) { CVBandPrecData pdata; int retval; diff --git a/src/cvodes/cvodes_bbdpre.c b/src/cvodes/cvodes_bbdpre.c index 12eb1b7883..af9cba7900 100644 --- a/src/cvodes/cvodes_bbdpre.c +++ b/src/cvodes/cvodes_bbdpre.c @@ -479,10 +479,9 @@ 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, - SUNDIALS_MAYBE_UNUSED N_Vector fy, sunbooleantype jok, - sunbooleantype* jcurPtr, sunrealtype gamma, - void* bbd_data) +static int cvBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, + sunbooleantype jok, sunbooleantype* jcurPtr, + sunrealtype gamma, void* bbd_data) { CVBBDPrecData pdata; CVodeMem cv_mem; @@ -569,12 +568,9 @@ static int cvBBDPrecSetup(sunrealtype t, N_Vector y, The value returned by the cvBBDPrecSolve function is always 0, indicating success. -----------------------------------------------------------------*/ -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) +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) { int retval; CVBBDPrecData pdata; diff --git a/src/cvodes/cvodes_diag.c b/src/cvodes/cvodes_diag.c index 857a81bf73..b1db687e4b 100644 --- a/src/cvodes/cvodes_diag.c +++ b/src/cvodes/cvodes_diag.c @@ -326,10 +326,9 @@ static int CVDiagInit(CVodeMem cv_mem) * ----------------------------------------------------------------- */ -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) +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) { sunrealtype r; N_Vector ftemp, y; @@ -401,10 +400,8 @@ static int CVDiagSetup(CVodeMem cv_mem, SUNDIALS_MAYBE_UNUSED int convfail, * ----------------------------------------------------------------- */ -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) +static int CVDiagSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, + N_Vector ycur, N_Vector fcur) { sunbooleantype invOK; sunrealtype r; diff --git a/src/cvodes/cvodes_impl.h b/src/cvodes/cvodes_impl.h index c22d166359..e98b88b371 100644 --- a/src/cvodes/cvodes_impl.h +++ b/src/cvodes/cvodes_impl.h @@ -18,14 +18,12 @@ #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 e4599bd853..4114259b23 100644 --- a/src/cvodes/cvodes_io.c +++ b/src/cvodes/cvodes_io.c @@ -104,8 +104,6 @@ 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 539a69a1d4..6c7362d74b 100644 --- a/src/cvodes/cvodes_ls.c +++ b/src/cvodes/cvodes_ls.c @@ -1055,8 +1055,7 @@ 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, - SUNDIALS_MAYBE_UNUSED N_Vector tmp3) + void* cvode_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { CVodeMem cv_mem; int retval; @@ -1292,7 +1291,7 @@ int cvLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, } /* Evaluate f with incremented y */ - retval = cv_mem->cv_f(t, ytemp, ftemp, cv_mem->cv_user_data); + retval = cv_mem->cv_f(cv_mem->cv_tn, ytemp, ftemp, cv_mem->cv_user_data); cvls_mem->nfeDQ++; if (retval != 0) { break; } @@ -2885,7 +2884,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__, fname, __FILE__, + cvProcessError(NULL, CVLS_MEM_NULL, __LINE__, __func__, __FILE__, MSG_LS_CVMEM_NULL); return (CVLS_MEM_NULL); } @@ -2894,7 +2893,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__, fname, __FILE__, + cvProcessError(*cv_mem, CVLS_NO_ADJ, __LINE__, __func__, __FILE__, MSG_LS_NO_ADJ); return (CVLS_NO_ADJ); } @@ -2903,7 +2902,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__, fname, __FILE__, + cvProcessError(*cv_mem, CVLS_LMEMB_NULL, __LINE__, __func__, __FILE__, MSG_LS_LMEMB_NULL); return (CVLS_LMEMB_NULL); } @@ -2912,7 +2911,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__, fname, __FILE__, + cvProcessError(*cv_mem, CVLS_LMEMB_NULL, __LINE__, __func__, __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 c292572b10..a1b4fdc3d0 100644 --- a/src/cvodes/cvodes_nls_stg1.c +++ b/src/cvodes/cvodes_nls_stg1.c @@ -258,8 +258,7 @@ static int cvNlsLSolveSensStg1(N_Vector delta, void* cvode_mem) return (CV_SUCCESS); } -static int cvNlsConvTestSensStg1(SUNNonlinearSolver NLS, - SUNDIALS_MAYBE_UNUSED N_Vector ycor, +static int cvNlsConvTestSensStg1(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector delta, sunrealtype tol, N_Vector ewt, void* cvode_mem) { diff --git a/src/cvodes/fmod_int32/CMakeLists.txt b/src/cvodes/fmod/CMakeLists.txt similarity index 100% rename from src/cvodes/fmod_int32/CMakeLists.txt rename to src/cvodes/fmod/CMakeLists.txt diff --git a/src/cvodes/fmod_int64/fcvodes_mod.c b/src/cvodes/fmod/fcvodes_mod.c similarity index 100% rename from src/cvodes/fmod_int64/fcvodes_mod.c rename to src/cvodes/fmod/fcvodes_mod.c diff --git a/src/cvodes/fmod_int64/fcvodes_mod.f90 b/src/cvodes/fmod/fcvodes_mod.f90 similarity index 100% rename from src/cvodes/fmod_int64/fcvodes_mod.f90 rename to src/cvodes/fmod/fcvodes_mod.f90 diff --git a/src/cvodes/fmod_int32/fcvodes_mod.c b/src/cvodes/fmod_int32/fcvodes_mod.c deleted file mode 100644 index dfb9a1d1b5..0000000000 --- a/src/cvodes/fmod_int32/fcvodes_mod.c +++ /dev/null @@ -1,4040 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index f3cd69dcbf..0000000000 --- a/src/cvodes/fmod_int32/fcvodes_mod.f90 +++ /dev/null @@ -1,7142 +0,0 @@ -! 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 deleted file mode 100644 index 031ac9c6f9..0000000000 --- a/src/cvodes/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,46 +0,0 @@ -# --------------------------------------------------------------- -# 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/ida/CMakeLists.txt b/src/ida/CMakeLists.txt index 8a7e5ae25e..2bb371dee2 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/ida/README.md b/src/ida/README.md index 086ea1c262..325acccc19 100644 --- a/src/ida/README.md +++ b/src/ida/README.md @@ -1,5 +1,5 @@ # IDA -### Version 7.1.0 (Jun 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.1.0," - LLNL technical report UCRL-SM-208112, Jun 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.1.0," - LLNL technical report UCRL-SM-208113, 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, 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/ida/fmod_int32/CMakeLists.txt b/src/ida/fmod/CMakeLists.txt similarity index 100% rename from src/ida/fmod_int32/CMakeLists.txt rename to src/ida/fmod/CMakeLists.txt diff --git a/src/ida/fmod_int64/fida_mod.c b/src/ida/fmod/fida_mod.c similarity index 100% rename from src/ida/fmod_int64/fida_mod.c rename to src/ida/fmod/fida_mod.c diff --git a/src/ida/fmod_int64/fida_mod.f90 b/src/ida/fmod/fida_mod.f90 similarity index 100% rename from src/ida/fmod_int64/fida_mod.f90 rename to src/ida/fmod/fida_mod.f90 diff --git a/src/ida/fmod_int32/fida_mod.c b/src/ida/fmod_int32/fida_mod.c deleted file mode 100644 index 0ebd34a2c2..0000000000 --- a/src/ida/fmod_int32/fida_mod.c +++ /dev/null @@ -1,1784 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 735aa814cb..0000000000 --- a/src/ida/fmod_int32/fida_mod.f90 +++ /dev/null @@ -1,2992 +0,0 @@ -! 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 deleted file mode 100644 index e305f237d0..0000000000 --- a/src/ida/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,47 +0,0 @@ -# --------------------------------------------------------------- -# 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/ida_bbdpre.c b/src/ida/ida_bbdpre.c index 8bce33eea7..2352ff3b64 100644 --- a/src/ida/ida_bbdpre.c +++ b/src/ida/ida_bbdpre.c @@ -455,8 +455,7 @@ 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, - SUNDIALS_MAYBE_UNUSED N_Vector rr, sunrealtype c_j, - void* bbd_data) + N_Vector rr, sunrealtype c_j, void* bbd_data) { IBBDPrecData pdata; IDAMem IDA_mem; @@ -503,13 +502,9 @@ static int IDABBDPrecSetup(sunrealtype tt, N_Vector yy, N_Vector yp, IDABBDPrecSolve returns the value returned from the linear solver object. ---------------------------------------------------------------*/ -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) +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) { IBBDPrecData pdata; int retval; diff --git a/src/ida/ida_ic.c b/src/ida/ida_ic.c index 2d44eab573..f1a0dacaf0 100644 --- a/src/ida/ida_ic.c +++ b/src/ida/ida_ic.c @@ -58,6 +58,8 @@ */ 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/ida/ida_impl.h b/src/ida/ida_impl.h index f61a79381e..b68debbccb 100644 --- a/src/ida/ida_impl.h +++ b/src/ida/ida_impl.h @@ -20,12 +20,10 @@ #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 a8e2707208..c0a0c73649 100644 --- a/src/ida/ida_ls.c +++ b/src/ida/ida_ls.c @@ -860,8 +860,7 @@ 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, - SUNDIALS_MAYBE_UNUSED int lr) +int idaLsPSolve(void* ida_mem, N_Vector r, N_Vector z, sunrealtype tol, int lr) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -1139,7 +1138,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] += c_j * inc; + yptemp_data[j] += IDA_mem->ida_cj * inc; } /* Call res routine with incremented arguments. */ diff --git a/src/ida/ida_nls.c b/src/ida/ida_nls.c index 160b817327..8873023638 100644 --- a/src/ida/ida_nls.c +++ b/src/ida/ida_nls.c @@ -233,8 +233,7 @@ int idaNlsInit(IDAMem IDA_mem) return (IDA_SUCCESS); } -static int idaNlsLSetup(SUNDIALS_MAYBE_UNUSED sunbooleantype jbad, - sunbooleantype* jcur, void* ida_mem) +static int idaNlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* ida_mem) { IDAMem IDA_mem; int retval; @@ -319,8 +318,7 @@ static int idaNlsResidual(N_Vector ycor, N_Vector res, void* ida_mem) return (IDA_SUCCESS); } -static int idaNlsConvTest(SUNNonlinearSolver NLS, - SUNDIALS_MAYBE_UNUSED N_Vector ycor, N_Vector del, +static int idaNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, sunrealtype tol, N_Vector ewt, void* ida_mem) { IDAMem IDA_mem; diff --git a/src/idas/CMakeLists.txt b/src/idas/CMakeLists.txt index a5ed8b4739..f54b9fa8da 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/idas/README.md b/src/idas/README.md index 0b34eb22e7..7fd2909139 100644 --- a/src/idas/README.md +++ b/src/idas/README.md @@ -1,5 +1,5 @@ # IDAS -### Version 6.1.0 (Jun 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.1.0," - LLNL technical report UCRL-SM-234051, Jun 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.1.0," - LLNL technical report LLNL-TR-437091, Jun 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/idas/fmod_int32/CMakeLists.txt b/src/idas/fmod/CMakeLists.txt similarity index 100% rename from src/idas/fmod_int32/CMakeLists.txt rename to src/idas/fmod/CMakeLists.txt diff --git a/src/idas/fmod_int64/fidas_mod.c b/src/idas/fmod/fidas_mod.c similarity index 100% rename from src/idas/fmod_int64/fidas_mod.c rename to src/idas/fmod/fidas_mod.c diff --git a/src/idas/fmod_int64/fidas_mod.f90 b/src/idas/fmod/fidas_mod.f90 similarity index 100% rename from src/idas/fmod_int64/fidas_mod.f90 rename to src/idas/fmod/fidas_mod.f90 diff --git a/src/idas/fmod_int32/fidas_mod.c b/src/idas/fmod_int32/fidas_mod.c deleted file mode 100644 index 4774bf709e..0000000000 --- a/src/idas/fmod_int32/fidas_mod.c +++ /dev/null @@ -1,3879 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 3b5dcfe964..0000000000 --- a/src/idas/fmod_int32/fidas_mod.f90 +++ /dev/null @@ -1,6831 +0,0 @@ -! 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 deleted file mode 100644 index a6abe6516b..0000000000 --- a/src/idas/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ -# --------------------------------------------------------------- -# 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/idas.c b/src/idas/idas.c index 3174660c12..1cf688a5d0 100644 --- a/src/idas/idas.c +++ b/src/idas/idas.c @@ -7836,9 +7836,8 @@ static sunrealtype IDAQuadSensWrmsNorm(IDAMem IDA_mem, N_Vector* xQS, * Updates the norm old_nrm to account for all quadratures. */ -static sunrealtype IDAQuadWrmsNormUpdate(SUNDIALS_MAYBE_UNUSED IDAMem IDA_mem, - sunrealtype old_nrm, N_Vector xQ, - N_Vector wQ) +static sunrealtype IDAQuadWrmsNormUpdate(IDAMem IDA_mem, sunrealtype old_nrm, + N_Vector xQ, N_Vector wQ) { sunrealtype qnrm; @@ -8442,10 +8441,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(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) +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) { IDAMem IDA_mem; int method; diff --git a/src/idas/idas_bbdpre.c b/src/idas/idas_bbdpre.c index 25521a90d1..a584499293 100644 --- a/src/idas/idas_bbdpre.c +++ b/src/idas/idas_bbdpre.c @@ -469,8 +469,7 @@ 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, - SUNDIALS_MAYBE_UNUSED N_Vector rr, sunrealtype c_j, - void* bbd_data) + N_Vector rr, sunrealtype c_j, void* bbd_data) { IBBDPrecData pdata; IDAMem IDA_mem; @@ -517,13 +516,9 @@ static int IDABBDPrecSetup(sunrealtype tt, N_Vector yy, N_Vector yp, IDABBDPrecSolve returns the value returned from the linear solver object. ---------------------------------------------------------------*/ -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) +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) { IBBDPrecData pdata; int retval; diff --git a/src/idas/idas_ic.c b/src/idas/idas_ic.c index c2f4d030ba..783a75a3bb 100644 --- a/src/idas/idas_ic.c +++ b/src/idas/idas_ic.c @@ -58,6 +58,13 @@ */ 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/idas/idas_impl.h b/src/idas/idas_impl.h index e54b593bc5..90abcbcf8d 100644 --- a/src/idas/idas_impl.h +++ b/src/idas/idas_impl.h @@ -19,12 +19,10 @@ #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 088bcbb015..dc0c0bab52 100644 --- a/src/idas/idas_ls.c +++ b/src/idas/idas_ls.c @@ -901,8 +901,7 @@ 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, - SUNDIALS_MAYBE_UNUSED int lr) +int idaLsPSolve(void* ida_mem, N_Vector r, N_Vector z, sunrealtype tol, int lr) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -1180,7 +1179,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] += c_j * inc; + yptemp_data[j] += IDA_mem->ida_cj * inc; } /* Call res routine with incremented arguments. */ diff --git a/src/idas/idas_nls.c b/src/idas/idas_nls.c index 17ba1e6b5d..034f2c3612 100644 --- a/src/idas/idas_nls.c +++ b/src/idas/idas_nls.c @@ -233,8 +233,7 @@ int idaNlsInit(IDAMem IDA_mem) return (IDA_SUCCESS); } -static int idaNlsLSetup(SUNDIALS_MAYBE_UNUSED sunbooleantype jbad, - sunbooleantype* jcur, void* ida_mem) +static int idaNlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* ida_mem) { IDAMem IDA_mem; int retval; @@ -322,8 +321,7 @@ static int idaNlsResidual(N_Vector ycor, N_Vector res, void* ida_mem) return (IDA_SUCCESS); } -static int idaNlsConvTest(SUNNonlinearSolver NLS, - SUNDIALS_MAYBE_UNUSED N_Vector ycor, N_Vector del, +static int idaNlsConvTest(SUNNonlinearSolver NLS, 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 d527189905..d23a6c2bf8 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(SUNDIALS_MAYBE_UNUSED sunbooleantype jbad, - sunbooleantype* jcur, void* ida_mem) +static int idaNlsLSetupSensSim(sunbooleantype jbad, sunbooleantype* jcur, + void* ida_mem) { IDAMem IDA_mem; int retval; @@ -415,8 +415,7 @@ static int idaNlsResidualSensSim(N_Vector ycorSim, N_Vector resSim, void* ida_me return (IDA_SUCCESS); } -static int idaNlsConvTestSensSim(SUNNonlinearSolver NLS, - SUNDIALS_MAYBE_UNUSED N_Vector ycor, +static int idaNlsConvTestSensSim(SUNNonlinearSolver NLS, 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 3e1590c780..6311cf659a 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(SUNDIALS_MAYBE_UNUSED sunbooleantype jbad, - sunbooleantype* jcur, void* ida_mem) +static int idaNlsLSetupSensStg(sunbooleantype jbad, sunbooleantype* jcur, + void* ida_mem) { IDAMem IDA_mem; int retval; @@ -326,8 +326,7 @@ static int idaNlsResidualSensStg(N_Vector ycorStg, N_Vector resStg, void* ida_me return (IDA_SUCCESS); } -static int idaNlsConvTestSensStg(SUNNonlinearSolver NLS, - SUNDIALS_MAYBE_UNUSED N_Vector ycor, +static int idaNlsConvTestSensStg(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, sunrealtype tol, N_Vector ewt, void* ida_mem) { diff --git a/src/kinsol/CMakeLists.txt b/src/kinsol/CMakeLists.txt index 7306c3f449..e1353618ee 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/kinsol/README.md b/src/kinsol/README.md index 84678f7713..6433b7c77b 100644 --- a/src/kinsol/README.md +++ b/src/kinsol/README.md @@ -1,5 +1,5 @@ # KINSOL -### Version 7.1.0 (Jun 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.1.0," LLNL technical report - UCRL-SM-208116, Jun 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.1.0," - LLNL technical report UCRL-SM-208114, Jun 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 diff --git a/src/kinsol/fmod_int32/CMakeLists.txt b/src/kinsol/fmod/CMakeLists.txt similarity index 100% rename from src/kinsol/fmod_int32/CMakeLists.txt rename to src/kinsol/fmod/CMakeLists.txt diff --git a/src/kinsol/fmod_int64/fkinsol_mod.c b/src/kinsol/fmod/fkinsol_mod.c similarity index 100% rename from src/kinsol/fmod_int64/fkinsol_mod.c rename to src/kinsol/fmod/fkinsol_mod.c diff --git a/src/kinsol/fmod_int64/fkinsol_mod.f90 b/src/kinsol/fmod/fkinsol_mod.f90 similarity index 100% rename from src/kinsol/fmod_int64/fkinsol_mod.f90 rename to src/kinsol/fmod/fkinsol_mod.f90 diff --git a/src/kinsol/fmod_int32/fkinsol_mod.c b/src/kinsol/fmod_int32/fkinsol_mod.c deleted file mode 100644 index c8c99a75a1..0000000000 --- a/src/kinsol/fmod_int32/fkinsol_mod.c +++ /dev/null @@ -1,1092 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 45e03047a6..0000000000 --- a/src/kinsol/fmod_int32/fkinsol_mod.f90 +++ /dev/null @@ -1,1696 +0,0 @@ -! 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 deleted file mode 100644 index a154a8b865..0000000000 --- a/src/kinsol/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ -# --------------------------------------------------------------- -# 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/kinsol.c b/src/kinsol/kinsol.c index acfe65fd9b..982e9e9f2e 100644 --- a/src/kinsol/kinsol.c +++ b/src/kinsol/kinsol.c @@ -2491,10 +2491,8 @@ static sunrealtype KINScSNorm(KINMem kin_mem, N_Vector v, N_Vector u) * passes it to the info handler function. */ -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, - ...) +void KINPrintInfo(KINMem kin_mem, int info_code, const char* module, + const char* fname, const char* msgfmt, ...) { va_list ap; char msg[256], msg1[40]; @@ -2542,7 +2540,7 @@ void KINPrintInfo(SUNDIALS_MAYBE_UNUSED KINMem kin_mem, int info_code, { /* Compose the message */ - vsnprintf(msg, sizeof msg, msgfmt, ap); + vsprintf(msg, msgfmt, ap); } #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO @@ -2842,7 +2840,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 +2860,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 +2915,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(:) =", kin_mem->kin_nni); + "while-loop-after-compute-new", "u_%ld:\n", + kin_mem->kin_nni); N_VPrintFile(kin_mem->kin_unew, KIN_LOGGER->debug_fp); #endif diff --git a/src/kinsol/kinsol_bbdpre.c b/src/kinsol/kinsol_bbdpre.c index 7025f38a82..3cd8b78e5f 100644 --- a/src/kinsol/kinsol_bbdpre.c +++ b/src/kinsol/kinsol_bbdpre.c @@ -399,9 +399,8 @@ 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, - SUNDIALS_MAYBE_UNUSED N_Vector fval, - SUNDIALS_MAYBE_UNUSED N_Vector fscale, void* bbd_data) +static int KINBBDPrecSetup(N_Vector uu, N_Vector uscale, N_Vector fval, + N_Vector fscale, void* bbd_data) { KBBDPrecData pdata; KINMem kin_mem; @@ -464,11 +463,8 @@ static int KINBBDPrecSetup(N_Vector uu, N_Vector uscale, flag returned from the lienar solver object. ------------------------------------------------------------------*/ -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) +static int KINBBDPrecSolve(N_Vector uu, N_Vector uscale, N_Vector fval, + 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 117bf003f5..7122c076cc 100644 --- a/src/kinsol/kinsol_impl.h +++ b/src/kinsol/kinsol_impl.h @@ -20,14 +20,12 @@ #ifndef _KINSOL_IMPL_H #define _KINSOL_IMPL_H -#include <stdarg.h> - #include <kinsol/kinsol.h> +#include <stdarg.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 37c706e01d..684995a069 100644 --- a/src/kinsol/kinsol_ls.c +++ b/src/kinsol/kinsol_ls.c @@ -678,9 +678,7 @@ 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, - SUNDIALS_MAYBE_UNUSED sunrealtype tol, - SUNDIALS_MAYBE_UNUSED int lr) +int kinLsPSolve(void* kinmem, N_Vector r, N_Vector z, sunrealtype tol, int lr) { KINMem kin_mem; KINLsMem kinls_mem; @@ -943,8 +941,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, - SUNDIALS_MAYBE_UNUSED sunbooleantype* new_u, void* kinmem) +int kinLsDQJtimes(N_Vector v, N_Vector Jv, N_Vector u, sunbooleantype* new_u, + void* kinmem) { sunrealtype sigma, sigma_inv, sutsv, sq1norm, sign, vtv; KINMem kin_mem; diff --git a/src/nvector/manyvector/CMakeLists.txt b/src/nvector/manyvector/CMakeLists.txt index 4080f60ffc..00ee0d4372 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/nvector/manyvector/fmod_int32/CMakeLists.txt b/src/nvector/manyvector/fmod/CMakeLists.txt similarity index 100% rename from src/nvector/manyvector/fmod_int32/CMakeLists.txt rename to src/nvector/manyvector/fmod/CMakeLists.txt diff --git a/src/nvector/manyvector/fmod_int64/fnvector_manyvector_mod.c b/src/nvector/manyvector/fmod/fnvector_manyvector_mod.c similarity index 100% rename from src/nvector/manyvector/fmod_int64/fnvector_manyvector_mod.c rename to src/nvector/manyvector/fmod/fnvector_manyvector_mod.c diff --git a/src/nvector/manyvector/fmod_int64/fnvector_manyvector_mod.f90 b/src/nvector/manyvector/fmod/fnvector_manyvector_mod.f90 similarity index 99% rename from src/nvector/manyvector/fmod_int64/fnvector_manyvector_mod.f90 rename to src/nvector/manyvector/fmod/fnvector_manyvector_mod.f90 index 88587dc2f3..1c747bb028 100644 --- a/src/nvector/manyvector/fmod_int64/fnvector_manyvector_mod.f90 +++ b/src/nvector/manyvector/fmod/fnvector_manyvector_mod.f90 @@ -596,11 +596,7 @@ 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 @@ -1534,18 +1530,10 @@ 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_int64/fnvector_mpimanyvector_mod.c b/src/nvector/manyvector/fmod/fnvector_mpimanyvector_mod.c similarity index 100% rename from src/nvector/manyvector/fmod_int64/fnvector_mpimanyvector_mod.c rename to src/nvector/manyvector/fmod/fnvector_mpimanyvector_mod.c diff --git a/src/nvector/manyvector/fmod_int64/fnvector_mpimanyvector_mod.f90 b/src/nvector/manyvector/fmod/fnvector_mpimanyvector_mod.f90 similarity index 99% rename from src/nvector/manyvector/fmod_int64/fnvector_mpimanyvector_mod.f90 rename to src/nvector/manyvector/fmod/fnvector_mpimanyvector_mod.f90 index 39d48fa9be..d214fc462b 100644 --- a/src/nvector/manyvector/fmod_int64/fnvector_mpimanyvector_mod.f90 +++ b/src/nvector/manyvector/fmod/fnvector_mpimanyvector_mod.f90 @@ -696,11 +696,7 @@ 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 @@ -1794,18 +1790,10 @@ 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/manyvector/fmod_int32/fnvector_manyvector_mod.c b/src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.c deleted file mode 100644 index 39cc98fdf7..0000000000 --- a/src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.c +++ /dev/null @@ -1,1007 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index a9e0c7ea09..0000000000 --- a/src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.f90 +++ /dev/null @@ -1,1557 +0,0 @@ -! 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 deleted file mode 100644 index b567955a3d..0000000000 --- a/src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.c +++ /dev/null @@ -1,1167 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 2226643c27..0000000000 --- a/src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.f90 +++ /dev/null @@ -1,1817 +0,0 @@ -! 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 deleted file mode 100644 index 8033da01f7..0000000000 --- a/src/nvector/manyvector/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,61 +0,0 @@ -# --------------------------------------------------------------- -# 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/nvector_manyvector.c b/src/nvector/manyvector/nvector_manyvector.c index 31c74c78da..2785ee7b91 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,8 +31,6 @@ #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 @@ -474,7 +472,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)(SUNDIALS_MAYBE_UNUSED N_Vector v) +N_Vector_ID MVAPPEND(N_VGetVectorID)(N_Vector v) { #ifdef MANYVECTOR_BUILD_WITH_MPI return (SUNDIALS_NVEC_MPIMANYVECTOR); @@ -597,6 +595,9 @@ 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/nvector/mpiplusx/CMakeLists.txt b/src/nvector/mpiplusx/CMakeLists.txt index 1be179696d..c97db8224a 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/nvector/mpiplusx/fmod_int32/CMakeLists.txt b/src/nvector/mpiplusx/fmod/CMakeLists.txt similarity index 100% rename from src/nvector/mpiplusx/fmod_int32/CMakeLists.txt rename to src/nvector/mpiplusx/fmod/CMakeLists.txt diff --git a/src/nvector/mpiplusx/fmod_int64/fnvector_mpiplusx_mod.c b/src/nvector/mpiplusx/fmod/fnvector_mpiplusx_mod.c similarity index 100% rename from src/nvector/mpiplusx/fmod_int64/fnvector_mpiplusx_mod.c rename to src/nvector/mpiplusx/fmod/fnvector_mpiplusx_mod.c diff --git a/src/nvector/mpiplusx/fmod_int64/fnvector_mpiplusx_mod.f90 b/src/nvector/mpiplusx/fmod/fnvector_mpiplusx_mod.f90 similarity index 100% rename from src/nvector/mpiplusx/fmod_int64/fnvector_mpiplusx_mod.f90 rename to src/nvector/mpiplusx/fmod/fnvector_mpiplusx_mod.f90 diff --git a/src/nvector/mpiplusx/fmod_int32/fnvector_mpiplusx_mod.c b/src/nvector/mpiplusx/fmod_int32/fnvector_mpiplusx_mod.c deleted file mode 100644 index 5d6aeb893d..0000000000 --- a/src/nvector/mpiplusx/fmod_int32/fnvector_mpiplusx_mod.c +++ /dev/null @@ -1,327 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 1b29334b59..0000000000 --- a/src/nvector/mpiplusx/fmod_int32/fnvector_mpiplusx_mod.f90 +++ /dev/null @@ -1,241 +0,0 @@ -! 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 deleted file mode 100644 index d068b3609f..0000000000 --- a/src/nvector/mpiplusx/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -# --------------------------------------------------------------- -# 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/nvector_mpiplusx.c b/src/nvector/mpiplusx/nvector_mpiplusx.c index a955dfcf09..e8be7eb0cd 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_macros.h" +#include "sundials/priv/sundials_errors_impl.h" +#include "sundials/sundials_errors.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(SUNDIALS_MAYBE_UNUSED N_Vector v) +N_Vector_ID N_VGetVectorID_MPIPlusX(N_Vector v) { return SUNDIALS_NVEC_MPIPLUSX; } diff --git a/src/nvector/openmp/CMakeLists.txt b/src/nvector/openmp/CMakeLists.txt index 9cbc2f35fe..ab938e6694 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/nvector/openmp/fmod_int32/CMakeLists.txt b/src/nvector/openmp/fmod/CMakeLists.txt similarity index 100% rename from src/nvector/openmp/fmod_int32/CMakeLists.txt rename to src/nvector/openmp/fmod/CMakeLists.txt diff --git a/src/nvector/openmp/fmod_int64/fnvector_openmp_mod.c b/src/nvector/openmp/fmod/fnvector_openmp_mod.c similarity index 100% rename from src/nvector/openmp/fmod_int64/fnvector_openmp_mod.c rename to src/nvector/openmp/fmod/fnvector_openmp_mod.c diff --git a/src/nvector/openmp/fmod_int64/fnvector_openmp_mod.f90 b/src/nvector/openmp/fmod/fnvector_openmp_mod.f90 similarity index 100% rename from src/nvector/openmp/fmod_int64/fnvector_openmp_mod.f90 rename to src/nvector/openmp/fmod/fnvector_openmp_mod.f90 diff --git a/src/nvector/openmp/fmod_int32/fnvector_openmp_mod.c b/src/nvector/openmp/fmod_int32/fnvector_openmp_mod.c deleted file mode 100644 index ddf0295838..0000000000 --- a/src/nvector/openmp/fmod_int32/fnvector_openmp_mod.c +++ /dev/null @@ -1,961 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index e5f7cdc3f2..0000000000 --- a/src/nvector/openmp/fmod_int32/fnvector_openmp_mod.f90 +++ /dev/null @@ -1,1461 +0,0 @@ -! 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 deleted file mode 100644 index 31f4363b84..0000000000 --- a/src/nvector/openmp/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -# --------------------------------------------------------------- -# 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/nvector_openmp.c b/src/nvector/openmp/nvector_openmp.c index bcb1f6d6b6..649a27a6df 100644 --- a/src/nvector/openmp/nvector_openmp.c +++ b/src/nvector/openmp/nvector_openmp.c @@ -20,18 +20,16 @@ * 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_macros.h" +#include "sundials/sundials_context.h" +#include "sundials/sundials_errors.h" #define ZERO SUN_RCONST(0.0) #define HALF SUN_RCONST(0.5) @@ -84,10 +82,7 @@ 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(SUNDIALS_MAYBE_UNUSED N_Vector v) -{ - return SUNDIALS_NVEC_OPENMP; -} +N_Vector_ID N_VGetVectorID_OpenMP(N_Vector v) { return SUNDIALS_NVEC_OPENMP; } /* ---------------------------------------------------------------------------- * Function to create a new empty vector diff --git a/src/nvector/parallel/CMakeLists.txt b/src/nvector/parallel/CMakeLists.txt index 55effd6b9a..55cce2df2d 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/nvector/parallel/fmod_int32/CMakeLists.txt b/src/nvector/parallel/fmod/CMakeLists.txt similarity index 100% rename from src/nvector/parallel/fmod_int32/CMakeLists.txt rename to src/nvector/parallel/fmod/CMakeLists.txt diff --git a/src/nvector/parallel/fmod_int64/fnvector_parallel_mod.c b/src/nvector/parallel/fmod/fnvector_parallel_mod.c similarity index 100% rename from src/nvector/parallel/fmod_int64/fnvector_parallel_mod.c rename to src/nvector/parallel/fmod/fnvector_parallel_mod.c diff --git a/src/nvector/parallel/fmod_int64/fnvector_parallel_mod.f90 b/src/nvector/parallel/fmod/fnvector_parallel_mod.f90 similarity index 100% rename from src/nvector/parallel/fmod_int64/fnvector_parallel_mod.f90 rename to src/nvector/parallel/fmod/fnvector_parallel_mod.f90 diff --git a/src/nvector/parallel/fmod_int32/fnvector_parallel_mod.c b/src/nvector/parallel/fmod_int32/fnvector_parallel_mod.c deleted file mode 100644 index cdbd1f87c3..0000000000 --- a/src/nvector/parallel/fmod_int32/fnvector_parallel_mod.c +++ /dev/null @@ -1,1173 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 571b01856b..0000000000 --- a/src/nvector/parallel/fmod_int32/fnvector_parallel_mod.f90 +++ /dev/null @@ -1,1781 +0,0 @@ -! 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 deleted file mode 100644 index 3b4031b8c9..0000000000 --- a/src/nvector/parallel/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,49 +0,0 @@ -# --------------------------------------------------------------- -# 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/nvector_parallel.c b/src/nvector/parallel/nvector_parallel.c index eb278bc21d..a438b4eb29 100644 --- a/src/nvector/parallel/nvector_parallel.c +++ b/src/nvector/parallel/nvector_parallel.c @@ -16,16 +16,14 @@ * 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_macros.h" +#include "sundials/sundials_errors.h" +#include "sundials/sundials_types.h" #define ZERO SUN_RCONST(0.0) #define HALF SUN_RCONST(0.5) @@ -244,15 +242,6 @@ 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 aee1f08450..4e9ef4d50c 100644 --- a/src/nvector/parhyp/nvector_parhyp.c +++ b/src/nvector/parhyp/nvector_parhyp.c @@ -18,15 +18,13 @@ * 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_macros.h" +#include "sundials/sundials_errors.h" +#include "sundials/sundials_nvector.h" #define ZERO SUN_RCONST(0.0) #define HALF SUN_RCONST(0.5) @@ -138,10 +136,7 @@ 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(SUNDIALS_MAYBE_UNUSED N_Vector v) -{ - return SUNDIALS_NVEC_PARHYP; -} +N_Vector_ID N_VGetVectorID_ParHyp(N_Vector v) { return SUNDIALS_NVEC_PARHYP; } /* ---------------------------------------------------------------- * Function to create a new parhyp vector without underlying @@ -166,6 +161,8 @@ 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; @@ -429,7 +426,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(SUNDIALS_MAYBE_UNUSED N_Vector v) +sunrealtype* N_VGetArrayPointer_ParHyp(N_Vector v) { return NULL; /* ((sunrealtype *) NV_DATA_PH(v)); */ } @@ -438,8 +435,7 @@ sunrealtype* N_VGetArrayPointer_ParHyp(SUNDIALS_MAYBE_UNUSED N_Vector v) * This method is not implemented for HYPRE vector wrapper. * TODO: Put error handler in the function body. */ -void N_VSetArrayPointer_ParHyp(SUNDIALS_MAYBE_UNUSED sunrealtype* v_data, - SUNDIALS_MAYBE_UNUSED N_Vector v) +void N_VSetArrayPointer_ParHyp(sunrealtype* v_data, 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 f3accf46bd..87960d839a 100644 --- a/src/nvector/petsc/nvector_petsc.c +++ b/src/nvector/petsc/nvector_petsc.c @@ -18,14 +18,12 @@ * 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_macros.h" +#include "sundials/sundials_errors.h" #define ZERO SUN_RCONST(0.0) #define HALF SUN_RCONST(0.5) @@ -103,10 +101,7 @@ * Returns vector type ID. Used to identify vector implementation * from abstract N_Vector interface. */ -N_Vector_ID N_VGetVectorID_Petsc(SUNDIALS_MAYBE_UNUSED N_Vector v) -{ - return SUNDIALS_NVEC_PETSC; -} +N_Vector_ID N_VGetVectorID_Petsc(N_Vector v) { return SUNDIALS_NVEC_PETSC; } /* ---------------------------------------------------------------- * Function to create a new N_Vector wrapper with an empty (NULL) @@ -144,6 +139,8 @@ 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; @@ -400,19 +397,12 @@ void N_VSpace_Petsc(N_Vector v, sunindextype* lrw, sunindextype* liw) /* * Not implemented for PETSc wrapper. */ -sunrealtype* N_VGetArrayPointer_Petsc(SUNDIALS_MAYBE_UNUSED N_Vector v) -{ - return NULL; -} +sunrealtype* N_VGetArrayPointer_Petsc(N_Vector v) { return NULL; } /* * Not implemented for PETSc wrapper. */ -void N_VSetArrayPointer_Petsc(SUNDIALS_MAYBE_UNUSED sunrealtype* v_data, - SUNDIALS_MAYBE_UNUSED N_Vector v) -{ - return; -} +void N_VSetArrayPointer_Petsc(sunrealtype* v_data, N_Vector v) { return; } MPI_Comm N_VGetCommunicator_Petsc(N_Vector v) { return (NV_COMM_PTC(v)); } diff --git a/src/nvector/pthreads/CMakeLists.txt b/src/nvector/pthreads/CMakeLists.txt index 2aafa31e4a..bb4e3c361b 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/nvector/pthreads/fmod_int32/CMakeLists.txt b/src/nvector/pthreads/fmod/CMakeLists.txt similarity index 100% rename from src/nvector/pthreads/fmod_int32/CMakeLists.txt rename to src/nvector/pthreads/fmod/CMakeLists.txt diff --git a/src/nvector/pthreads/fmod_int64/fnvector_pthreads_mod.c b/src/nvector/pthreads/fmod/fnvector_pthreads_mod.c similarity index 100% rename from src/nvector/pthreads/fmod_int64/fnvector_pthreads_mod.c rename to src/nvector/pthreads/fmod/fnvector_pthreads_mod.c diff --git a/src/nvector/pthreads/fmod_int64/fnvector_pthreads_mod.f90 b/src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 similarity index 100% rename from src/nvector/pthreads/fmod_int64/fnvector_pthreads_mod.f90 rename to src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 diff --git a/src/nvector/pthreads/fmod_int32/fnvector_pthreads_mod.c b/src/nvector/pthreads/fmod_int32/fnvector_pthreads_mod.c deleted file mode 100644 index 77ac40a163..0000000000 --- a/src/nvector/pthreads/fmod_int32/fnvector_pthreads_mod.c +++ /dev/null @@ -1,961 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index fb2af230a5..0000000000 --- a/src/nvector/pthreads/fmod_int32/fnvector_pthreads_mod.f90 +++ /dev/null @@ -1,1461 +0,0 @@ -! 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 deleted file mode 100644 index e43ebc9c08..0000000000 --- a/src/nvector/pthreads/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -# --------------------------------------------------------------- -# 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/nvector_pthreads.c b/src/nvector/pthreads/nvector_pthreads.c index 5e5314afb3..6938934059 100644 --- a/src/nvector/pthreads/nvector_pthreads.c +++ b/src/nvector/pthreads/nvector_pthreads.c @@ -21,17 +21,16 @@ * structures to pass data to threads. * -----------------------------------------------------------------*/ -#include <math.h> +#include <math.h> /* define NAN */ +#include <nvector/nvector_pthreads.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_macros.h" +#include "sundials/priv/sundials_errors_impl.h" +#include "sundials/sundials_errors.h" #define ZERO SUN_RCONST(0.0) #define HALF SUN_RCONST(0.5) @@ -154,7 +153,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(SUNDIALS_MAYBE_UNUSED N_Vector v) +N_Vector_ID N_VGetVectorID_Pthreads(N_Vector v) { return SUNDIALS_NVEC_PTHREADS; } diff --git a/src/nvector/serial/CMakeLists.txt b/src/nvector/serial/CMakeLists.txt index c8e867daa8..efcfb15818 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/nvector/serial/fmod_int64/CMakeLists.txt b/src/nvector/serial/fmod/CMakeLists.txt similarity index 100% rename from src/nvector/serial/fmod_int64/CMakeLists.txt rename to src/nvector/serial/fmod/CMakeLists.txt diff --git a/src/nvector/serial/fmod_int64/fnvector_serial_mod.c b/src/nvector/serial/fmod/fnvector_serial_mod.c similarity index 100% rename from src/nvector/serial/fmod_int64/fnvector_serial_mod.c rename to src/nvector/serial/fmod/fnvector_serial_mod.c diff --git a/src/nvector/serial/fmod_int64/fnvector_serial_mod.f90 b/src/nvector/serial/fmod/fnvector_serial_mod.f90 similarity index 100% rename from src/nvector/serial/fmod_int64/fnvector_serial_mod.f90 rename to src/nvector/serial/fmod/fnvector_serial_mod.f90 diff --git a/src/nvector/serial/fmod_int32/CMakeLists.txt b/src/nvector/serial/fmod_int32/CMakeLists.txt deleted file mode 100644 index ebf2ec0182..0000000000 --- a/src/nvector/serial/fmod_int32/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# --------------------------------------------------------------- -# 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 - 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_int32/fnvector_serial_mod.c b/src/nvector/serial/fmod_int32/fnvector_serial_mod.c deleted file mode 100644 index 14ddfe38a0..0000000000 --- a/src/nvector/serial/fmod_int32/fnvector_serial_mod.c +++ /dev/null @@ -1,955 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index ac6df66be2..0000000000 --- a/src/nvector/serial/fmod_int32/fnvector_serial_mod.f90 +++ /dev/null @@ -1,1449 +0,0 @@ -! 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/nvector_serial.c b/src/nvector/serial/nvector_serial.c index 255aca3fb6..a4a1bff95a 100644 --- a/src/nvector/serial/nvector_serial.c +++ b/src/nvector/serial/nvector_serial.c @@ -16,16 +16,14 @@ * 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_macros.h" +#include "sundials/sundials_errors.h" #define ZERO SUN_RCONST(0.0) #define HALF SUN_RCONST(0.5) @@ -219,15 +217,6 @@ 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/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; diff --git a/src/nvector/trilinos/nvector_trilinos.cpp b/src/nvector/trilinos/nvector_trilinos.cpp index 880bb33c95..fdb28b7ef5 100644 --- a/src/nvector/trilinos/nvector_trilinos.cpp +++ b/src/nvector/trilinos/nvector_trilinos.cpp @@ -18,14 +18,11 @@ * 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 "sundials_macros.h" +#include <stdio.h> +#include <stdlib.h> #define ZERO SUN_RCONST(0.0) #define HALF SUN_RCONST(0.5) @@ -58,7 +55,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(SUNDIALS_MAYBE_UNUSED N_Vector v) +N_Vector_ID N_VGetVectorID_Trilinos(N_Vector v) { return SUNDIALS_NVEC_TRILINOS; } diff --git a/src/sunadaptcontroller/imexgus/CMakeLists.txt b/src/sunadaptcontroller/imexgus/CMakeLists.txt index 8bbef68cdf..9ca6b96a15 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt b/src/sunadaptcontroller/imexgus/fmod/CMakeLists.txt similarity index 97% rename from src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt rename to src/sunadaptcontroller/imexgus/fmod/CMakeLists.txt index 0c4142417c..0c9fd4f2c2 100644 --- a/src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt +++ b/src/sunadaptcontroller/imexgus/fmod/CMakeLists.txt @@ -17,6 +17,7 @@ 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_int32/fsunadaptcontroller_imexgus_mod.c b/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.c similarity index 100% rename from src/sunadaptcontroller/imexgus/fmod_int32/fsunadaptcontroller_imexgus_mod.c rename to src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.c diff --git a/src/sunadaptcontroller/imexgus/fmod_int32/fsunadaptcontroller_imexgus_mod.f90 b/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.f90 similarity index 100% rename from src/sunadaptcontroller/imexgus/fmod_int32/fsunadaptcontroller_imexgus_mod.f90 rename to src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.f90 diff --git a/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt b/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt deleted file mode 100644 index 0c4142417c..0000000000 --- a/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,25 +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 -# --------------------------------------------------------------- - -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/fsunadaptcontroller_imexgus_mod.c b/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.c deleted file mode 100644 index 1351217e15..0000000000 --- a/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.c +++ /dev/null @@ -1,359 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 29c98ad378..0000000000 --- a/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.f90 +++ /dev/null @@ -1,313 +0,0 @@ -! 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/imexgus/sunadaptcontroller_imexgus.c b/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c index e4bb23e6dd..11075d477f 100644 --- a/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c +++ b/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c @@ -17,13 +17,11 @@ #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_macros.h" +#include "sundials/priv/sundials_errors_impl.h" +#include "sundials/sundials_errors.h" /* --------------- * Macro accessors @@ -115,8 +113,7 @@ SUNErrCode SUNAdaptController_SetParams_ImExGus(SUNAdaptController C, * implementation of controller operations * ----------------------------------------------------------------- */ -SUNAdaptController_Type SUNAdaptController_GetType_ImExGus( - SUNDIALS_MAYBE_UNUSED SUNAdaptController C) +SUNAdaptController_Type SUNAdaptController_GetType_ImExGus(SUNAdaptController C) { return SUN_ADAPTCONTROLLER_H; } diff --git a/src/sunadaptcontroller/soderlind/CMakeLists.txt b/src/sunadaptcontroller/soderlind/CMakeLists.txt index 50cf7330bc..0b8c4c8cf4 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt b/src/sunadaptcontroller/soderlind/fmod/CMakeLists.txt similarity index 97% rename from src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt rename to src/sunadaptcontroller/soderlind/fmod/CMakeLists.txt index cdf9d3825e..44aa8a4922 100644 --- a/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt +++ b/src/sunadaptcontroller/soderlind/fmod/CMakeLists.txt @@ -17,6 +17,7 @@ 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_int32/fsunadaptcontroller_soderlind_mod.c b/src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.c similarity index 100% rename from src/sunadaptcontroller/soderlind/fmod_int32/fsunadaptcontroller_soderlind_mod.c rename to src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.c diff --git a/src/sunadaptcontroller/soderlind/fmod_int32/fsunadaptcontroller_soderlind_mod.f90 b/src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.f90 similarity index 100% rename from src/sunadaptcontroller/soderlind/fmod_int32/fsunadaptcontroller_soderlind_mod.f90 rename to src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.f90 diff --git a/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt b/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt deleted file mode 100644 index cdf9d3825e..0000000000 --- a/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt +++ /dev/null @@ -1,25 +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 -# --------------------------------------------------------------- - -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/fsunadaptcontroller_soderlind_mod.c b/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.c deleted file mode 100644 index f3da8c259b..0000000000 --- a/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.c +++ /dev/null @@ -1,501 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index cd6bc5262a..0000000000 --- a/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.f90 +++ /dev/null @@ -1,577 +0,0 @@ -! 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/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c b/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c index bca88252cb..da60d812f1 100644 --- a/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c +++ b/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c @@ -17,13 +17,11 @@ #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_macros.h" +#include "sundials/priv/sundials_errors_impl.h" +#include "sundials/sundials_errors.h" /* --------------- * Macro accessors @@ -299,8 +297,7 @@ SUNErrCode SUNAdaptController_SetParams_ImpGus(SUNAdaptController C, * implementation of controller operations * ----------------------------------------------------------------- */ -SUNAdaptController_Type SUNAdaptController_GetType_Soderlind( - SUNDIALS_MAYBE_UNUSED SUNAdaptController C) +SUNAdaptController_Type SUNAdaptController_GetType_Soderlind(SUNAdaptController C) { return SUN_ADAPTCONTROLLER_H; } diff --git a/src/sundials/CMakeLists.txt b/src/sundials/CMakeLists.txt index b8a19e2ff2..5ff9f3d4f6 100644 --- a/src/sundials/CMakeLists.txt +++ b/src/sundials/CMakeLists.txt @@ -32,7 +32,6 @@ set(sundials_HEADERS sundials_dense.h sundials_direct.h sundials_errors.h - sundials_futils.h sundials_iterative.h sundials_linearsolver.h sundials_linearsolver.hpp @@ -49,11 +48,16 @@ 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 ) +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() @@ -85,7 +89,6 @@ set(sundials_SOURCES sundials_dense.c sundials_direct.c sundials_errors.c - sundials_futils.c sundials_hashmap.c sundials_iterative.c sundials_linearsolver.c @@ -96,6 +99,7 @@ set(sundials_SOURCES sundials_nonlinearsolver.c sundials_nvector_senswrapper.c sundials_nvector.c + sundials_stepper.c sundials_profiler.c sundials_version.c ) @@ -104,16 +108,17 @@ 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) 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) endif() - if(SUNDIALS_BUILD_WITH_PROFILING) if(ENABLE_CALIPER) set(_link_caliper_if_needed PUBLIC caliper) @@ -163,5 +168,5 @@ generate_export_header( # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sundials/fmod_int32/CMakeLists.txt b/src/sundials/fmod/CMakeLists.txt similarity index 94% rename from src/sundials/fmod_int32/CMakeLists.txt rename to src/sundials/fmod/CMakeLists.txt index 957328e8ff..74fe6c96ee 100644 --- a/src/sundials/fmod_int32/CMakeLists.txt +++ b/src/sundials/fmod/CMakeLists.txt @@ -22,4 +22,6 @@ 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/fsundials_core_mod.c similarity index 99% rename from src/sundials/fmod_int64/fsundials_core_mod.c rename to src/sundials/fmod/fsundials_core_mod.c index 2478b92d68..4af16b91a4 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.c +++ b/src/sundials/fmod/fsundials_core_mod.c @@ -227,6 +227,10 @@ #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" @@ -291,6 +295,13 @@ 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 ; @@ -2505,14 +2516,6 @@ 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_int64/fsundials_core_mod.f90 b/src/sundials/fmod/fsundials_core_mod.f90 similarity index 99% rename from src/sundials/fmod_int64/fsundials_core_mod.f90 rename to src/sundials/fmod/fsundials_core_mod.f90 index 7096d0c6ce..4334dfe0d3 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.f90 +++ b/src/sundials/fmod/fsundials_core_mod.f90 @@ -44,11 +44,14 @@ module fsundials_core_mod include "mpif.h" integer(C_INT), protected, public :: SUN_COMM_NULL = MPI_COMM_NULL #else - integer(C_INT), parameter, public :: SUN_COMM_NULL = 0_C_INT + integer(C_INT), protected, public, & + bind(C, name="_wrap_SUN_COMM_NULL") :: SUN_COMM_NULL #endif - integer(C_INT), parameter, public :: SUNFALSE = 0_C_INT - integer(C_INT), parameter, public :: SUNTRUE = 1_C_INT + 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 @@ -533,7 +536,6 @@ 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 @@ -1953,12 +1955,6 @@ 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) @@ -4626,15 +4622,6 @@ 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/fmod_int32/fsundials_core_mod.c b/src/sundials/fmod_int32/fsundials_core_mod.c deleted file mode 100644 index 62e0215249..0000000000 --- a/src/sundials/fmod_int32/fsundials_core_mod.c +++ /dev/null @@ -1,2644 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 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 deleted file mode 100644 index 2bda4cb0fe..0000000000 --- a/src/sundials/fmod_int32/fsundials_core_mod.f90 +++ /dev/null @@ -1,4786 +0,0 @@ -! 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), parameter, public :: SUN_COMM_NULL = 0_C_INT -#endif - - 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 - 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/sundials_band.c b/src/sundials/sundials_band.c index d5fbcbb6a6..e8051d80c1 100644 --- a/src/sundials/sundials_band.c +++ b/src/sundials/sundials_band.c @@ -38,33 +38,64 @@ 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) @@ -181,6 +212,12 @@ 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) { @@ -215,6 +252,13 @@ 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) @@ -232,6 +276,12 @@ 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) { @@ -247,6 +297,11 @@ 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; @@ -254,6 +309,12 @@ 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) @@ -261,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] = ZERO; } + for (i = 0; i < n; i++) { y[i] = 0.0; } for (j = 0; j < n; j++) { diff --git a/src/sundials/sundials_context.c b/src/sundials/sundials_context.c index 86b0a49c34..b3c847e682 100644 --- a/src/sundials/sundials_context.c +++ b/src/sundials/sundials_context.c @@ -18,17 +18,15 @@ #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) { @@ -211,9 +209,6 @@ 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_dense.c b/src/sundials/sundials_dense.c index ce420fca0f..f022212f9c 100644 --- a/src/sundials/sundials_dense.c +++ b/src/sundials/sundials_dense.c @@ -38,47 +38,99 @@ 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) { @@ -147,6 +199,11 @@ 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) { @@ -189,6 +246,11 @@ 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; @@ -227,6 +289,11 @@ 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; @@ -267,6 +334,12 @@ 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) { @@ -331,6 +404,12 @@ 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) @@ -362,6 +441,11 @@ 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) { @@ -376,6 +460,11 @@ 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) { @@ -389,6 +478,11 @@ 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; @@ -396,13 +490,19 @@ 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) { sunindextype i, j; sunrealtype* col_j; - for (i = 0; i < m; i++) { y[i] = ZERO; } + for (i = 0; i < m; i++) { y[i] = 0.0; } for (j = 0; j < n; j++) { diff --git a/src/sundials/sundials_direct.c b/src/sundials/sundials_direct.c index 02ff31d96c..2bf135b9d3 100644 --- a/src/sundials/sundials_direct.c +++ b/src/sundials/sundials_direct.c @@ -23,6 +23,11 @@ #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; @@ -63,6 +68,11 @@ 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; @@ -88,6 +98,12 @@ 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) { @@ -135,6 +151,11 @@ 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) { @@ -162,6 +183,8 @@ sunrealtype** SUNDlsMat_newBandMat(sunindextype n, sunindextype smu, return (a); } +void DestroyMat(SUNDlsMat A) { SUNDlsMat_DestroyMat(A); } + void SUNDlsMat_DestroyMat(SUNDlsMat A) { free(A->data); @@ -171,6 +194,8 @@ void SUNDlsMat_DestroyMat(SUNDlsMat A) A = NULL; } +void destroyMat(sunrealtype** a) { SUNDlsMat_destroyMat(a); } + void SUNDlsMat_destroyMat(sunrealtype** a) { free(a[0]); @@ -179,6 +204,8 @@ void SUNDlsMat_destroyMat(sunrealtype** a) a = NULL; } +int* NewIntArray(int N) { return (SUNDlsMat_NewIntArray(N)); } + int* SUNDlsMat_NewIntArray(int N) { int* vec; @@ -191,6 +218,8 @@ int* SUNDlsMat_NewIntArray(int N) return (vec); } +int* newIntArray(int N) { return (SUNDlsMat_newIntArray(N)); } + int* SUNDlsMat_newIntArray(int n) { int* v; @@ -203,6 +232,11 @@ int* SUNDlsMat_newIntArray(int n) return (v); } +sunindextype* NewIndexArray(sunindextype N) +{ + return (SUNDlsMat_NewIndexArray(N)); +} + sunindextype* SUNDlsMat_NewIndexArray(sunindextype N) { sunindextype* vec; @@ -215,6 +249,11 @@ sunindextype* SUNDlsMat_NewIndexArray(sunindextype N) return (vec); } +sunindextype* newIndexArray(sunindextype n) +{ + return (SUNDlsMat_newIndexArray(n)); +} + sunindextype* SUNDlsMat_newIndexArray(sunindextype n) { sunindextype* v; @@ -227,6 +266,11 @@ sunindextype* SUNDlsMat_newIndexArray(sunindextype n) return (v); } +sunrealtype* NewRealArray(sunindextype N) +{ + return (SUNDlsMat_NewRealArray(N)); +} + sunrealtype* SUNDlsMat_NewRealArray(sunindextype N) { sunrealtype* vec; @@ -239,6 +283,11 @@ sunrealtype* SUNDlsMat_NewRealArray(sunindextype N) return (vec); } +sunrealtype* newRealArray(sunindextype N) +{ + return (SUNDlsMat_newRealArray(N)); +} + sunrealtype* SUNDlsMat_newRealArray(sunindextype m) { sunrealtype* v; @@ -251,18 +300,24 @@ 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; @@ -279,6 +334,8 @@ void SUNDlsMat_AddIdentity(SUNDlsMat A) } } +void SetToZero(SUNDlsMat A) { SUNDlsMat_SetToZero(A); } + void SUNDlsMat_SetToZero(SUNDlsMat A) { sunindextype i, j, colSize; @@ -309,6 +366,8 @@ 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; diff --git a/src/sundials/sundials_errors.c b/src/sundials/sundials_errors.c index acc3a0e5bc..667a3a4e07 100644 --- a/src/sundials/sundials_errors.c +++ b/src/sundials/sundials_errors.c @@ -10,18 +10,17 @@ * 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, @@ -63,8 +62,7 @@ const char* SUNGetErrMsg(SUNErrCode code) void SUNLogErrHandlerFn(int line, const char* func, const char* file, const char* msg, SUNErrCode err_code, - SUNDIALS_MAYBE_UNUSED void* err_user_data, - SUNContext sunctx) + void* err_user_data, SUNContext sunctx) { char* file_and_line = sunCombineFileAndLine(line, file); if (msg == NULL) { msg = SUNGetErrMsg(err_code); } @@ -74,10 +72,8 @@ void SUNLogErrHandlerFn(int line, const char* func, const char* file, } void SUNAbortErrHandlerFn(int line, const char* func, const char* file, - SUNDIALS_MAYBE_UNUSED const char* msg, - SUNDIALS_MAYBE_UNUSED SUNErrCode err_code, - SUNDIALS_MAYBE_UNUSED void* err_user_data, - SUNContext sunctx) + const char* msg, SUNErrCode err_code, + 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_futils.c b/src/sundials/sundials_futils.c index 3a0d0f27d1..e494fe7447 100644 --- a/src/sundials/sundials_futils.c +++ b/src/sundials/sundials_futils.c @@ -17,7 +17,6 @@ #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/src/sundials/sundials_hashmap.c b/src/sundials/sundials_hashmap.c index acf1c12c8d..55c786b34f 100644 --- a/src/sundials/sundials_hashmap.c +++ b/src/sundials/sundials_hashmap.c @@ -21,11 +21,9 @@ #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; @@ -35,7 +33,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) { @@ -142,8 +140,7 @@ SUNErrCode SUNHashMap_Destroy(SUNHashMap* map, void (*freevalue)(void* ptr)) * ``<-1`` -- an error occurred */ int SUNHashMap_Iterate(SUNHashMap map, int start, - int (*yieldfn)(int, SUNHashMapKeyValue, const void*), - const void* ctx) + int (*yieldfn)(int, SUNHashMapKeyValue, void*), void* ctx) { int i; @@ -162,8 +159,7 @@ int SUNHashMap_Iterate(SUNHashMap map, int start, return (map->max_size); } -static int sunHashMapLinearProbeInsert(int idx, SUNHashMapKeyValue kv, - SUNDIALS_MAYBE_UNUSED const void* ctx) +static int sunHashMapLinearProbeInsert(int idx, SUNHashMapKeyValue kv, void* ctx) { /* find the next open spot */ if (kv == NULL) { return (idx); /* open spot found at idx */ } @@ -220,8 +216,7 @@ int SUNHashMap_Insert(SUNHashMap map, const char* key, void* value) return (0); } -static int sunHashMapLinearProbeGet(int idx, SUNHashMapKeyValue kv, - const void* key) +static int sunHashMapLinearProbeGet(int idx, SUNHashMapKeyValue kv, void* key) { /* target key cannot be NULL */ if (key == NULL) { return (-2); } @@ -265,7 +260,8 @@ 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, key); + retval = SUNHashMap_Iterate(map, idx + 1, sunHashMapLinearProbeGet, + (void*)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 235947ed71..7fc743a2f3 100644 --- a/src/sundials/sundials_hashmap_impl.h +++ b/src/sundials/sundials_hashmap_impl.h @@ -43,8 +43,7 @@ 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, const void*), - const void* ctx); + 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, diff --git a/src/sundials/sundials_logger.c b/src/sundials/sundials_logger.c index bc4d6869ae..2b109f677b 100644 --- a/src/sundials/sundials_logger.c +++ b/src/sundials/sundials_logger.c @@ -16,19 +16,18 @@ #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_types.h> + +#include "sundials/sundials_errors.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 */ @@ -66,7 +65,6 @@ 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; @@ -80,15 +78,13 @@ 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(SUNDIALS_MAYBE_UNUSED SUNLogger logger, - int* rank_ref) +static sunbooleantype sunLoggerIsOutputRank(SUNLogger logger, int* rank_ref) { sunbooleantype retval; @@ -375,13 +371,6 @@ 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; @@ -428,9 +417,6 @@ 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 deleted file mode 100644 index 4bf007e507..0000000000 --- a/src/sundials/sundials_macros.h +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * 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 60ed704a07..ac9f56680c 100644 --- a/src/sundials/sundials_mpi_errors.c +++ b/src/sundials/sundials_mpi_errors.c @@ -13,20 +13,16 @@ #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, - SUNDIALS_MAYBE_UNUSED const char* msg, - SUNErrCode err_code, - SUNDIALS_MAYBE_UNUSED void* err_user_data, - SUNContext sunctx) + const char* msg, SUNErrCode err_code, + 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 9b15332993..a6549d81b5 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); - if (result) { result->sunctx = w->sunctx; } + result = w->ops->nvclone(w); + 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); - if (result) { result->sunctx = w->sunctx; } + result = w->ops->nvcloneempty(w); + result->sunctx = w->sunctx; SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(w)); return result; } @@ -335,11 +335,7 @@ void N_VSpace(N_Vector v, sunindextype* lrw, sunindextype* liw) sunrealtype* N_VGetArrayPointer(N_Vector v) { - if (v->ops->nvgetarraypointer) - { - return (sunrealtype*)v->ops->nvgetarraypointer(v); - } - else { return NULL; } + return ((sunrealtype*)v->ops->nvgetarraypointer(v)); } sunrealtype* N_VGetDeviceArrayPointer(N_Vector v) @@ -353,7 +349,7 @@ sunrealtype* N_VGetDeviceArrayPointer(N_Vector v) void N_VSetArrayPointer(sunrealtype* v_data, N_Vector v) { - if (v->ops->nvsetarraypointer) { v->ops->nvsetarraypointer(v_data, v); } + v->ops->nvsetarraypointer(v_data, v); return; } diff --git a/src/sundials/sundials_profiler.c b/src/sundials/sundials_profiler.c index c85244817c..4a2e12e783 100644 --- a/src/sundials/sundials_profiler.c +++ b/src/sundials/sundials_profiler.c @@ -12,16 +12,12 @@ * 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_math.h> -#include <sundials/sundials_profiler.h> -#include <sundials/sundials_types.h> + +#include "sundials/sundials_errors.h" +#include "sundials/sundials_types.h" #if SUNDIALS_MPI_ENABLED #include <mpi.h> @@ -37,9 +33,14 @@ #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") @@ -57,7 +58,7 @@ typedef struct _sunTimespec #if SUNDIALS_MPI_ENABLED static SUNErrCode sunCollectTimers(SUNProfiler p); #endif -static void sunPrintTimer(SUNHashMapKeyValue kv, FILE* fp, void* pvoid); +static void sunPrintTimers(int idx, SUNHashMapKeyValue kv, FILE* fp, void* pvoid); static int sunCompareTimes(const void* l, const void* r); static int sunclock_gettime_monotonic(sunTimespec* tp); @@ -419,7 +420,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]) { sunPrintTimer(sorted[i], fp, (void*)p); } + if (sorted[i]) { sunPrintTimers(i, sorted[i], fp, (void*)p); } } free(sorted); } @@ -442,7 +443,7 @@ SUNErrCode SUNProfiler_Print(SUNProfiler p, FILE* fp) #if SUNDIALS_MPI_ENABLED static void sunTimerStructReduceMaxAndSum(void* a, void* b, int* len, - SUNDIALS_MAYBE_UNUSED MPI_Datatype* dType) + MPI_Datatype* dType) { sunTimerStruct* a_ts = (sunTimerStruct*)a; sunTimerStruct* b_ts = (sunTimerStruct*)b; @@ -522,7 +523,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 sunPrintTimer(SUNHashMapKeyValue kv, FILE* fp, void* pvoid) +void sunPrintTimers(int idx, SUNHashMapKeyValue kv, FILE* fp, void* pvoid) { SUNProfiler p = (SUNProfiler)pvoid; sunTimerStruct* ts = (sunTimerStruct*)kv->value; @@ -542,8 +543,8 @@ int sunCompareTimes(const void* l, const void* r) double left_max; double right_max; - const SUNHashMapKeyValue left = *((const SUNHashMapKeyValue*)l); - const SUNHashMapKeyValue right = *((const SUNHashMapKeyValue*)r); + const SUNHashMapKeyValue left = *((SUNHashMapKeyValue*)l); + const SUNHashMapKeyValue right = *((SUNHashMapKeyValue*)r); if (left == NULL && right == NULL) { return 0; } if (left == NULL) { return 1; } diff --git a/src/sundials/sundials_stepper.c b/src/sundials/sundials_stepper.c new file mode 100644 index 0000000000..8bb2cbadac --- /dev/null +++ b/src/sundials/sundials_stepper.c @@ -0,0 +1,232 @@ + + +#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_stepper_impl.h" + +SUNErrCode SUNStepper_Create(SUNContext sunctx, SUNStepper* stepper_ptr) +{ + SUNFunctionBegin(sunctx); + + SUNStepper stepper = NULL; + stepper = malloc(sizeof(*stepper)); + SUNAssert(stepper, SUN_ERR_MALLOC_FAIL); + + stepper->content = NULL; + stepper->sunctx = sunctx; + stepper->last_flag = SUN_SUCCESS; + stepper->forcing = NULL; + stepper->nforcing = 0; + stepper->nforcing_allocated = 0; + stepper->tshift = SUN_RCONST(0.0); + stepper->tscale = SUN_RCONST(0.0); + stepper->fused_scalars = NULL; + stepper->fused_vectors = NULL; + + stepper->ops = malloc(sizeof(*(stepper->ops))); + SUNAssert(stepper->ops, SUN_ERR_MALLOC_FAIL); + + stepper->ops->advance = NULL; + stepper->ops->onestep = NULL; + stepper->ops->trystep = NULL; + stepper->ops->fullrhs = NULL; + stepper->ops->reset = NULL; + + *stepper_ptr = stepper; + + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_Destroy(SUNStepper* stepper_ptr) +{ + SUNFunctionBegin((*stepper_ptr)->sunctx); + + SUNStepper stepper = *stepper_ptr; + + /* free the inner forcing and fused op workspace vector */ + if (stepper->forcing) + { + N_VDestroyVectorArray(stepper->forcing, stepper->nforcing); + N_VDestroyVectorArray(stepper->fused_vectors, stepper->nforcing); + free(stepper->fused_scalars); + } + + free(stepper->ops); + free(stepper); + *stepper_ptr = NULL; + + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_Advance(SUNStepper stepper, sunrealtype t0, + sunrealtype tout, N_Vector y, sunrealtype* tret, + int* stop_reason) +{ + SUNFunctionBegin(stepper->sunctx); + if (stepper->ops->advance) + { + return stepper->ops->advance(stepper, t0, tout, y, tret, stop_reason); + } + return SUN_ERR_NOT_IMPLEMENTED; +} + +SUNErrCode SUNStepper_Step(SUNStepper stepper, sunrealtype t0, sunrealtype tout, + N_Vector y, sunrealtype* tret, int* stop_reason) +{ + SUNFunctionBegin(stepper->sunctx); + if (stepper->ops->onestep) + { + return stepper->ops->onestep(stepper, t0, tout, y, tret, stop_reason); + } + return SUN_ERR_NOT_IMPLEMENTED; +} + +SUNErrCode SUNStepper_TryStep(SUNStepper stepper, sunrealtype t0, + sunrealtype tout, N_Vector y, sunrealtype* tret, + int* stop_reason) +{ + SUNFunctionBegin(stepper->sunctx); + if (stepper->ops->trystep) + { + return stepper->ops->trystep(stepper, t0, tout, y, tret, stop_reason); + } + return SUN_ERR_NOT_IMPLEMENTED; +} + +SUNErrCode SUNStepper_Reset(SUNStepper stepper, sunrealtype tR, N_Vector yR) +{ + SUNFunctionBegin(stepper->sunctx); + if (stepper->ops->advance) { return stepper->ops->reset(stepper, tR, yR); } + 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_SetAdvanceFn(SUNStepper stepper, SUNStepperAdvanceFn fn) +{ + SUNFunctionBegin(stepper->sunctx); + stepper->ops->advance = fn; + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_SetOneStepFn(SUNStepper stepper, SUNStepperOneStepFn fn) +{ + SUNFunctionBegin(stepper->sunctx); + stepper->ops->onestep = fn; + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_SetTryStepFn(SUNStepper stepper, SUNStepperTryStepFn fn) +{ + SUNFunctionBegin(stepper->sunctx); + stepper->ops->trystep = 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_SetForcing(SUNStepper stepper, int count, N_Vector tmpl) +{ + SUNFunctionBegin(stepper->sunctx); + + stepper->nforcing = count; + + if (stepper->nforcing_allocated < stepper->nforcing) + { + if (stepper->nforcing_allocated) + { + N_VDestroyVectorArray(stepper->forcing, stepper->nforcing_allocated); + SUNCheckLastErr(); + } + stepper->forcing = N_VCloneVectorArray(stepper->nforcing, tmpl); + SUNCheckLastErr(); + stepper->nforcing_allocated = stepper->nforcing; + } + + if (!stepper->fused_vectors) + { + stepper->fused_vectors = N_VNewVectorArray(stepper->nforcing, SUNCTX_); + SUNCheckLastErr(); + } + + if (!stepper->fused_scalars) + { + stepper->fused_scalars = + (sunrealtype*)calloc(count + 1, sizeof(*stepper->fused_scalars)); + SUNAssert(stepper->fused_scalars, SUN_ERR_MEM_FAIL); + } + + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_AddForcing(SUNStepper stepper, sunrealtype t, N_Vector f) +{ + SUNFunctionBegin(stepper->sunctx); + + /* if nforcing is 0, then forcing is 'disabled' */ + if (!stepper->nforcing) { return SUN_SUCCESS; } + + /* always append the constant forcing term */ + stepper->fused_scalars[0] = SUN_RCONST(1.0); + stepper->fused_vectors[0] = f; + + /* compute normalized time tau and initialize tau^i */ + sunrealtype tau = (t - stepper->tshift) / (stepper->tscale); + sunrealtype taui = SUN_RCONST(1.0); + + for (int i = 0; i < stepper->nforcing; i++) + { + stepper->fused_scalars[i + 1] = taui; + stepper->fused_vectors[i + 1] = stepper->forcing[i]; + taui *= tau; + } + + N_VLinearCombination(stepper->nforcing + 1, stepper->fused_scalars, + stepper->fused_vectors, f); + + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_GetForcingData(SUNStepper stepper, sunrealtype* tshift, + sunrealtype* tscale, N_Vector** forcing, + int* nforcing) +{ + sunrealtype tau, taui; + int i; + + *tshift = stepper->tshift; + *tscale = stepper->tscale; + *forcing = stepper->forcing; + *nforcing = stepper->nforcing; + + 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..986259596c --- /dev/null +++ b/src/sundials/sundials_stepper_impl.h @@ -0,0 +1,60 @@ +/* ----------------------------------------------------------------- + * 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_ +{ + SUNStepperAdvanceFn advance; + SUNStepperOneStepFn onestep; + SUNStepperTryStepFn trystep; + SUNStepperFullRhsFn fullrhs; + SUNStepperResetFn reset; +}; + +struct SUNStepper_ +{ + /* stepper specific content and operations */ + void* content; + SUNStepper_Ops ops; + + /* stepper context */ + SUNContext sunctx; + + /* base class data */ + N_Vector* forcing; /* array of forcing vectors */ + int nforcing; /* number of forcing vectors active */ + int nforcing_allocated; /* number of forcing vectors allocated */ + int last_flag; /* last stepper return flag */ + sunrealtype tshift; /* time normalization shift */ + sunrealtype tscale; /* time normalization scaling */ + + /* fused op workspace */ + sunrealtype* fused_scalars; + N_Vector* fused_vectors; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _SUNDIALS_STEPPER_IMPL_H */ diff --git a/src/sundials/sundials_utils.h b/src/sundials/sundials_utils.h index 44ce2a7d4b..6866ffac2c 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 = vsnprintf(*str, size + 1, fmt, args); + size = vsprintf(*str, fmt, args); return size; } diff --git a/src/sundials/sundials_xbraid.c b/src/sundials/sundials_xbraid.c index 95016e10bd..6368d5ca5a 100644 --- a/src/sundials/sundials_xbraid.c +++ b/src/sundials/sundials_xbraid.c @@ -14,10 +14,9 @@ * This is the implementation file for the SUNDIALS + XBraid interface. * -------------------------------------------------------------------------- */ -#include <sundials/sundials_math.h> -#include <sundials/sundials_xbraid.h> +#include "sundials/sundials_xbraid.h" -#include "sundials_macros.h" +#include "sundials/sundials_math.h" #define ONE SUN_RCONST(1.0) @@ -115,8 +114,7 @@ int SUNBraidVector_GetNVector(SUNBraidVector u, N_Vector* y) } /* Create clone of an existing vector */ -int SUNBraidVector_Clone(SUNDIALS_MAYBE_UNUSED braid_App app, braid_Vector u, - braid_Vector* v_ptr) +int SUNBraidVector_Clone(braid_App app, braid_Vector u, braid_Vector* v_ptr) { int flag; N_Vector vy; @@ -140,7 +138,7 @@ int SUNBraidVector_Clone(SUNDIALS_MAYBE_UNUSED braid_App app, braid_Vector u, } /* Free vector */ -int SUNBraidVector_Free(SUNDIALS_MAYBE_UNUSED braid_App app, braid_Vector u) +int SUNBraidVector_Free(braid_App app, braid_Vector u) { /* Check for valid input */ if (u == NULL) { return SUNBRAID_SUCCESS; } @@ -160,8 +158,8 @@ int SUNBraidVector_Free(SUNDIALS_MAYBE_UNUSED braid_App app, braid_Vector u) } /* Compute alpha x + beta y -> y */ -int SUNBraidVector_Sum(SUNDIALS_MAYBE_UNUSED braid_App app, braid_Real alpha, - braid_Vector x, braid_Real beta, braid_Vector y) +int SUNBraidVector_Sum(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; } @@ -173,8 +171,7 @@ int SUNBraidVector_Sum(SUNDIALS_MAYBE_UNUSED braid_App app, braid_Real alpha, } /* Compute L2 norm */ -int SUNBraidVector_SpatialNorm(SUNDIALS_MAYBE_UNUSED braid_App app, - braid_Vector u, braid_Real* norm_ptr) +int SUNBraidVector_SpatialNorm(braid_App app, braid_Vector u, braid_Real* norm_ptr) { /* Check for valid wrapper */ if (u == NULL) { return SUNBRAID_ILLINPUT; } @@ -188,7 +185,7 @@ int SUNBraidVector_SpatialNorm(SUNDIALS_MAYBE_UNUSED braid_App app, /* Compute message buffer size */ int SUNBraidVector_BufSize(braid_App app, braid_Int* size_ptr, - SUNDIALS_MAYBE_UNUSED braid_BufferStatus bstatus) + braid_BufferStatus bstatus) { int flag; /* return flag */ N_Vector ytmpl; /* template vector */ @@ -205,9 +202,8 @@ int SUNBraidVector_BufSize(braid_App app, braid_Int* size_ptr, } /* Pack message buffer */ -int SUNBraidVector_BufPack(SUNDIALS_MAYBE_UNUSED braid_App app, braid_Vector u, - void* buffer, - SUNDIALS_MAYBE_UNUSED braid_BufferStatus bstatus) +int SUNBraidVector_BufPack(braid_App app, braid_Vector u, void* buffer, + braid_BufferStatus bstatus) { int flag; /* return flag */ @@ -224,7 +220,7 @@ int SUNBraidVector_BufPack(SUNDIALS_MAYBE_UNUSED braid_App app, braid_Vector u, /* Unpack message buffer */ int SUNBraidVector_BufUnpack(braid_App app, void* buffer, braid_Vector* u_ptr, - SUNDIALS_MAYBE_UNUSED braid_BufferStatus bstatus) + braid_BufferStatus bstatus) { int flag; /* return flag */ N_Vector ytmpl; /* template vector */ diff --git a/src/sunlinsol/band/CMakeLists.txt b/src/sunlinsol/band/CMakeLists.txt index 0b2035e0ef..6eb7fb51f2 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunlinsol/band/fmod_int64/CMakeLists.txt b/src/sunlinsol/band/fmod/CMakeLists.txt similarity index 100% rename from src/sunlinsol/band/fmod_int64/CMakeLists.txt rename to src/sunlinsol/band/fmod/CMakeLists.txt diff --git a/src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.c b/src/sunlinsol/band/fmod/fsunlinsol_band_mod.c similarity index 100% rename from src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.c rename to src/sunlinsol/band/fmod/fsunlinsol_band_mod.c diff --git a/src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.f90 b/src/sunlinsol/band/fmod/fsunlinsol_band_mod.f90 similarity index 100% rename from src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.f90 rename to src/sunlinsol/band/fmod/fsunlinsol_band_mod.f90 diff --git a/src/sunlinsol/band/fmod_int32/CMakeLists.txt b/src/sunlinsol/band/fmod_int32/CMakeLists.txt deleted file mode 100644 index 8b6e38724e..0000000000 --- a/src/sunlinsol/band/fmod_int32/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# ---------------------------------------------------------------------- -# 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_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_int32/fsunlinsol_band_mod.c b/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.c deleted file mode 100644 index 0b46475231..0000000000 --- a/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.c +++ /dev/null @@ -1,337 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 782fdffb60..0000000000 --- a/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.f90 +++ /dev/null @@ -1,271 +0,0 @@ -! 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/sunlinsol_band.c b/src/sunlinsol/band/sunlinsol_band.c index d72e37af1c..775466bd28 100644 --- a/src/sunlinsol/band/sunlinsol_band.c +++ b/src/sunlinsol/band/sunlinsol_band.c @@ -17,14 +17,11 @@ #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) @@ -49,8 +46,7 @@ * Function to create a new band linear solver */ -SUNLinearSolver SUNLinSol_Band(SUNDIALS_MAYBE_UNUSED N_Vector y, SUNMatrix A, - SUNContext sunctx) +SUNLinearSolver SUNLinSol_Band(N_Vector y, SUNMatrix A, SUNContext sunctx) { SUNFunctionBegin(sunctx); SUNLinearSolver S; @@ -111,12 +107,12 @@ SUNLinearSolver SUNLinSol_Band(SUNDIALS_MAYBE_UNUSED N_Vector y, SUNMatrix A, * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_Band(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_Band(SUNLinearSolver S) { return (SUNLINEARSOLVER_DIRECT); } -SUNLinearSolver_ID SUNLinSolGetID_Band(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_Band(SUNLinearSolver S) { return (SUNLINEARSOLVER_BAND); } @@ -160,7 +156,7 @@ int SUNLinSolSetup_Band(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_Band(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, - SUNDIALS_MAYBE_UNUSED sunrealtype tol) + sunrealtype tol) { SUNFunctionBegin(S->sunctx); sunrealtype **A_cols, *xdata; diff --git a/src/sunlinsol/dense/CMakeLists.txt b/src/sunlinsol/dense/CMakeLists.txt index 1661deca42..8edb6de95d 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunlinsol/dense/fmod_int64/CMakeLists.txt b/src/sunlinsol/dense/fmod/CMakeLists.txt similarity index 100% rename from src/sunlinsol/dense/fmod_int64/CMakeLists.txt rename to src/sunlinsol/dense/fmod/CMakeLists.txt diff --git a/src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.c b/src/sunlinsol/dense/fmod/fsunlinsol_dense_mod.c similarity index 100% rename from src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.c rename to src/sunlinsol/dense/fmod/fsunlinsol_dense_mod.c diff --git a/src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.f90 b/src/sunlinsol/dense/fmod/fsunlinsol_dense_mod.f90 similarity index 100% rename from src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.f90 rename to src/sunlinsol/dense/fmod/fsunlinsol_dense_mod.f90 diff --git a/src/sunlinsol/dense/fmod_int32/CMakeLists.txt b/src/sunlinsol/dense/fmod_int32/CMakeLists.txt deleted file mode 100644 index 3a1329e120..0000000000 --- a/src/sunlinsol/dense/fmod_int32/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ -# ---------------------------------------------------------------------- -# 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_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_int32/fsunlinsol_dense_mod.c b/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.c deleted file mode 100644 index 417d14d673..0000000000 --- a/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.c +++ /dev/null @@ -1,337 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 6ec001b1ed..0000000000 --- a/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.f90 +++ /dev/null @@ -1,271 +0,0 @@ -! 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/sunlinsol_dense.c b/src/sunlinsol/dense/sunlinsol_dense.c index 41e6a1bb61..13a1fa9dbd 100644 --- a/src/sunlinsol/dense/sunlinsol_dense.c +++ b/src/sunlinsol/dense/sunlinsol_dense.c @@ -17,14 +17,12 @@ #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) @@ -48,8 +46,7 @@ * Function to create a new dense linear solver */ -SUNLinearSolver SUNLinSol_Dense(SUNDIALS_MAYBE_UNUSED N_Vector y, SUNMatrix A, - SUNContext sunctx) +SUNLinearSolver SUNLinSol_Dense(N_Vector y, SUNMatrix A, SUNContext sunctx) { SUNFunctionBegin(sunctx); SUNLinearSolver S; @@ -105,12 +102,12 @@ SUNLinearSolver SUNLinSol_Dense(SUNDIALS_MAYBE_UNUSED N_Vector y, SUNMatrix A, * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_Dense(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_Dense(SUNLinearSolver S) { return (SUNLINEARSOLVER_DIRECT); } -SUNLinearSolver_ID SUNLinSolGetID_Dense(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_Dense(SUNLinearSolver S) { return (SUNLINEARSOLVER_DENSE); } @@ -149,7 +146,7 @@ int SUNLinSolSetup_Dense(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_Dense(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, - SUNDIALS_MAYBE_UNUSED sunrealtype tol) + sunrealtype tol) { SUNFunctionBegin(S->sunctx); sunrealtype **A_cols, *xdata; diff --git a/src/sunlinsol/klu/CMakeLists.txt b/src/sunlinsol/klu/CMakeLists.txt index c78a547deb..5be94d2e36 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunlinsol/klu/fmod_int32/CMakeLists.txt b/src/sunlinsol/klu/fmod/CMakeLists.txt similarity index 100% rename from src/sunlinsol/klu/fmod_int32/CMakeLists.txt rename to src/sunlinsol/klu/fmod/CMakeLists.txt diff --git a/src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.c b/src/sunlinsol/klu/fmod/fsunlinsol_klu_mod.c similarity index 100% rename from src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.c rename to src/sunlinsol/klu/fmod/fsunlinsol_klu_mod.c diff --git a/src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.f90 b/src/sunlinsol/klu/fmod/fsunlinsol_klu_mod.f90 similarity index 100% rename from src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.f90 rename to src/sunlinsol/klu/fmod/fsunlinsol_klu_mod.f90 diff --git a/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.c b/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.c deleted file mode 100644 index 0d9434fe92..0000000000 --- a/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.c +++ /dev/null @@ -1,429 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index fa942b3a09..0000000000 --- a/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.f90 +++ /dev/null @@ -1,420 +0,0 @@ -! 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 deleted file mode 100644 index 683f76cc3b..0000000000 --- a/src/sunlinsol/klu/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# --------------------------------------------------------------- -# 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_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/klu/sunlinsol_klu.c b/src/sunlinsol/klu/sunlinsol_klu.c index b2a1f290e2..cbdaa54135 100644 --- a/src/sunlinsol/klu/sunlinsol_klu.c +++ b/src/sunlinsol/klu/sunlinsol_klu.c @@ -16,15 +16,12 @@ * the SUNLINSOL package. * -----------------------------------------------------------------*/ -#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_macros.h" +#include "sundials/sundials_errors.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -45,6 +42,18 @@ #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 long int +#else +#define KLU_INDEXTYPE int +#endif + /* * ----------------------------------------------------------------- * exported functions @@ -218,12 +227,12 @@ sun_klu_common* SUNLinSol_KLUGetCommon(SUNLinearSolver S) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_KLU(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_KLU(SUNLinearSolver S) { return (SUNLINEARSOLVER_DIRECT); } -SUNLinearSolver_ID SUNLinSolGetID_KLU(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_KLU(SUNLinearSolver S) { return (SUNLINEARSOLVER_KLU); } @@ -256,9 +265,10 @@ 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), - SUNSparseMatrix_IndexPointers(A), - SUNSparseMatrix_IndexValues(A), &COMMON(S)); + SYMBOLIC(S) = + sun_klu_analyze(SUNSparseMatrix_NP(A), + (KLU_INDEXTYPE*)SUNSparseMatrix_IndexPointers(A), + (KLU_INDEXTYPE*)SUNSparseMatrix_IndexValues(A), &COMMON(S)); if (SYMBOLIC(S) == NULL) { LASTFLAG(S) = SUN_ERR_EXT_FAIL; @@ -269,8 +279,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(SUNSparseMatrix_IndexPointers(A), - SUNSparseMatrix_IndexValues(A), + NUMERIC(S) = sun_klu_factor((KLU_INDEXTYPE*)SUNSparseMatrix_IndexPointers(A), + (KLU_INDEXTYPE*)SUNSparseMatrix_IndexValues(A), SUNSparseMatrix_Data(A), SYMBOLIC(S), &COMMON(S)); if (NUMERIC(S) == NULL) { @@ -283,8 +293,8 @@ int SUNLinSolSetup_KLU(SUNLinearSolver S, SUNMatrix A) else { /* not the first decomposition, so just refactor */ - retval = sun_klu_refactor(SUNSparseMatrix_IndexPointers(A), - SUNSparseMatrix_IndexValues(A), + retval = sun_klu_refactor((KLU_INDEXTYPE*)SUNSparseMatrix_IndexPointers(A), + (KLU_INDEXTYPE*)SUNSparseMatrix_IndexValues(A), SUNSparseMatrix_Data(A), SYMBOLIC(S), NUMERIC(S), &COMMON(S)); if (retval == 0) @@ -310,7 +320,7 @@ int SUNLinSolSetup_KLU(SUNLinearSolver S, SUNMatrix A) { /* Condition number may be getting large. Compute more accurate estimate */ - retval = sun_klu_condest(SUNSparseMatrix_IndexPointers(A), + retval = sun_klu_condest((KLU_INDEXTYPE*)SUNSparseMatrix_IndexPointers(A), SUNSparseMatrix_Data(A), SYMBOLIC(S), NUMERIC(S), &COMMON(S)); if (retval == 0) @@ -322,12 +332,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(SUNSparseMatrix_IndexPointers(A), - SUNSparseMatrix_IndexValues(A), - SUNSparseMatrix_Data(A), SYMBOLIC(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)); if (NUMERIC(S) == NULL) { LASTFLAG(S) = SUN_ERR_EXT_FAIL; @@ -342,7 +352,7 @@ int SUNLinSolSetup_KLU(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_KLU(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, - SUNDIALS_MAYBE_UNUSED sunrealtype tol) + sunrealtype tol) { int flag; sunrealtype* xdata; @@ -379,8 +389,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(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S, - long int* lenrwLS, long int* leniwLS) +SUNErrCode SUNLinSolSpace_KLU(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 ce26bb6951..cce85657d5 100644 --- a/src/sunlinsol/lapackband/sunlinsol_lapackband.c +++ b/src/sunlinsol/lapackband/sunlinsol_lapackband.c @@ -18,12 +18,10 @@ #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) @@ -129,13 +127,12 @@ SUNLinearSolver SUNLinSol_LapackBand(N_Vector y, SUNMatrix A, SUNContext sunctx) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_LapackBand( - SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_LapackBand(SUNLinearSolver S) { return (SUNLINEARSOLVER_DIRECT); } -SUNLinearSolver_ID SUNLinSolGetID_LapackBand(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_LapackBand(SUNLinearSolver S) { return (SUNLINEARSOLVER_LAPACKBAND); } @@ -176,7 +173,7 @@ int SUNLinSolSetup_LapackBand(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_LapackBand(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, SUNDIALS_MAYBE_UNUSED sunrealtype tol) + N_Vector b, sunrealtype tol) { sunindextype n, ml, mu, ldim, one, ier; sunrealtype* xdata; diff --git a/src/sunlinsol/lapackdense/CMakeLists.txt b/src/sunlinsol/lapackdense/CMakeLists.txt index 41ab2a5fa7..7e0eb9239c 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunlinsol/lapackdense/fmod_int64/CMakeLists.txt b/src/sunlinsol/lapackdense/fmod/CMakeLists.txt similarity index 100% rename from src/sunlinsol/lapackdense/fmod_int64/CMakeLists.txt rename to src/sunlinsol/lapackdense/fmod/CMakeLists.txt diff --git a/src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.c b/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.c similarity index 100% rename from src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.c rename to src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.c diff --git a/src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.f90 b/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.f90 similarity index 100% rename from src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.f90 rename to src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.f90 diff --git a/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt b/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt deleted file mode 100644 index 72b9d5acda..0000000000 --- a/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# ---------------------------------------------------------------------- -# 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_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_int32/fsunlinsol_lapackdense_mod.c b/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.c deleted file mode 100644 index 00f91c82e9..0000000000 --- a/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.c +++ /dev/null @@ -1,337 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 7d555e8985..0000000000 --- a/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.f90 +++ /dev/null @@ -1,271 +0,0 @@ -! 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/sunlinsol_lapackdense.c b/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c index a13460b035..09a17910cc 100644 --- a/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c +++ b/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c @@ -18,12 +18,10 @@ #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) @@ -130,13 +128,12 @@ SUNLinearSolver SUNLinSol_LapackDense(N_Vector y, SUNMatrix A, SUNContext sunctx * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_LapackDense( - SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_LapackDense(SUNLinearSolver S) { return (SUNLINEARSOLVER_DIRECT); } -SUNLinearSolver_ID SUNLinSolGetID_LapackDense(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_LapackDense(SUNLinearSolver S) { return (SUNLINEARSOLVER_LAPACKDENSE); } @@ -173,7 +170,7 @@ int SUNLinSolSetup_LapackDense(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_LapackDense(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, SUNDIALS_MAYBE_UNUSED sunrealtype tol) + N_Vector b, sunrealtype tol) { sunindextype n, one, ier; sunrealtype* xdata; diff --git a/src/sunlinsol/pcg/CMakeLists.txt b/src/sunlinsol/pcg/CMakeLists.txt index e8e37003f2..ea21ecee47 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunlinsol/pcg/fmod_int64/CMakeLists.txt b/src/sunlinsol/pcg/fmod/CMakeLists.txt similarity index 100% rename from src/sunlinsol/pcg/fmod_int64/CMakeLists.txt rename to src/sunlinsol/pcg/fmod/CMakeLists.txt diff --git a/src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.c b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c similarity index 100% rename from src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.c rename to src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c diff --git a/src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.f90 b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 similarity index 100% rename from src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.f90 rename to src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 diff --git a/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt b/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt deleted file mode 100644 index e863f286ee..0000000000 --- a/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# --------------------------------------------------------------- -# 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 - 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_int32/fsunlinsol_pcg_mod.c b/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.c deleted file mode 100644 index 7653513146..0000000000 --- a/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.c +++ /dev/null @@ -1,467 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index e22ce1124b..0000000000 --- a/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.f90 +++ /dev/null @@ -1,514 +0,0 @@ -! 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/sunlinsol_pcg.c b/src/sunlinsol/pcg/sunlinsol_pcg.c index 100183e82c..1504a744dc 100644 --- a/src/sunlinsol/pcg/sunlinsol_pcg.c +++ b/src/sunlinsol/pcg/sunlinsol_pcg.c @@ -18,13 +18,11 @@ #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) @@ -164,12 +162,12 @@ SUNErrCode SUNLinSol_PCGSetMaxl(SUNLinearSolver S, int maxl) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_PCG(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_PCG(SUNLinearSolver S) { return (SUNLINEARSOLVER_ITERATIVE); } -SUNLinearSolver_ID SUNLinSolGetID_PCG(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_PCG(SUNLinearSolver S) { return (SUNLINEARSOLVER_PCG); } @@ -218,7 +216,7 @@ SUNErrCode SUNLinSolSetPreconditioner_PCG(SUNLinearSolver S, void* PData, } SUNErrCode SUNLinSolSetScalingVectors_PCG(SUNLinearSolver S, N_Vector s, - SUNDIALS_MAYBE_UNUSED N_Vector nul) + N_Vector nul) { /* set N_Vector pointer to integrator-supplied scaling vector (only use the first one), and return with success */ @@ -233,7 +231,7 @@ SUNErrCode SUNLinSolSetZeroGuess_PCG(SUNLinearSolver S, sunbooleantype onoff) return SUN_SUCCESS; } -int SUNLinSolSetup_PCG(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix nul) +int SUNLinSolSetup_PCG(SUNLinearSolver S, SUNMatrix nul) { SUNFunctionBegin(S->sunctx); @@ -262,8 +260,8 @@ int SUNLinSolSetup_PCG(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix nul) return SUN_SUCCESS; } -int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix nul, - N_Vector x, N_Vector b, sunrealtype delta) +int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNMatrix nul, N_Vector x, N_Vector b, + sunrealtype delta) { SUNFunctionBegin(S->sunctx); diff --git a/src/sunlinsol/spbcgs/CMakeLists.txt b/src/sunlinsol/spbcgs/CMakeLists.txt index 331c788606..6fc0243c0f 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunlinsol/spbcgs/fmod_int64/CMakeLists.txt b/src/sunlinsol/spbcgs/fmod/CMakeLists.txt similarity index 100% rename from src/sunlinsol/spbcgs/fmod_int64/CMakeLists.txt rename to src/sunlinsol/spbcgs/fmod/CMakeLists.txt diff --git a/src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.c b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c similarity index 100% rename from src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.c rename to src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c diff --git a/src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.f90 b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 similarity index 100% rename from src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.f90 rename to src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 diff --git a/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt b/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt deleted file mode 100644 index d05fdd7d0c..0000000000 --- a/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# --------------------------------------------------------------- -# 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 - 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_int32/fsunlinsol_spbcgs_mod.c b/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.c deleted file mode 100644 index 1ffbd482cc..0000000000 --- a/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.c +++ /dev/null @@ -1,467 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 3c84f21c55..0000000000 --- a/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.f90 +++ /dev/null @@ -1,514 +0,0 @@ -! 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/sunlinsol_spbcgs.c b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c index 67df9bcdfe..168e554176 100644 --- a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c +++ b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c @@ -19,14 +19,12 @@ #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) @@ -188,12 +186,12 @@ SUNErrCode SUNLinSol_SPBCGSSetMaxl(SUNLinearSolver S, int maxl) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_SPBCGS(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_SPBCGS(SUNLinearSolver S) { return (SUNLINEARSOLVER_ITERATIVE); } -SUNLinearSolver_ID SUNLinSolGetID_SPBCGS(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_SPBCGS(SUNLinearSolver S) { return (SUNLINEARSOLVER_SPBCGS); } @@ -267,7 +265,7 @@ SUNErrCode SUNLinSolSetZeroGuess_SPBCGS(SUNLinearSolver S, sunbooleantype onoff) return SUN_SUCCESS; } -int SUNLinSolSetup_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A) +int SUNLinSolSetup_SPBCGS(SUNLinearSolver S, SUNMatrix A) { SUNFunctionBegin(S->sunctx); @@ -296,8 +294,8 @@ int SUNLinSolSetup_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A) return (LASTFLAG(S)); } -int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, - N_Vector x, N_Vector b, sunrealtype delta) +int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNMatrix A, N_Vector x, + N_Vector b, sunrealtype delta) { SUNFunctionBegin(S->sunctx); diff --git a/src/sunlinsol/spfgmr/CMakeLists.txt b/src/sunlinsol/spfgmr/CMakeLists.txt index 38b9d784e9..455415b224 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunlinsol/spfgmr/fmod_int32/CMakeLists.txt b/src/sunlinsol/spfgmr/fmod/CMakeLists.txt similarity index 100% rename from src/sunlinsol/spfgmr/fmod_int32/CMakeLists.txt rename to src/sunlinsol/spfgmr/fmod/CMakeLists.txt diff --git a/src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.c b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c similarity index 100% rename from src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.c rename to src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c diff --git a/src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.f90 b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 similarity index 100% rename from src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.f90 rename to src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 diff --git a/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.c b/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.c deleted file mode 100644 index a83cedc83c..0000000000 --- a/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.c +++ /dev/null @@ -1,481 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index d7167721e2..0000000000 --- a/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.f90 +++ /dev/null @@ -1,541 +0,0 @@ -! 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 deleted file mode 100644 index 4a236368f8..0000000000 --- a/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# ------------------------------------------------------------------------ -# 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 - OUTPUT_NAME - sundials_fsunlinsolspfgmr_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) - -message(STATUS "Added SUNLINSOL_SPFGMR F2003 interface") diff --git a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c index a1d3ea27ad..4e726e2d7e 100644 --- a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c +++ b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c @@ -19,13 +19,11 @@ #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) @@ -192,12 +190,12 @@ SUNErrCode SUNLinSol_SPFGMRSetMaxRestarts(SUNLinearSolver S, int maxrs) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_SPFGMR(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_SPFGMR(SUNLinearSolver S) { return (SUNLINEARSOLVER_ITERATIVE); } -SUNLinearSolver_ID SUNLinSolGetID_SPFGMR(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_SPFGMR(SUNLinearSolver S) { return (SUNLINEARSOLVER_SPFGMR); } @@ -332,7 +330,7 @@ SUNErrCode SUNLinSolSetZeroGuess_SPFGMR(SUNLinearSolver S, sunbooleantype onoff) return SUN_SUCCESS; } -int SUNLinSolSetup_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A) +int SUNLinSolSetup_SPFGMR(SUNLinearSolver S, SUNMatrix A) { SUNFunctionBegin(S->sunctx); @@ -361,8 +359,8 @@ int SUNLinSolSetup_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A) return SUN_SUCCESS; } -int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, - N_Vector x, N_Vector b, sunrealtype delta) +int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, + N_Vector b, sunrealtype delta) { SUNFunctionBegin(S->sunctx); diff --git a/src/sunlinsol/spgmr/CMakeLists.txt b/src/sunlinsol/spgmr/CMakeLists.txt index 712f07731a..62c7100e86 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunlinsol/spgmr/fmod_int32/CMakeLists.txt b/src/sunlinsol/spgmr/fmod/CMakeLists.txt similarity index 100% rename from src/sunlinsol/spgmr/fmod_int32/CMakeLists.txt rename to src/sunlinsol/spgmr/fmod/CMakeLists.txt diff --git a/src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.c b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c similarity index 100% rename from src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.c rename to src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c diff --git a/src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.f90 b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 similarity index 100% rename from src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.f90 rename to src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 diff --git a/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.c b/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.c deleted file mode 100644 index c25c8f07ee..0000000000 --- a/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.c +++ /dev/null @@ -1,481 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 142c9328a7..0000000000 --- a/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 +++ /dev/null @@ -1,541 +0,0 @@ -! 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 deleted file mode 100644 index 005f891f6c..0000000000 --- a/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# ------------------------------------------------------------------------ -# 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 - OUTPUT_NAME - sundials_fsunlinsolspgmr_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) - -message(STATUS "Added SUNLINSOL_SPGMR F2003 interface") diff --git a/src/sunlinsol/spgmr/sunlinsol_spgmr.c b/src/sunlinsol/spgmr/sunlinsol_spgmr.c index 6ef57661ae..c1e10b3629 100644 --- a/src/sunlinsol/spgmr/sunlinsol_spgmr.c +++ b/src/sunlinsol/spgmr/sunlinsol_spgmr.c @@ -19,13 +19,11 @@ #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) @@ -187,12 +185,12 @@ SUNErrCode SUNLinSol_SPGMRSetMaxRestarts(SUNLinearSolver S, int maxrs) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_SPGMR(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_SPGMR(SUNLinearSolver S) { return (SUNLINEARSOLVER_ITERATIVE); } -SUNLinearSolver_ID SUNLinSolGetID_SPGMR(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_SPGMR(SUNLinearSolver S) { return (SUNLINEARSOLVER_SPGMR); } @@ -319,7 +317,7 @@ SUNErrCode SUNLinSolSetZeroGuess_SPGMR(SUNLinearSolver S, sunbooleantype onff) return SUN_SUCCESS; } -int SUNLinSolSetup_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A) +int SUNLinSolSetup_SPGMR(SUNLinearSolver S, SUNMatrix A) { SUNFunctionBegin(S->sunctx); @@ -346,8 +344,8 @@ int SUNLinSolSetup_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A) return SUN_SUCCESS; } -int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, - N_Vector x, N_Vector b, sunrealtype delta) +int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, + sunrealtype delta) { SUNFunctionBegin(S->sunctx); diff --git a/src/sunlinsol/sptfqmr/CMakeLists.txt b/src/sunlinsol/sptfqmr/CMakeLists.txt index 60bb70ef1f..d4d069077c 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunlinsol/sptfqmr/fmod_int32/CMakeLists.txt b/src/sunlinsol/sptfqmr/fmod/CMakeLists.txt similarity index 100% rename from src/sunlinsol/sptfqmr/fmod_int32/CMakeLists.txt rename to src/sunlinsol/sptfqmr/fmod/CMakeLists.txt diff --git a/src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.c b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c similarity index 100% rename from src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.c rename to src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c diff --git a/src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.f90 b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 similarity index 100% rename from src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.f90 rename to src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 diff --git a/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.c b/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.c deleted file mode 100644 index eecf61a1ce..0000000000 --- a/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.c +++ /dev/null @@ -1,467 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 105984e2f7..0000000000 --- a/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.f90 +++ /dev/null @@ -1,514 +0,0 @@ -! 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 deleted file mode 100644 index 2aa92f9022..0000000000 --- a/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# ------------------------------------------------------------------------ -# 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 - OUTPUT_NAME - sundials_fsunlinsolsptfqmr_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) - -message(STATUS "Added SUNLINSOL_SPTFQMR F2003 interface") diff --git a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c index 28ad1ef883..6f09ccc1db 100644 --- a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c +++ b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c @@ -18,13 +18,11 @@ #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) @@ -186,12 +184,12 @@ SUNErrCode SUNLinSol_SPTFQMRSetMaxl(SUNLinearSolver S, int maxl) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_SPTFQMR(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_SPTFQMR(SUNLinearSolver S) { return (SUNLINEARSOLVER_ITERATIVE); } -SUNLinearSolver_ID SUNLinSolGetID_SPTFQMR(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_SPTFQMR(SUNLinearSolver S) { return (SUNLINEARSOLVER_SPTFQMR); } @@ -262,7 +260,7 @@ SUNErrCode SUNLinSolSetZeroGuess_SPTFQMR(SUNLinearSolver S, sunbooleantype onoff return SUN_SUCCESS; } -int SUNLinSolSetup_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A) +int SUNLinSolSetup_SPTFQMR(SUNLinearSolver S, SUNMatrix A) { SUNFunctionBegin(S->sunctx); @@ -291,8 +289,8 @@ int SUNLinSolSetup_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A) return SUN_SUCCESS; } -int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, - N_Vector x, N_Vector b, sunrealtype delta) +int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, 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 8b58d1d22b..55df80aeba 100644 --- a/src/sunlinsol/superludist/sunlinsol_superludist.c +++ b/src/sunlinsol/superludist/sunlinsol_superludist.c @@ -17,14 +17,10 @@ #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 "sundials_macros.h" +#include <superlu_ddefs.h> #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -170,13 +166,12 @@ SuperLUStat_t* SUNLinSol_SuperLUDIST_GetSuperLUStat(SUNLinearSolver LS) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_SuperLUDIST( - SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_SuperLUDIST(SUNLinearSolver S) { return (SUNLINEARSOLVER_DIRECT); } -SUNLinearSolver_ID SUNLinSolGetID_SuperLUDIST(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_SuperLUDIST(SUNLinearSolver S) { return (SUNLINEARSOLVER_SUPERLUDIST); } @@ -189,8 +184,7 @@ SUNErrCode SUNLinSolInitialize_SuperLUDIST(SUNLinearSolver S) return (SLU_LASTFLAG(S)); } -int SUNLinSolSetup_SuperLUDIST(SUNLinearSolver S, - SUNDIALS_MAYBE_UNUSED SUNMatrix A) +int SUNLinSolSetup_SuperLUDIST(SUNLinearSolver S, SUNMatrix A) { if (SLU_FIRSTFACTORIZE(S)) { @@ -216,7 +210,7 @@ int SUNLinSolSetup_SuperLUDIST(SUNLinearSolver S, } int SUNLinSolSolve_SuperLUDIST(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, SUNDIALS_MAYBE_UNUSED sunrealtype tol) + N_Vector b, sunrealtype tol) { int retval; sunrealtype* xdata; @@ -302,8 +296,8 @@ SUNErrCode SUNLinSolFree_SuperLUDIST(SUNLinearSolver S) return SUN_SUCCESS; } -SUNErrCode SUNLinSolSpace_SuperLUDIST(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S, - long int* leniwLS, long int* lenrwLS) +SUNErrCode SUNLinSolSpace_SuperLUDIST(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 439a948fed..609243d5a3 100644 --- a/src/sunlinsol/superlumt/sunlinsol_superlumt.c +++ b/src/sunlinsol/superlumt/sunlinsol_superlumt.c @@ -20,12 +20,10 @@ #include <stdio.h> #include <stdlib.h> - -#include <sundials/sundials_errors.h> #include <sundials/sundials_math.h> #include <sunlinsol/sunlinsol_superlumt.h> -#include "sundials_macros.h" +#include "sundials/sundials_errors.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -231,13 +229,12 @@ SUNErrCode SUNLinSol_SuperLUMTSetOrdering(SUNLinearSolver S, int ordering_choice * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_SuperLUMT( - SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_SuperLUMT(SUNLinearSolver S) { return SUNLINEARSOLVER_DIRECT; } -SUNLinearSolver_ID SUNLinSolGetID_SuperLUMT(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_SuperLUMT(SUNLinearSolver S) { return SUNLINEARSOLVER_SUPERLUMT; } @@ -322,7 +319,7 @@ int SUNLinSolSetup_SuperLUMT(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_SuperLUMT(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, SUNDIALS_MAYBE_UNUSED sunrealtype tol) + N_Vector b, sunrealtype tol) { int_t retval; sunrealtype* xdata; diff --git a/src/sunmatrix/band/CMakeLists.txt b/src/sunmatrix/band/CMakeLists.txt index 240fcf7ed4..faafb96173 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunmatrix/band/fmod_int64/CMakeLists.txt b/src/sunmatrix/band/fmod/CMakeLists.txt similarity index 100% rename from src/sunmatrix/band/fmod_int64/CMakeLists.txt rename to src/sunmatrix/band/fmod/CMakeLists.txt diff --git a/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.c b/src/sunmatrix/band/fmod/fsunmatrix_band_mod.c similarity index 99% rename from src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.c rename to src/sunmatrix/band/fmod/fsunmatrix_band_mod.c index 0a5bac84c8..dda3324003 100644 --- a/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.c +++ b/src/sunmatrix/band/fmod/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_int64/fsunmatrix_band_mod.f90 b/src/sunmatrix/band/fmod/fsunmatrix_band_mod.f90 similarity index 97% rename from src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.f90 rename to src/sunmatrix/band/fmod/fsunmatrix_band_mod.f90 index f9b8189f10..4ebf3a229e 100644 --- a/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.f90 +++ b/src/sunmatrix/band/fmod/fsunmatrix_band_mod.f90 @@ -238,11 +238,7 @@ 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 @@ -557,8 +553,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) @@ -570,23 +566,15 @@ 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 -#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 +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT64_T) :: farg2 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/band/fmod_int32/CMakeLists.txt b/src/sunmatrix/band/fmod_int32/CMakeLists.txt deleted file mode 100644 index 6026568af8..0000000000 --- a/src/sunmatrix/band/fmod_int32/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# --------------------------------------------------------------- -# 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 - 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_int32/fsunmatrix_band_mod.c b/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.c deleted file mode 100644 index d506997738..0000000000 --- a/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.c +++ /dev/null @@ -1,500 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 82f10ff03b..0000000000 --- a/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.f90 +++ /dev/null @@ -1,595 +0,0 @@ -! 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/sunmatrix_band.c b/src/sunmatrix/band/sunmatrix_band.c index f3d06c730b..238450443e 100644 --- a/src/sunmatrix/band/sunmatrix_band.c +++ b/src/sunmatrix/band/sunmatrix_band.c @@ -22,13 +22,11 @@ #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_macros.h" +#include "sundials/sundials_errors.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -232,10 +230,7 @@ sunrealtype* SUNBandMatrix_Column(SUNMatrix A, sunindextype j) * ----------------------------------------------------------------- */ -SUNMatrix_ID SUNMatGetID_Band(SUNDIALS_MAYBE_UNUSED SUNMatrix A) -{ - return SUNMATRIX_BAND; -} +SUNMatrix_ID SUNMatGetID_Band(SUNMatrix A) { return SUNMATRIX_BAND; } SUNMatrix SUNMatClone_Band(SUNMatrix A) { @@ -433,7 +428,6 @@ 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 @@ -443,7 +437,6 @@ 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/CMakeLists.txt b/src/sunmatrix/dense/CMakeLists.txt index e9e1b9ad85..8563a8ced3 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunmatrix/dense/fmod_int32/CMakeLists.txt b/src/sunmatrix/dense/fmod/CMakeLists.txt similarity index 100% rename from src/sunmatrix/dense/fmod_int32/CMakeLists.txt rename to src/sunmatrix/dense/fmod/CMakeLists.txt diff --git a/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.c b/src/sunmatrix/dense/fmod/fsunmatrix_dense_mod.c similarity index 99% rename from src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.c rename to src/sunmatrix/dense/fmod/fsunmatrix_dense_mod.c index 140e8d8d61..8709e95887 100644 --- a/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.c +++ b/src/sunmatrix/dense/fmod/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_int64/fsunmatrix_dense_mod.f90 b/src/sunmatrix/dense/fmod/fsunmatrix_dense_mod.f90 similarity index 97% rename from src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.f90 rename to src/sunmatrix/dense/fmod/fsunmatrix_dense_mod.f90 index 7bfb049939..3f1b68e2bd 100644 --- a/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.f90 +++ b/src/sunmatrix/dense/fmod/fsunmatrix_dense_mod.f90 @@ -188,11 +188,7 @@ 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 @@ -427,8 +423,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) @@ -440,18 +436,10 @@ 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 -#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 +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT64_T) :: farg2 farg1 = c_loc(a) farg2 = j diff --git a/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c b/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c deleted file mode 100644 index 7f6d3a1a4d..0000000000 --- a/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c +++ /dev/null @@ -1,430 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 23c12b6eba..0000000000 --- a/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.f90 +++ /dev/null @@ -1,463 +0,0 @@ -! 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 deleted file mode 100644 index 6b11defa31..0000000000 --- a/src/sunmatrix/dense/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# --------------------------------------------------------------- -# 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 - OUTPUT_NAME - sundials_fsunmatrixdense_mod - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) - -message(STATUS "Added SUNMATRIX_DENSE F2003 interface") diff --git a/src/sunmatrix/dense/sunmatrix_dense.c b/src/sunmatrix/dense/sunmatrix_dense.c index c1250a9eaa..5067379fd5 100644 --- a/src/sunmatrix/dense/sunmatrix_dense.c +++ b/src/sunmatrix/dense/sunmatrix_dense.c @@ -20,12 +20,10 @@ #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_macros.h" +#include "sundials/sundials_errors.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -180,10 +178,7 @@ sunrealtype* SUNDenseMatrix_Column(SUNMatrix A, sunindextype j) * ----------------------------------------------------------------- */ -SUNMatrix_ID SUNMatGetID_Dense(SUNDIALS_MAYBE_UNUSED SUNMatrix A) -{ - return SUNMATRIX_DENSE; -} +SUNMatrix_ID SUNMatGetID_Dense(SUNMatrix A) { return SUNMATRIX_DENSE; } SUNMatrix SUNMatClone_Dense(SUNMatrix A) { @@ -351,7 +346,6 @@ 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 */ @@ -363,7 +357,6 @@ 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 5c84fc3b76..a17ab753d9 100644 --- a/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c +++ b/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c @@ -20,14 +20,10 @@ #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 "sundials_macros.h" +#include <superlu_ddefs.h> /* * ---------------------------------------------------------------------------- @@ -175,10 +171,7 @@ sunbooleantype SUNMatrix_SLUNRloc_OwnData(SUNMatrix A) * ---------------------------------------------------------------------------- */ -SUNMatrix_ID SUNMatGetID_SLUNRloc(SUNDIALS_MAYBE_UNUSED SUNMatrix A) -{ - return (SUNMATRIX_SLUNRLOC); -} +SUNMatrix_ID SUNMatGetID_SLUNRloc(SUNMatrix A) { return (SUNMATRIX_SLUNRLOC); } SUNMatrix SUNMatClone_SLUNRloc(SUNMatrix A) { diff --git a/src/sunmatrix/sparse/CMakeLists.txt b/src/sunmatrix/sparse/CMakeLists.txt index 3ca9363150..120a8cbef3 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunmatrix/sparse/fmod_int64/CMakeLists.txt b/src/sunmatrix/sparse/fmod/CMakeLists.txt similarity index 100% rename from src/sunmatrix/sparse/fmod_int64/CMakeLists.txt rename to src/sunmatrix/sparse/fmod/CMakeLists.txt diff --git a/src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.c b/src/sunmatrix/sparse/fmod/fsunmatrix_sparse_mod.c similarity index 95% rename from src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.c rename to src/sunmatrix/sparse/fmod/fsunmatrix_sparse_mod.c index 3f97241d5f..b49bdc9945 100644 --- a/src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.c +++ b/src/sunmatrix/sparse/fmod/fsunmatrix_sparse_mod.c @@ -509,41 +509,18 @@ 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; @@ -554,12 +531,11 @@ 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_int64/fsunmatrix_sparse_mod.f90 b/src/sunmatrix/sparse/fmod/fsunmatrix_sparse_mod.f90 similarity index 98% rename from src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.f90 rename to src/sunmatrix/sparse/fmod/fsunmatrix_sparse_mod.f90 index eedd562db3..f128403e93 100644 --- a/src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.f90 +++ b/src/sunmatrix/sparse/fmod/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,14 +635,10 @@ 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) @@ -652,19 +648,15 @@ 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/sunmatrix/sparse/fmod_int32/CMakeLists.txt b/src/sunmatrix/sparse/fmod_int32/CMakeLists.txt deleted file mode 100644 index 407bddff70..0000000000 --- a/src/sunmatrix/sparse/fmod_int32/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# --------------------------------------------------------------- -# 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 - 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_int32/fsunmatrix_sparse_mod.c b/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.c deleted file mode 100644 index c329b1edde..0000000000 --- a/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.c +++ /dev/null @@ -1,565 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index fa9ff1555a..0000000000 --- a/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.f90 +++ /dev/null @@ -1,670 +0,0 @@ -! 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/sunmatrix_sparse.c b/src/sunmatrix/sparse/sunmatrix_sparse.c index bbdbc344d2..96754afbd6 100644 --- a/src/sunmatrix/sparse/sunmatrix_sparse.c +++ b/src/sunmatrix/sparse/sunmatrix_sparse.c @@ -22,15 +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 <sunmatrix/sunmatrix_dense.h> #include <sunmatrix/sunmatrix_sparse.h> -#include "sundials_macros.h" +#include "sundials/sundials_errors.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -499,10 +497,7 @@ sunindextype* SUNSparseMatrix_IndexPointers(SUNMatrix A) * ----------------------------------------------------------------- */ -SUNMatrix_ID SUNMatGetID_Sparse(SUNDIALS_MAYBE_UNUSED SUNMatrix A) -{ - return SUNMATRIX_SPARSE; -} +SUNMatrix_ID SUNMatGetID_Sparse(SUNMatrix A) { return SUNMATRIX_SPARSE; } SUNMatrix SUNMatClone_Sparse(SUNMatrix A) { @@ -1125,7 +1120,6 @@ 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 */ @@ -1144,7 +1138,6 @@ 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) { @@ -1194,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] = ZERO; } + for (i = 0; i < SM_ROWS_S(A); i++) { yd[i] = 0.0; } /* iterate through matrix columns */ for (j = 0; j < SM_COLUMNS_S(A); j++) @@ -1237,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] = ZERO; } + for (i = 0; i < SM_ROWS_S(A); i++) { yd[i] = 0.0; } /* iterate through matrix rows */ for (i = 0; i < SM_ROWS_S(A); i++) @@ -1305,7 +1298,7 @@ SUNErrCode format_convert(const SUNMatrix A, SUNMatrix B) sunindextype jj; for (jj = Ap[row]; jj < Ap[row + 1]; jj++) { - col = Aj[jj]; + sunindextype col = Aj[jj]; sunindextype dest = Bp[col]; Bi[dest] = row; diff --git a/src/sunmemory/system/sundials_system_memory.c b/src/sunmemory/system/sundials_system_memory.c index 8b34d7f137..00839c6d59 100644 --- a/src/sunmemory/system/sundials_system_memory.c +++ b/src/sunmemory/system/sundials_system_memory.c @@ -17,15 +17,13 @@ #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_ { @@ -72,7 +70,7 @@ SUNMemoryHelper SUNMemoryHelper_Sys(SUNContext sunctx) SUNErrCode SUNMemoryHelper_Alloc_Sys(SUNMemoryHelper helper, SUNMemory* memptr, size_t mem_size, SUNMemoryType mem_type, - SUNDIALS_MAYBE_UNUSED void* queue) + void* queue) { SUNFunctionBegin(helper->sunctx); @@ -102,7 +100,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sys(SUNMemoryHelper helper, SUNMemory* memptr, } SUNErrCode SUNMemoryHelper_Dealloc_Sys(SUNMemoryHelper helper, SUNMemory mem, - SUNDIALS_MAYBE_UNUSED void* queue) + void* queue) { SUNFunctionBegin(helper->sunctx); @@ -127,7 +125,7 @@ SUNErrCode SUNMemoryHelper_Dealloc_Sys(SUNMemoryHelper helper, SUNMemory mem, SUNErrCode SUNMemoryHelper_Copy_Sys(SUNMemoryHelper helper, SUNMemory dst, SUNMemory src, size_t memory_size, - SUNDIALS_MAYBE_UNUSED void* queue) + void* queue) { SUNFunctionBegin(helper->sunctx); SUNAssert(src->type == SUNMEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); @@ -136,10 +134,12 @@ SUNErrCode SUNMemoryHelper_Copy_Sys(SUNMemoryHelper helper, SUNMemory dst, return SUN_SUCCESS; } -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) +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) { SUNFunctionBegin(helper->sunctx); SUNAssert(mem_type == SUNMEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); diff --git a/src/sunnonlinsol/fixedpoint/CMakeLists.txt b/src/sunnonlinsol/fixedpoint/CMakeLists.txt index 257fe8f97b..2fcb289310 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunnonlinsol/fixedpoint/fmod_int32/CMakeLists.txt b/src/sunnonlinsol/fixedpoint/fmod/CMakeLists.txt similarity index 100% rename from src/sunnonlinsol/fixedpoint/fmod_int32/CMakeLists.txt rename to src/sunnonlinsol/fixedpoint/fmod/CMakeLists.txt diff --git a/src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.c b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c similarity index 100% rename from src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.c rename to src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c diff --git a/src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.f90 b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 similarity index 100% rename from src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.f90 rename to src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 diff --git a/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt b/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt deleted file mode 100644 index 6e24d5269c..0000000000 --- a/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -# --------------------------------------------------------------- -# 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 - 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 deleted file mode 100644 index 3911f51201..0000000000 --- a/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.c +++ /dev/null @@ -1,419 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 763e069388..0000000000 --- a/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.f90 +++ /dev/null @@ -1,425 +0,0 @@ -! 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/fixedpoint/sunnonlinsol_fixedpoint.c b/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c index ff1d45a2c9..1ec228965e 100644 --- a/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c +++ b/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c @@ -18,13 +18,11 @@ #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, @@ -131,8 +129,7 @@ SUNNonlinearSolver SUNNonlinSol_FixedPointSens(int count, N_Vector y, int m, GetType, Initialize, Setup, Solve, and Free operations ============================================================================*/ -SUNNonlinearSolver_Type SUNNonlinSolGetType_FixedPoint( - SUNDIALS_MAYBE_UNUSED SUNNonlinearSolver NLS) +SUNNonlinearSolver_Type SUNNonlinSolGetType_FixedPoint(SUNNonlinearSolver NLS) { return (SUNNONLINEARSOLVER_FIXEDPOINT); } @@ -168,11 +165,9 @@ SUNErrCode SUNNonlinSolInitialize_FixedPoint(SUNNonlinearSolver NLS) by the Sys function provided to the nonlinear solver. ---------------------------------------------------------------------------*/ -int SUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver NLS, - SUNDIALS_MAYBE_UNUSED N_Vector y0, +int SUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, N_Vector w, sunrealtype tol, - SUNDIALS_MAYBE_UNUSED sunbooleantype callSetup, - void* mem) + sunbooleantype callSetup, void* mem) { SUNFunctionBegin(NLS->sunctx); /* local variables */ diff --git a/src/sunnonlinsol/newton/CMakeLists.txt b/src/sunnonlinsol/newton/CMakeLists.txt index 718b026d3f..141b978996 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_int${SUNDIALS_INDEX_SIZE}") + add_subdirectory(fmod) endif() diff --git a/src/sunnonlinsol/newton/fmod_int64/CMakeLists.txt b/src/sunnonlinsol/newton/fmod/CMakeLists.txt similarity index 100% rename from src/sunnonlinsol/newton/fmod_int64/CMakeLists.txt rename to src/sunnonlinsol/newton/fmod/CMakeLists.txt diff --git a/src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.c b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c similarity index 100% rename from src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.c rename to src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c diff --git a/src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.f90 b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 similarity index 100% rename from src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.f90 rename to src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 diff --git a/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt b/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt deleted file mode 100644 index 883fac35ed..0000000000 --- a/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -# --------------------------------------------------------------- -# 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 - 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 deleted file mode 100644 index a7df613d41..0000000000 --- a/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.c +++ /dev/null @@ -1,429 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 deleted file mode 100644 index 53a4bb2bd3..0000000000 --- a/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.f90 +++ /dev/null @@ -1,443 +0,0 @@ -! 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/src/sunnonlinsol/newton/sunnonlinsol_newton.c b/src/sunnonlinsol/newton/sunnonlinsol_newton.c index c4c0af932a..c796171ad3 100644 --- a/src/sunnonlinsol/newton/sunnonlinsol_newton.c +++ b/src/sunnonlinsol/newton/sunnonlinsol_newton.c @@ -18,14 +18,12 @@ #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)) @@ -128,8 +126,7 @@ SUNNonlinearSolver SUNNonlinSol_NewtonSens(int count, N_Vector y, GetType, Initialize, Setup, Solve, and Free operations ============================================================================*/ -SUNNonlinearSolver_Type SUNNonlinSolGetType_Newton( - SUNDIALS_MAYBE_UNUSED SUNNonlinearSolver NLS) +SUNNonlinearSolver_Type SUNNonlinSolGetType_Newton(SUNNonlinearSolver NLS) { return (SUNNONLINEARSOLVER_ROOTFIND); } @@ -173,8 +170,7 @@ 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, - SUNDIALS_MAYBE_UNUSED N_Vector y0, N_Vector ycor, +int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, N_Vector w, sunrealtype tol, sunbooleantype callLSetup, void* mem) { @@ -207,20 +203,6 @@ 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; } @@ -233,6 +215,16 @@ 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 (;;) { @@ -256,24 +248,16 @@ 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, __func__, - "end-iterate", "iter = %ld, nni = %ld, wrmsnorm = %.16g", + SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, + "SUNNonlinSolSolve_Newton", "end-of-iterate", + "iter = %ld, nni = %ld, wrmsnorm = %.16g", NEWTON_CONTENT(NLS)->curiter, - NEWTON_CONTENT(NLS)->niters - 1, N_VWrmsNorm(delta, w)); + NEWTON_CONTENT(NLS)->niters, 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; } @@ -281,20 +265,14 @@ int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, /* check if the iteration should continue; otherwise exit Newton loop */ if (retval != SUN_NLS_CONTINUE) { break; } - /* not yet converged, test for max allowed iterations. */ + /* not yet converged. Increment curiter and test for max allowed. */ + NEWTON_CONTENT(NLS)->curiter++; 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; } @@ -303,13 +281,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 diff --git a/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c b/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c index e932c386ef..7001c35257 100644 --- a/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c +++ b/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c @@ -15,18 +15,15 @@ * 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_macros.h" +#include "sundials/sundials_errors.h" #define SUNNLS_SNES_CONTENT(NLS) \ ((SUNNonlinearSolverContent_PetscSNES)(NLS->content)) @@ -131,8 +128,7 @@ SUNNonlinearSolver SUNNonlinSol_PetscSNES(N_Vector y, SNES snes, SUNContext sunc ============================================================================*/ /* get the type of SUNNonlinearSolver */ -SUNNonlinearSolver_Type SUNNonlinSolGetType_PetscSNES( - SUNDIALS_MAYBE_UNUSED SUNNonlinearSolver NLS) +SUNNonlinearSolver_Type SUNNonlinSolGetType_PetscSNES(SUNNonlinearSolver NLS) { return (SUNNONLINEARSOLVER_ROOTFIND); } @@ -172,9 +168,8 @@ 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, SUNDIALS_MAYBE_UNUSED sunrealtype tol, - SUNDIALS_MAYBE_UNUSED sunbooleantype callLSetup, - void* mem) + N_Vector w, sunrealtype tol, + sunbooleantype callLSetup, void* mem) { /* local variables */ PetscErrorCode ierr; @@ -375,8 +370,7 @@ SUNErrCode SUNNonlinSolGetNumConvFails_PetscSNES(SUNNonlinearSolver NLS, Private functions ============================================================================*/ -static PetscErrorCode PetscSysFn(SUNDIALS_MAYBE_UNUSED SNES snes, Vec x, Vec f, - void* ctx) +static PetscErrorCode PetscSysFn(SNES snes, Vec x, Vec f, void* ctx) { int retval; SUNNonlinearSolver NLS = (SUNNonlinearSolver)ctx; diff --git a/swig/Makefile b/swig/Makefile index eb772623e9..7264855297 100644 --- a/swig/Makefile +++ b/swig/Makefile @@ -14,15 +14,13 @@ # 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 IDA=fida_mod IDAS=fidas_mod KINSOL=fkinsol_mod -CORE=fsundials_core_mod +GENERIC=fsundials_core_mod NVECTOR=openmp pthreads serial parallel manyvector mpiplusx SUNMATRIX=band dense sparse SUNLINSOL=band dense lapackdense klu spbcgs spfgmr spgmr sptfqmr pcg @@ -31,97 +29,90 @@ SUNADAPTCONTROLLER=imexgus soderlind INCLUDES=-I../include -.PHONY: .SETINT64 .SETINT32 all all32 all64 modules core arkode cvode cvodes ida idas kinsol nvector mpimanyvector sunmatrix sunlinsol sunnonlinsol sunadaptcontroller clean - -.SETINT32: - $(eval INT_SIZE=32) - -.SETINT64: - $(eval INT_SIZE=64) - -all: all32 all64 - -all32: .SETINT32 modules - -all64: .SETINT64 modules +.PHONY: generic arkode cvode cvodes ida idas kinsol nvector sunmatrix sunlinsol sunnonlinsol sunadaptcontroller patch -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 +all: generic arkode cvode cvodes ida idas kinsol nvector sunmatrix sunlinsol sunnonlinsol sunadaptcontroller patch 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; \ + 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 ; \ 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; \ + 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 ; \ 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; \ + 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 ; \ 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; \ + 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 ; \ 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; \ + 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 ; \ 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; \ + 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 ; \ 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; \ + 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 ; \ 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; + @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 ; \ 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; \ + 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 ; \ 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; \ + 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 ; \ 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; \ + 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 ; \ 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; \ + echo "swig -fortran -outdir ../src/sunadaptcontroller/$${i}/fmod -o ../src/sunadaptcontroller/$${i}/fmod ${INCLUDES} sunadaptcontroller/fsunadaptcontroller_$${i}_mod.i" ; \ + swig -fortran -outdir ../src/sunadaptcontroller/$${i}/fmod -o ../src/sunadaptcontroller/$${i}/fmod/fsunadaptcontroller_$${i}_mod.c ${INCLUDES} sunadaptcontroller/fsunadaptcontroller_$${i}_mod.i ; \ done +patch: .FORCE + cd ..; + clean: - rm ../src/**/fmod*/*.c; rm ../src/**/fmod*/*.f90 + rm ../src/**/fmod/*.c; rm ../src/**/fmod/*.f90 + +.FORCE: ; diff --git a/swig/README.md b/swig/README.md index ae3b174264..ab12b54893 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 all32 all64` from the `sundials/swig` directory. -**This will replace all the generated files in `sundials/src`.** +`make` from the `sunrepo/swig` directory. **This will replace all the +generated files in `sunrepo/src`.** ## Creating a new interface diff --git a/swig/nvector/fnvector_manyvector_mod.i b/swig/nvector/fnvector_manyvector_mod.i index 417197d0ef..9bc07378a4 100644 --- a/swig/nvector/fnvector_manyvector_mod.i +++ b/swig/nvector/fnvector_manyvector_mod.i @@ -55,11 +55,7 @@ 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 %} @@ -70,18 +66,10 @@ 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 71dbe86b05..83bb770d27 100644 --- a/swig/nvector/fnvector_mpimanyvector_mod.i +++ b/swig/nvector/fnvector_mpimanyvector_mod.i @@ -55,11 +55,7 @@ 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 %} @@ -70,18 +66,10 @@ 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 7ea007a29c..7f4f6f8b67 100644 --- a/swig/sundials/fsundials.i +++ b/swig/sundials/fsundials.i @@ -53,11 +53,8 @@ // Assume sunrealtype* is an array of doubles %apply double[] { sunrealtype* }; -#ifdef GENERATE_INT32 -%apply int[] { sunindextype* }; -#else -%apply long long[] { sunindextype* }; -#endif +// Assume sunindextype* is an array of long int +%apply long int[] { sunindextype* }; // 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 0f61838b50..5877bf99bb 100644 --- a/swig/sundials/fsundials_types.i +++ b/swig/sundials/fsundials_types.i @@ -15,20 +15,11 @@ // Swig interface file // --------------------------------------------------------------- -// By default, wrap all constants as native fortran PARAMETERs -%fortranconst; - %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 @@ -82,18 +73,27 @@ #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 // (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), parameter, public :: SUN_COMM_NULL = 0_C_INT + integer(C_INT), protected, public, & + bind(C, name="_wrap_SUN_COMM_NULL") :: SUN_COMM_NULL #endif %} diff --git a/swig/sunmatrix/fsunmatrix_band_mod.i b/swig/sunmatrix/fsunmatrix_band_mod.i index 11e468608a..bc23b646fb 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,11 +78,7 @@ 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 %} @@ -93,8 +89,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) @@ -106,23 +102,15 @@ 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 +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT64_T) :: farg2 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 572922617c..d2f72e31b4 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,11 +78,7 @@ 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 %} @@ -93,8 +89,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) @@ -106,18 +102,10 @@ 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 +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT64_T) :: farg2 farg1 = c_loc(a) farg2 = j diff --git a/swig/sunmatrix/fsunmatrix_sparse_mod.i b/swig/sunmatrix/fsunmatrix_sparse_mod.i index 36ff430367..40b3d811eb 100644 --- a/swig/sunmatrix/fsunmatrix_sparse_mod.i +++ b/swig/sunmatrix/fsunmatrix_sparse_mod.i @@ -40,41 +40,18 @@ 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; @@ -85,13 +62,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 %} %insert("fdecl") %{ @@ -133,8 +109,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) @@ -144,14 +120,10 @@ 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) @@ -161,17 +133,13 @@ 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 dd4aebcaa5..1ab057ec30 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit dd4aebcaa5a886746fa281c528d452fdae825cd2 +Subproject commit 1ab057ec30477fd531d4cc16c6b9bb0cd55ebd45 diff --git a/test/env/default.sh b/test/env/default.sh index 4f72c3f7f5..fb6ed34802 100644 --- a/test/env/default.sh +++ b/test/env/default.sh @@ -139,6 +139,15 @@ 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" + else COMPILER_ROOT="$(spack location -i "llvm@$compilerversion")" @@ -181,7 +190,7 @@ export SUNDIALS_KINSOL=ON # Fortran interface status if [ "$compilername" == "gcc" ]; then - if [[ ("$SUNDIALS_PRECISION" == "double") ]]; then + if [[ ("$SUNDIALS_PRECISION" == "double") && ("$SUNDIALS_INDEX_SIZE" == "64") ]]; 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 361d91646c..2ab9b50410 100644 --- a/test/env/docker.sh +++ b/test/env/docker.sh @@ -109,8 +109,12 @@ if [ "$compilername" == "gcc" ]; then export CUDAFLAGS="-g -O3" fi - # additional Fortran flags not currently added by ENABLE_ALL_WARNINGS - export FFLAGS="${FFLAGS} -fcheck=all,no-pointer,no-recursion" + # 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 + fi # ------------------------------------------------------------------------------ @@ -134,7 +138,7 @@ export SUNDIALS_KINSOL=ON # Fortran interface status if [ "$compilername" == "gcc" ]; then - if [[ ("$SUNDIALS_PRECISION" == "double") ]]; then + if [[ ("$SUNDIALS_PRECISION" == "double") && ("$SUNDIALS_INDEX_SIZE" == "64") ]]; then export SUNDIALS_FMOD_INTERFACE=ON else export SUNDIALS_FMOD_INTERFACE=OFF @@ -174,6 +178,9 @@ 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/env/lassen.sh b/test/env/lassen.sh index 473b7f1522..59d26d3b7f 100644 --- a/test/env/lassen.sh +++ b/test/env/lassen.sh @@ -105,7 +105,7 @@ else fi # Fortran settings -if [[ ("$SUNDIALS_PRECISION" == "double") ]]; then +if [[ ("$SUNDIALS_PRECISION" == "double") && ("$indexsize" == "64") ]]; 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 e70ea2b512..fdafcd3318 100644 --- a/test/env/quartz.sh +++ b/test/env/quartz.sh @@ -105,7 +105,7 @@ else fi # Fortran settings -if [[ ("$SUNDIALS_PRECISION" == "double") ]]; then +if [[ ("$SUNDIALS_PRECISION" == "double") && ("$indexsize" == "64") ]]; 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 new file mode 100644 index 0000000000..4cfcce6868 --- /dev/null +++ b/test/env/summit.sh @@ -0,0 +1,139 @@ +#!/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 diff --git a/test/unit_tests/CMakeLists.txt b/test/unit_tests/CMakeLists.txt index 29e3a74114..3ca5c3aa28 100644 --- a/test/unit_tests/CMakeLists.txt +++ b/test/unit_tests/CMakeLists.txt @@ -16,12 +16,6 @@ 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) 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..8a60b4801e 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 = 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 = 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 = ARKStepSetTables(arkstep_mem, 2, 0, B, NULL); // Specify Butcher table if (check_flag(&flag, "ARKStepSetTables", 1)) { return 1; } - 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 + 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 if (check_flag(&flag, "MRIStepSetCoupling", 1)) { return 1; } - flag = ARKodeSetMaxNumSteps(mristep_mem, 2 * Nt); // Increase num internal steps - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = MRIStepSetMaxNumSteps(mristep_mem, 2 * Nt); // Increase num internal steps + if (check_flag(&flag, "MRIStepSetMaxNumSteps", 1)) { return 1; } // Linear solver interface - 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; } + 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; } // Optionally specify linearly implicit RHS, with non-time-dependent preconditioner if (linear) { - flag = ARKodeSetLinear(arkstep_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkstep_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } - flag = ARKodeSetLinear(mristep_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = MRIStepSetLinear(mristep_mem, 0); + if (check_flag(&flag, "MRIStepSetLinear", 1)) { return 1; } } - // First call ARKodeEvolve to evolve the full problem, and print results + // First call ARKStep to evolve the full problem, and print results t = T0; N_VConst(ZERO, y); - 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 = 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 = ARKStepGetNumRhsEvals(arkstep_mem, &ark_nfe, &ark_nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 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; } + 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; } if (outproc) { cout << "\nARKStep Solver Statistics:\n"; @@ -356,31 +356,31 @@ int main(int argc, char* argv[]) << ark_ncfn << "\n"; } - // Second call ARKodeEvolve to evolve the full problem, and print results + // Second call MRIStep to evolve the full problem, and print results t = T0; N_VConst(ZERO, y); - 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 = 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 = MRIStepGetNumRhsEvals(mristep_mem, &mri_nfse, &mri_nfsi); if (check_flag(&flag, "MRIStepGetNumRhsEvals", 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; } + 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; } 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 - ARKodeFree(&arkstep_mem); // Free integrator memory - ARKodeFree(&mristep_mem); - ARKodeFree(&inner_mem); + ARKStepFree(&arkstep_mem); // Free integrator memory + MRIStepFree(&mristep_mem); + ARKStepFree(&inner_mem); MRIStepInnerStepper_Free(&inner_stepper); SUNLinSolFree(LSa); // Free linear solver SUNLinSolFree(LSm); diff --git a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt index 0d2bc15460..9eb5952496 100644 --- a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt @@ -18,27 +18,15 @@ 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_ark.cpp\;0 0" + "ark_test_dahlquist_ark.cpp\;1 0" + "ark_test_dahlquist_ark.cpp\;2 0" + "ark_test_dahlquist_ark.cpp\;0 1" + "ark_test_dahlquist_ark.cpp\;1 1" + "ark_test_dahlquist_ark.cpp\;2 1" "ark_test_dahlquist_erk.cpp\;0" "ark_test_dahlquist_erk.cpp\;1" - "ark_test_dahlquist_mri.cpp\;-1" - "ark_test_dahlquist_mri.cpp\;0" - "ark_test_dahlquist_mri.cpp\;1" + "ark_test_dahlquist_mri.cpp\;" "ark_test_butcher.cpp\;" "ark_test_getjac.cpp\;" "ark_test_getjac_mri.cpp\;" diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp index e2cb57a011..1a6cbe642a 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 = 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 = 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 = ARKStepSetTables(arkstep_mem, 2, 0, B, NULL); // Specify Butcher table if (check_flag(&flag, "ARKStepSetTables", 1)) { return 1; } - 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 + 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 if (check_flag(&flag, "MRIStepSetCoupling", 1)) { return 1; } - flag = ARKodeSetMaxNumSteps(mristep_mem, 2 * Nt); // Increase num internal steps - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = MRIStepSetMaxNumSteps(mristep_mem, 2 * Nt); // Increase num internal steps + if (check_flag(&flag, "MRIStepSetMaxNumSteps", 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 = ARKodeSetNonlinearSolver(arkstep_mem, NLSa); - if (check_flag(&flag, "ARKodeSetNonlinearSolver", 1)) { return 1; } + flag = ARKStepSetNonlinearSolver(arkstep_mem, NLSa); + if (check_flag(&flag, "ARKStepSetNonlinearSolver", 1)) { return 1; } NLSm = SUNNonlinSol_FixedPoint(y, 50, sunctx); if (check_flag((void*)NLSm, "SUNNonlinSol_FixedPoint", 0)) { return 1; } - flag = ARKodeSetNonlinearSolver(mristep_mem, NLSm); - if (check_flag(&flag, "ARKodeSetNonlinearSolver", 1)) { return 1; } + flag = MRIStepSetNonlinearSolver(mristep_mem, NLSm); + if (check_flag(&flag, "MRIStepSetNonlinearSolver", 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 = 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 = 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(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; } + 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; } // Specify linearly implicit RHS, with non-time-dependent Jacobian - flag = ARKodeSetLinear(arkstep_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkstep_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } - flag = ARKodeSetLinear(mristep_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = MRIStepSetLinear(mristep_mem, 0); + if (check_flag(&flag, "MRIStepSetLinear", 1)) { return 1; } } - // First call ARKodeEvolve to evolve the full problem, and print results + // First call ARKStep to evolve the full problem, and print results t = T0; N_VConst(ONE, y); - 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 = 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 = ARKStepGetNumRhsEvals(arkstep_mem, &ark_nfe, &ark_nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 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 = 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; } if (!fixedpoint) { - 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); + 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); } 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 ARKodeEvolve to evolve the full problem, and print results + // Second call MRIStep to evolve the full problem, and print results t = T0; N_VConst(ZERO, y); - 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 = 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 = MRIStepGetNumRhsEvals(mristep_mem, &mri_nfse, &mri_nfsi); if (check_flag(&flag, "MRIStepGetNumRhsEvals", 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 = 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; } if (!fixedpoint) { - 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); + 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); } 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 - ARKodeFree(&arkstep_mem); // Free integrator memory - ARKodeFree(&mristep_mem); - ARKodeFree(&inner_mem); + ARKStepFree(&arkstep_mem); // Free integrator memory + MRIStepFree(&mristep_mem); + ARKStepFree(&inner_mem); MRIStepInnerStepper_Free(&inner_stepper); if (fixedpoint) { 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 a8013ad472..c789fec715 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_butcher.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_butcher.cpp @@ -21,45 +21,76 @@ #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() { - 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; + // 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; // loop over individual ERK tables std::cout << "\nTesting individual ERK methods:\n\n"; - for (int i = ARKODE_MIN_ERK_NUM; i <= ARKODE_MAX_ERK_NUM; i++) + for (std::string table : Tables_ERK) { - ARKODE_ERKTableID id = static_cast<ARKODE_ERKTableID>(i); - std::cout << "Testing method " << ARKodeButcherTable_ERKIDToName(id) << ":"; + std::cout << "Testing method " << table << ":"; // load Butcher table - ARKodeButcherTable B = ARKodeButcherTable_LoadERK(id); + ARKodeButcherTable B = ARKodeButcherTable_LoadERKByName(table.c_str()); if (B == NULL) { std::cout << " error retrieving table, aborting\n"; @@ -92,13 +123,12 @@ int main() // loop over individual DIRK tables std::cout << "\nTesting individual DIRK methods:\n\n"; - for (int i = ARKODE_MIN_DIRK_NUM; i <= ARKODE_MAX_DIRK_NUM; i++) + for (std::string table : Tables_DIRK) { - ARKODE_DIRKTableID id = static_cast<ARKODE_DIRKTableID>(i); - std::cout << "Testing method " << ARKodeButcherTable_DIRKIDToName(id) << ":"; + std::cout << "Testing method " << table << ":"; // load Butcher table - ARKodeButcherTable B = ARKodeButcherTable_LoadDIRK(id); + ARKodeButcherTable B = ARKodeButcherTable_LoadDIRKByName(table.c_str()); if (B == NULL) { std::cout << " error retrieving table, aborting\n"; @@ -131,19 +161,18 @@ int main() // loop over ARK pairs std::cout << "\nTesting ARK pairs:\n\n"; - for (ARK_Table& ark_table : ark_tables) + for (size_t i = 0; i < Tables_ARK_ERK.size(); i++) { - std::cout << "Testing method " << ark_table.name << ":"; + std::cout << "Testing method " << STables_ARK[i] << ":"; // load Butcher tables - ARKodeButcherTable Be = ARKodeButcherTable_LoadERKByName(ark_table.erk_table); + ARKodeButcherTable Be = ARKodeButcherTable_LoadERK(Tables_ARK_ERK[i]); if (Be == NULL) { std::cout << " error retrieving explicit table, aborting\n"; return 1; } - ARKodeButcherTable Bi = - ARKodeButcherTable_LoadDIRKByName(ark_table.dirk_table); + ARKodeButcherTable Bi = ARKodeButcherTable_LoadDIRK(Tables_ARK_DIRK[i]); 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 559c92b3ae..b7c11bcecf 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_butcher.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_butcher.out @@ -2,6 +2,7 @@ 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 @@ -19,10 +20,8 @@ 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 @@ -47,13 +46,11 @@ 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 @@ -76,10 +73,6 @@ 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: 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..d08ddf3a30 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,7 +30,6 @@ #include <sunlinsol/sunlinsol_dense.h> #include <sunmatrix/sunmatrix_dense.h> -#include "arkode/arkode.h" #include "arkode/arkode_butcher.h" #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -66,7 +65,6 @@ enum class rk_type enum class interp_type { - none = -1, hermite, lagrange }; @@ -95,9 +93,8 @@ struct ProblemOptions sunrealtype h = SUN_RCONST(0.01); // Interpolant type - // -1 = None - // 0 = Hermite - // 1 = Lagrange + // 0 = Hermite + // 1 = Lagrange interp_type i_type = interp_type::hermite; // Predictor type @@ -169,20 +166,8 @@ int main(int argc, char* argv[]) if (argc > 2) { - 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 (std::stoi(argv[2]) == 1) { prob_opts.i_type = interp_type::lagrange; } + else { prob_opts.i_type = interp_type::hermite; } } if (argc > 3) @@ -216,11 +201,7 @@ int main(int argc, char* argv[]) { 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"; } + else { std::cout << " interp type = Lagrange\n"; } if (prob_opts.p_type == 0) { std::cout << " pred type = Trivial (0)\n"; } else { std::cout << " pred type = Max order (1)\n"; } @@ -244,6 +225,30 @@ 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)); @@ -252,9 +257,7 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "get_method_properties", 1)) { return 1; } std::cout << "\n========================" << std::endl; - std::cout << "ERK: " - << ARKodeButcherTable_ERKIDToName(static_cast<ARKODE_ERKTableID>(i)) - << std::endl; + std::cout << "ERK Table ID " << i << std::endl; std::cout << " stages: " << stages << std::endl; std::cout << " order: " << order << std::endl; std::cout << " explicit 1st stage: " << explicit_first_stage << std::endl; @@ -276,6 +279,30 @@ 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)); @@ -284,10 +311,7 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "get_method_properties", 1)) { return 1; } std::cout << "\n========================" << std::endl; - std::cout << "DIRK: " - << ARKodeButcherTable_DIRKIDToName( - static_cast<ARKODE_DIRKTableID>(i)) - << std::endl; + std::cout << "DIRK Table ID " << i << std::endl; std::cout << " stages: " << stages << std::endl; std::cout << " order: " << order << std::endl; std::cout << " explicit 1st stage: " << explicit_first_stage << std::endl; @@ -365,8 +389,7 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "get_method_properties", 1)) { return 1; } std::cout << "\n========================" << std::endl; - std::cout << "DIRK: " << ark_methods_dirk[i] << std::endl; - std::cout << "ERK: " << ark_methods_erk[i] << std::endl; + std::cout << "IMEX Table ID " << i << std::endl; std::cout << " stages: " << stages << std::endl; std::cout << " order: " << order << std::endl; std::cout << " explicit 1st stage: " << explicit_first_stage << std::endl; @@ -445,16 +468,16 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, if (check_flag((void*)arkstep_mem, "ARKStepCreate", 0)) { return 1; } // Set user data - flag = ARKodeSetUserData(arkstep_mem, &prob_data); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(arkstep_mem, &prob_data); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } // Specify tolerances - flag = ARKodeSStolerances(arkstep_mem, prob_opts.reltol, prob_opts.abstol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkstep_mem, prob_opts.reltol, prob_opts.abstol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } // Specify fixed time step size - flag = ARKodeSetFixedStep(arkstep_mem, prob_opts.h); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = ARKStepSetFixedStep(arkstep_mem, prob_opts.h); + if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } // Attach Butcher tables (ignore actual method order) flag = ARKStepSetTables(arkstep_mem, 1, 0, Bi, Be); @@ -463,13 +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 = 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; } + flag = ARKStepSetInterpolantType(arkstep_mem, ARK_INTERP_LAGRANGE); + if (check_flag(&flag, "ARKStepSetInterpolantType", 1)) { return 1; } } // Create matrix and linear solver (if necessary) @@ -486,24 +504,20 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, if (check_flag((void*)LS, "SUNLinSol_Dense", 0)) { return 1; } // Attach linear solver - flag = ARKodeSetLinearSolver(arkstep_mem, LS, A); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(arkstep_mem, LS, A); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } // Set Jacobian function - flag = ARKodeSetJacFn(arkstep_mem, Ji); - if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } + flag = ARKStepSetJacFn(arkstep_mem, Ji); + if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } // Specify linearly implicit RHS, with non-time-dependent Jacobian - 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; } + flag = ARKStepSetLinear(arkstep_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } // Specify implicit predictor method - flag = ARKodeSetPredictorMethod(arkstep_mem, prob_opts.p_type); - if (check_flag(&flag, "ARKodeSetPredictorMethod", 1)) { return 1; } + flag = ARKStepSetPredictorMethod(arkstep_mem, prob_opts.p_type); + if (check_flag(&flag, "ARKStepSetPredictorMethod", 1)) { return 1; } } // Create mass matrix and linear solver (if necessary) @@ -522,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 = ARKodeSetMassLinearSolver(arkstep_mem, MLS, M, time_dep); - if (check_flag(&flag, "ARKodeSetMassLinearSolver", 1)) { return 1; } + flag = ARKStepSetMassLinearSolver(arkstep_mem, MLS, M, time_dep); + if (check_flag(&flag, "ARKStepSetMassLinearSolver", 1)) { return 1; } - flag = ARKodeSetMassFn(arkstep_mem, MassMatrix); - if (check_flag(&flag, "ARKodeSetMassFn", 1)) { return 1; } + flag = ARKStepSetMassFn(arkstep_mem, MassMatrix); + if (check_flag(&flag, "ARKStepSetMassFn", 1)) { return 1; } } // -------------- @@ -543,8 +557,8 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, std::cout << "--------------------" << std::endl; // Advance in time - flag = ARKodeEvolve(arkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); - if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } + flag = ARKStepEvolve(arkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); + if (check_flag(&flag, "ARKStepEvolve", 1)) { return 1; } // Update output time t_out += prob_opts.h; @@ -578,14 +592,11 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, std::cout << "Dense Output" << std::endl; sunrealtype h_last; - flag = ARKodeGetLastStep(arkstep_mem, &h_last); - if (check_flag(&flag, "ARKodeGetLastStep", 1)) { return 1; } + flag = ARKStepGetLastStep(arkstep_mem, &h_last); + if (check_flag(&flag, "ARKStepGetLastStep", 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; } - } + flag = ARKStepGetDky(arkstep_mem, t_ret - h_last / TWO, 0, y); + if (check_flag(&flag, "ARKStepGetDky", 1)) { return 1; } // Stiffly accurate (and FSAL) methods do not require an additional RHS // evaluation to get the new RHS value at the end of a step for dense @@ -641,8 +652,8 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, if (numfails == 0) { // Advance in time - flag = ARKodeEvolve(arkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); - if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } + flag = ARKStepEvolve(arkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); + if (check_flag(&flag, "ARKStepEvolve", 1)) { return 1; } // Update output time t_out += prob_opts.h; @@ -664,7 +675,7 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, // Clean up // -------- - ARKodeFree(&arkstep_mem); + ARKStepFree(&arkstep_mem); SUNLinSolFree(LS); SUNMatDestroy(A); SUNLinSolFree(MLS); @@ -735,47 +746,17 @@ int expected_rhs_evals(ProblemOptions& prob_opts, int stages, int order, // Get number of steps and nonlinear solver iterations long int nst = 0; - flag = ARKodeGetNumSteps(arkstep_mem, &nst); - if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } + flag = ARKStepGetNumSteps(arkstep_mem, &nst); + if (check_flag(&flag, "ARKStepGetNumSteps", 1)) { return 1; } long int nni = 0; 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); - } + flag = ARKStepGetNumNonlinSolvIters(arkstep_mem, &nni); + if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return 1; } } // Expected number of explicit functions evaluations @@ -803,13 +784,6 @@ 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,13 +811,6 @@ 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; @@ -862,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 = ARKodeGetNumSteps(arkstep_mem, &nst); - if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } + flag = ARKStepGetNumSteps(arkstep_mem, &nst); + if (check_flag(&flag, "ARKStepGetNumSteps", 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_ark_2_0_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.out similarity index 76% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0_1.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.out index 23ba95fc26..92d1e73a20 100644 --- 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.out @@ -1,20 +1,54 @@ Dahlquist ODE test problem: - problem type = Time-dependent mass matrix + 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 = Max order (1) ======================== Test explicit RK methods ======================== ======================== -ERK: ARKODE_HEUN_EULER_2_1_2 +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 @@ -49,7 +83,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 +ERK Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -84,7 +118,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK324L2SA_ERK_4_2_3 +ERK Table ID 2 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +153,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ZONNEVELD_5_3_4 +ERK Table ID 3 stages: 5 order: 4 explicit 1st stage: 1 @@ -154,7 +188,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK436L2SA_ERK_6_3_4 +ERK Table ID 4 stages: 6 order: 4 explicit 1st stage: 1 @@ -189,7 +223,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SAYFY_ABURUB_6_3_4 +ERK Table ID 5 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +258,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_CASH_KARP_6_4_5 +ERK Table ID 6 stages: 6 order: 5 explicit 1st stage: 1 @@ -259,7 +293,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FEHLBERG_6_4_5 +ERK Table ID 7 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +328,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_DORMAND_PRINCE_7_4_5 +ERK Table ID 8 stages: 7 order: 5 explicit 1st stage: 1 @@ -329,7 +363,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK548L2SA_ERK_8_4_5 +ERK Table ID 9 stages: 8 order: 5 explicit 1st stage: 1 @@ -364,7 +398,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_8_5_6 +ERK Table ID 10 stages: 8 order: 6 explicit 1st stage: 1 @@ -399,7 +433,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FEHLBERG_13_7_8 +ERK Table ID 11 stages: 13 order: 8 explicit 1st stage: 1 @@ -434,7 +468,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_KNOTH_WOLKE_3_3 +ERK Table ID 12 stages: 3 order: 3 explicit 1st stage: 1 @@ -469,7 +503,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK437L2SA_ERK_7_3_4 +ERK Table ID 13 stages: 7 order: 4 explicit 1st stage: 1 @@ -504,7 +538,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 +ERK Table ID 14 stages: 8 order: 5 explicit 1st stage: 1 @@ -539,7 +573,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK2_ERK_3_1_2 +ERK Table ID 15 stages: 3 order: 2 explicit 1st stage: 1 @@ -574,455 +608,218 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 - stages: 5 - order: 4 - explicit 1st stage: 1 +Test implicit RK methods +======================== + +======================== +Implicit Euler + stages: 1 + order: 1 + explicit 1st stage: 0 stiffly accurate: 1 - first same as last: 1 + first same as last: 0 ======================== -------------------- Steps: 1 -Fe RHS evals: - actual: 5 - expected: 5 +NLS iters: 1 +Fi RHS evals: + actual: 3 + expected: 3 -------------------- Steps: 2 -Fe RHS evals: - actual: 9 - expected: 9 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 -------------------- Steps: 3 -Fe RHS evals: - actual: 13 - expected: 13 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 -------------------- Dense Output -Fe RHS evals: - actual: 13 - expected: 13 +Fi RHS evals: + actual: 7 + expected: 7 -------------------- Steps: 4 -Fe RHS evals: - actual: 17 - expected: 17 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 -------------------- ======================== -ERK: ARKODE_SHU_OSHER_3_2_3 - stages: 3 - order: 3 - explicit 1st stage: 1 +DIRK Table ID 100 + stages: 2 + order: 2 + explicit 1st stage: 0 stiffly accurate: 0 first same as last: 0 ======================== -------------------- Steps: 1 -Fe RHS evals: - actual: 3 - expected: 3 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 -------------------- Steps: 2 -Fe RHS evals: - actual: 6 - expected: 6 +NLS iters: 4 +Fi RHS evals: + actual: 10 + expected: 10 -------------------- Steps: 3 -Fe RHS evals: - actual: 9 - expected: 9 +NLS iters: 6 +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 -Fe RHS evals: - actual: 12 - expected: 12 +NLS iters: 8 +Fi RHS evals: + actual: 20 + expected: 20 -------------------- ======================== -ERK: ARKODE_VERNER_9_5_6 - stages: 9 - order: 6 - explicit 1st stage: 1 - stiffly accurate: 1 - first same as last: 1 +DIRK Table ID 101 + stages: 3 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + first same as last: 0 ======================== -------------------- Steps: 1 -Fe RHS evals: - actual: 9 - expected: 9 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 -------------------- Steps: 2 -Fe RHS evals: - actual: 17 - expected: 17 +NLS iters: 6 +Fi RHS evals: + actual: 14 + expected: 14 -------------------- Steps: 3 -Fe RHS evals: - actual: 25 - expected: 25 +NLS iters: 9 +Fi RHS evals: + actual: 21 + expected: 21 -------------------- Dense Output -Fe RHS evals: - actual: 29 - expected: 29 +Fi RHS evals: + actual: 22 + expected: 22 -------------------- Steps: 4 -Fe RHS evals: - actual: 37 - expected: 37 +NLS iters: 12 +Fi RHS evals: + actual: 28 + expected: 28 -------------------- ======================== -ERK: ARKODE_VERNER_10_6_7 - stages: 10 - order: 7 +DIRK Table ID 102 + stages: 3 + order: 2 explicit 1st stage: 1 - stiffly accurate: 0 - first same as last: 0 + stiffly accurate: 1 + first same as last: 1 ======================== -------------------- Steps: 1 -Fe RHS evals: - actual: 10 - expected: 10 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 -------------------- Steps: 2 -Fe RHS evals: - actual: 20 - expected: 20 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 -------------------- Steps: 3 -Fe RHS evals: - actual: 30 - expected: 30 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 -------------------- Dense Output -Fe RHS evals: - actual: 35 - expected: 35 +Fi RHS evals: + actual: 13 + expected: 13 -------------------- Steps: 4 -Fe RHS evals: - actual: 44 - expected: 44 +NLS iters: 8 +Fi RHS evals: + actual: 17 + expected: 17 -------------------- ======================== -ERK: ARKODE_VERNER_13_7_8 - stages: 13 - order: 8 +DIRK Table ID 103 + stages: 4 + order: 3 explicit 1st stage: 1 - stiffly accurate: 0 - first same as last: 0 + stiffly accurate: 1 + first same as last: 1 ======================== -------------------- Steps: 1 -Fe RHS evals: - actual: 13 - expected: 13 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 -------------------- Steps: 2 -Fe RHS evals: - actual: 26 - expected: 26 +NLS iters: 6 +Fi RHS evals: + actual: 13 + expected: 13 -------------------- Steps: 3 -Fe RHS evals: - actual: 39 - expected: 39 +NLS iters: 9 +Fi RHS evals: + actual: 19 + expected: 19 -------------------- Dense Output -Fe RHS evals: - actual: 44 - expected: 44 +Fi RHS evals: + actual: 19 + expected: 19 -------------------- Steps: 4 -Fe RHS evals: - actual: 56 - expected: 56 +NLS iters: 12 +Fi RHS evals: + actual: 25 + expected: 25 -------------------- ======================== -ERK: ARKODE_VERNER_16_8_9 - stages: 16 - order: 9 +DIRK Table ID 104 + stages: 4 + order: 3 explicit 1st stage: 1 - stiffly accurate: 0 - first same as last: 0 + stiffly accurate: 1 + first same as last: 1 ======================== -------------------- 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 +NLS iters: 3 +Fi RHS evals: + actual: 7 + expected: 7 -------------------- Steps: 2 NLS iters: 6 @@ -1049,46 +846,7 @@ Fi RHS evals: -------------------- ======================== -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 +DIRK Table ID 105 stages: 5 order: 4 explicit 1st stage: 0 @@ -1127,7 +885,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_CASH_5_3_4 +DIRK Table ID 106 stages: 5 order: 4 explicit 1st stage: 0 @@ -1166,7 +924,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_SDIRK_5_3_4 +DIRK Table ID 107 stages: 5 order: 4 explicit 1st stage: 0 @@ -1205,7 +963,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_5_3_4 +DIRK Table ID 108 stages: 5 order: 4 explicit 1st stage: 1 @@ -1244,7 +1002,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +DIRK Table ID 109 stages: 6 order: 4 explicit 1st stage: 1 @@ -1283,7 +1041,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_7_4_5 +DIRK Table ID 110 stages: 7 order: 5 explicit 1st stage: 1 @@ -1300,29 +1058,29 @@ Fi RHS evals: Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 31 - expected: 31 + actual: 25 + expected: 25 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 49 - expected: 49 + actual: 37 + expected: 37 -------------------- Dense Output Fi RHS evals: - actual: 50 - expected: 50 + actual: 38 + expected: 38 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 68 - expected: 68 + actual: 50 + expected: 50 -------------------- ======================== -DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +DIRK Table ID 111 stages: 8 order: 5 explicit 1st stage: 1 @@ -1339,29 +1097,29 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fi RHS evals: - actual: 36 - expected: 36 + actual: 29 + expected: 29 -------------------- Steps: 3 NLS iters: 21 Fi RHS evals: - actual: 57 - expected: 57 + actual: 43 + expected: 43 -------------------- Dense Output Fi RHS evals: - actual: 58 - expected: 58 + actual: 44 + expected: 44 -------------------- Steps: 4 NLS iters: 28 Fi RHS evals: - actual: 79 - expected: 79 + actual: 58 + expected: 58 -------------------- ======================== -DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +DIRK Table ID 112 stages: 7 order: 4 explicit 1st stage: 1 @@ -1400,7 +1158,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +DIRK Table ID 113 stages: 8 order: 5 explicit 1st stage: 1 @@ -1417,29 +1175,29 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fi RHS evals: - actual: 36 - expected: 36 + actual: 29 + expected: 29 -------------------- Steps: 3 NLS iters: 21 Fi RHS evals: - actual: 57 - expected: 57 + actual: 43 + expected: 43 -------------------- Dense Output Fi RHS evals: - actual: 58 - expected: 58 + actual: 44 + expected: 44 -------------------- Steps: 4 NLS iters: 28 Fi RHS evals: - actual: 79 - expected: 79 + actual: 58 + expected: 58 -------------------- ======================== -DIRK: ARKODE_ESDIRK324L2SA_4_2_3 +DIRK Table ID 114 stages: 4 order: 3 explicit 1st stage: 1 @@ -1478,7 +1236,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK325L2SA_5_2_3 +DIRK Table ID 115 stages: 5 order: 3 explicit 1st stage: 1 @@ -1517,7 +1275,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 +DIRK Table ID 116 stages: 5 order: 3 explicit 1st stage: 1 @@ -1556,7 +1314,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK436L2SA_6_3_4 +DIRK Table ID 117 stages: 6 order: 4 explicit 1st stage: 1 @@ -1595,7 +1353,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 +DIRK Table ID 118 stages: 6 order: 4 explicit 1st stage: 1 @@ -1634,7 +1392,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_QESDIRK436L2SA_6_3_4 +DIRK Table ID 119 stages: 6 order: 4 explicit 1st stage: 1 @@ -1673,7 +1431,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK437L2SA_7_3_4 +DIRK Table ID 120 stages: 7 order: 4 explicit 1st stage: 1 @@ -1712,7 +1470,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK547L2SA_7_4_5 +DIRK Table ID 121 stages: 7 order: 5 explicit 1st stage: 1 @@ -1729,29 +1487,29 @@ Fi RHS evals: Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 31 - expected: 31 + actual: 25 + expected: 25 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 49 - expected: 49 + actual: 37 + expected: 37 -------------------- Dense Output Fi RHS evals: - actual: 50 - expected: 50 + actual: 38 + expected: 38 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 68 - expected: 68 + actual: 50 + expected: 50 -------------------- ======================== -DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 +DIRK Table ID 122 stages: 7 order: 5 explicit 1st stage: 1 @@ -1768,181 +1526,64 @@ Fi RHS evals: Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 31 - expected: 31 + actual: 25 + expected: 25 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 49 - expected: 49 + actual: 37 + expected: 37 -------------------- Dense Output Fi RHS evals: - actual: 50 - expected: 50 + actual: 38 + expected: 38 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 68 - expected: 68 + actual: 50 + expected: 50 -------------------- ======================== -DIRK: ARKODE_ARK2_DIRK_3_1_2 +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: 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 + first same as last: 1 +======================== -------------------- -Steps: 2 +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: 3 +NLS iters: 6 Fi RHS evals: - actual: 7 - expected: 7 + actual: 13 + expected: 13 -------------------- Dense Output Fi RHS evals: - actual: 7 - expected: 7 + actual: 13 + expected: 13 -------------------- Steps: 4 -NLS iters: 4 +NLS iters: 8 Fi RHS evals: - actual: 9 - expected: 9 + actual: 17 + expected: 17 -------------------- ===================== @@ -2004,8 +1645,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK2_DIRK_3_1_2 -ERK: ARKODE_ARK2_ERK_3_1_2 +IMEX Table ID 0 stages: 3 order: 2 explicit 1st stage: 1 @@ -2059,278 +1699,273 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 -ERK: ARKODE_ARK324L2SA_ERK_4_2_3 - stages: 4 - order: 3 +IMEX Table ID 1 + stages: 3 + order: 2 explicit 1st stage: 1 stiffly accurate: 0 first same as last: 0 ======================== -------------------- Steps: 1 -NLS iters: 3 +NLS iters: 2 Fe RHS evals: - actual: 4 - expected: 4 + actual: 3 + expected: 3 Fi RHS evals: - actual: 7 - expected: 7 + actual: 5 + expected: 5 -------------------- Steps: 2 -NLS iters: 6 +NLS iters: 4 Fe RHS evals: - actual: 8 - expected: 8 + actual: 6 + expected: 6 Fi RHS evals: - actual: 14 - expected: 14 + actual: 10 + expected: 10 -------------------- Steps: 3 -NLS iters: 9 +NLS iters: 6 Fe RHS evals: - actual: 12 - expected: 12 + actual: 9 + expected: 9 Fi RHS evals: - actual: 21 - expected: 21 + actual: 15 + expected: 15 -------------------- Dense Output Fe RHS evals: - actual: 13 - expected: 13 + actual: 10 + expected: 10 Fi RHS evals: - actual: 22 - expected: 22 + actual: 16 + expected: 16 -------------------- Steps: 4 -NLS iters: 12 +NLS iters: 8 Fe RHS evals: - actual: 16 - expected: 16 + actual: 12 + expected: 12 Fi RHS evals: - actual: 28 - expected: 28 + actual: 20 + expected: 20 -------------------- ======================== -DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 -ERK: ARKODE_ARK436L2SA_ERK_6_3_4 - stages: 6 - order: 4 +IMEX Table ID 2 + stages: 3 + order: 2 explicit 1st stage: 1 stiffly accurate: 0 first same as last: 0 ======================== -------------------- Steps: 1 -NLS iters: 5 +NLS iters: 2 Fe RHS evals: - actual: 6 - expected: 6 + actual: 3 + expected: 3 Fi RHS evals: - actual: 11 - expected: 11 + actual: 5 + expected: 5 -------------------- Steps: 2 -NLS iters: 10 +NLS iters: 4 Fe RHS evals: - actual: 12 - expected: 12 + actual: 6 + expected: 6 Fi RHS evals: - actual: 22 - expected: 22 + actual: 10 + expected: 10 -------------------- Steps: 3 -NLS iters: 15 +NLS iters: 6 Fe RHS evals: - actual: 18 - expected: 18 + actual: 9 + expected: 9 Fi RHS evals: - actual: 33 - expected: 33 + actual: 15 + expected: 15 -------------------- Dense Output Fe RHS evals: - actual: 19 - expected: 19 + actual: 10 + expected: 10 Fi RHS evals: - actual: 34 - expected: 34 + actual: 16 + expected: 16 -------------------- Steps: 4 -NLS iters: 20 +NLS iters: 8 Fe RHS evals: - actual: 24 - expected: 24 + actual: 12 + expected: 12 Fi RHS evals: - actual: 44 - expected: 44 + actual: 20 + expected: 20 -------------------- ======================== -DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 -ERK: ARKODE_ARK437L2SA_ERK_7_3_4 - stages: 7 - order: 4 +IMEX Table ID 3 + stages: 3 + order: 2 explicit 1st stage: 1 stiffly accurate: 0 first same as last: 0 ======================== -------------------- Steps: 1 -NLS iters: 6 +NLS iters: 2 Fe RHS evals: - actual: 7 - expected: 7 + actual: 3 + expected: 3 Fi RHS evals: - actual: 13 - expected: 13 + actual: 5 + expected: 5 -------------------- Steps: 2 -NLS iters: 12 +NLS iters: 4 Fe RHS evals: - actual: 14 - expected: 14 + actual: 6 + expected: 6 Fi RHS evals: - actual: 26 - expected: 26 + actual: 10 + expected: 10 -------------------- Steps: 3 -NLS iters: 18 +NLS iters: 6 Fe RHS evals: - actual: 21 - expected: 21 + actual: 9 + expected: 9 Fi RHS evals: - actual: 39 - expected: 39 + actual: 15 + expected: 15 -------------------- Dense Output Fe RHS evals: - actual: 22 - expected: 22 + actual: 10 + expected: 10 Fi RHS evals: - actual: 40 - expected: 40 + actual: 16 + expected: 16 -------------------- Steps: 4 -NLS iters: 24 +NLS iters: 8 Fe RHS evals: - actual: 28 - expected: 28 + actual: 12 + expected: 12 Fi RHS evals: - actual: 52 - expected: 52 + actual: 20 + expected: 20 -------------------- ======================== -DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 -ERK: ARKODE_ARK548L2SA_ERK_8_4_5 - stages: 8 - order: 5 +IMEX Table ID 4 + stages: 3 + order: 2 explicit 1st stage: 1 stiffly accurate: 0 first same as last: 0 ======================== -------------------- Steps: 1 -NLS iters: 7 +NLS iters: 2 Fe RHS evals: - actual: 8 - expected: 8 + actual: 3 + expected: 3 Fi RHS evals: - actual: 15 - expected: 15 + actual: 5 + expected: 5 -------------------- Steps: 2 -NLS iters: 14 +NLS iters: 4 Fe RHS evals: - actual: 23 - expected: 23 + actual: 6 + expected: 6 Fi RHS evals: - actual: 37 - expected: 37 + actual: 10 + expected: 10 -------------------- Steps: 3 -NLS iters: 21 +NLS iters: 6 Fe RHS evals: - actual: 38 - expected: 38 + actual: 9 + expected: 9 Fi RHS evals: - actual: 59 - expected: 59 + actual: 15 + expected: 15 -------------------- Dense Output Fe RHS evals: - actual: 40 - expected: 40 + actual: 10 + expected: 10 Fi RHS evals: - actual: 61 - expected: 61 + actual: 16 + expected: 16 -------------------- Steps: 4 -NLS iters: 28 +NLS iters: 8 Fe RHS evals: - actual: 54 - expected: 54 + actual: 12 + expected: 12 Fi RHS evals: - actual: 82 - expected: 82 + actual: 20 + expected: 20 -------------------- ======================== -DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 -ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 - stages: 8 - order: 5 +IMEX Table ID 5 + stages: 3 + order: 2 explicit 1st stage: 1 stiffly accurate: 0 first same as last: 0 ======================== -------------------- Steps: 1 -NLS iters: 7 +NLS iters: 2 Fe RHS evals: - actual: 8 - expected: 8 + actual: 3 + expected: 3 Fi RHS evals: - actual: 15 - expected: 15 + actual: 5 + expected: 5 -------------------- Steps: 2 -NLS iters: 14 +NLS iters: 4 Fe RHS evals: - actual: 23 - expected: 23 + actual: 6 + expected: 6 Fi RHS evals: - actual: 37 - expected: 37 + actual: 10 + expected: 10 -------------------- Steps: 3 -NLS iters: 21 +NLS iters: 6 Fe RHS evals: - actual: 38 - expected: 38 + actual: 9 + expected: 9 Fi RHS evals: - actual: 59 - expected: 59 + actual: 15 + expected: 15 -------------------- Dense Output Fe RHS evals: - actual: 40 - expected: 40 + actual: 10 + expected: 10 Fi RHS evals: - actual: 61 - expected: 61 + actual: 16 + expected: 16 -------------------- Steps: 4 -NLS iters: 28 +NLS iters: 8 Fe RHS evals: - actual: 54 - expected: 54 + actual: 12 + expected: 12 Fi RHS evals: - actual: 82 - expected: 82 + actual: 20 + expected: 20 -------------------- 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 deleted file mode 100644 index 251a290409..0000000000 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_-1_0.out +++ /dev/null @@ -1,2337 +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 = None - 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_0_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0.out similarity index 86% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0_1.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0.out index b5755efd07..0b5e75274c 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0_1.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0.out @@ -7,14 +7,49 @@ Dahlquist ODE test problem: relative tol = 0.0001 absolute tol = 1e-06 interp type = Hermite - pred type = Max order (1) + pred type = Trivial (0) ======================== Test explicit RK methods ======================== ======================== -ERK: ARKODE_HEUN_EULER_2_1_2 +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 @@ -49,7 +84,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 +ERK Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -84,7 +119,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK324L2SA_ERK_4_2_3 +ERK Table ID 2 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +154,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ZONNEVELD_5_3_4 +ERK Table ID 3 stages: 5 order: 4 explicit 1st stage: 1 @@ -154,7 +189,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK436L2SA_ERK_6_3_4 +ERK Table ID 4 stages: 6 order: 4 explicit 1st stage: 1 @@ -189,7 +224,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SAYFY_ABURUB_6_3_4 +ERK Table ID 5 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +259,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_CASH_KARP_6_4_5 +ERK Table ID 6 stages: 6 order: 5 explicit 1st stage: 1 @@ -259,7 +294,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FEHLBERG_6_4_5 +ERK Table ID 7 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +329,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_DORMAND_PRINCE_7_4_5 +ERK Table ID 8 stages: 7 order: 5 explicit 1st stage: 1 @@ -329,7 +364,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK548L2SA_ERK_8_4_5 +ERK Table ID 9 stages: 8 order: 5 explicit 1st stage: 1 @@ -364,7 +399,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_8_5_6 +ERK Table ID 10 stages: 8 order: 6 explicit 1st stage: 1 @@ -399,7 +434,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FEHLBERG_13_7_8 +ERK Table ID 11 stages: 13 order: 8 explicit 1st stage: 1 @@ -434,7 +469,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_KNOTH_WOLKE_3_3 +ERK Table ID 12 stages: 3 order: 3 explicit 1st stage: 1 @@ -469,7 +504,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK437L2SA_ERK_7_3_4 +ERK Table ID 13 stages: 7 order: 4 explicit 1st stage: 1 @@ -504,7 +539,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 +ERK Table ID 14 stages: 8 order: 5 explicit 1st stage: 1 @@ -539,7 +574,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK2_ERK_3_1_2 +ERK Table ID 15 stages: 3 order: 2 explicit 1st stage: 1 @@ -574,7 +609,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 +ERK Table ID 16 stages: 5 order: 4 explicit 1st stage: 1 @@ -609,7 +644,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SHU_OSHER_3_2_3 +ERK Table ID 17 stages: 3 order: 3 explicit 1st stage: 1 @@ -644,7 +679,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_9_5_6 +ERK Table ID 18 stages: 9 order: 6 explicit 1st stage: 1 @@ -679,7 +714,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_10_6_7 +ERK Table ID 19 stages: 10 order: 7 explicit 1st stage: 1 @@ -714,7 +749,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_13_7_8 +ERK Table ID 20 stages: 13 order: 8 explicit 1st stage: 1 @@ -749,7 +784,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_16_8_9 +ERK Table ID 21 stages: 16 order: 9 explicit 1st stage: 1 @@ -784,116 +819,50 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FORWARD_EULER_1_1 +Test implicit RK methods +======================== + +======================== +Implicit Euler stages: 1 order: 1 - explicit 1st stage: 1 - stiffly accurate: 0 + explicit 1st stage: 0 + stiffly accurate: 1 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: +NLS iters: 1 +Fi 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 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 -------------------- Steps: 3 -Fe RHS evals: - actual: 6 - expected: 6 --------------------- -Dense Output -Fe RHS evals: +NLS iters: 3 +Fi 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: +Fi RHS evals: actual: 7 expected: 7 -------------------- Steps: 4 -Fe RHS evals: - actual: 8 - expected: 8 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 -------------------- ======================== -Test implicit RK methods -======================== - -======================== -DIRK: ARKODE_SDIRK_2_1_2 +DIRK Table ID 100 stages: 2 order: 2 explicit 1st stage: 0 @@ -932,7 +901,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_BILLINGTON_3_3_2 +DIRK Table ID 101 stages: 3 order: 2 explicit 1st stage: 0 @@ -971,7 +940,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_TRBDF2_3_3_2 +DIRK Table ID 102 stages: 3 order: 2 explicit 1st stage: 1 @@ -1010,7 +979,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_4_2_3 +DIRK Table ID 103 stages: 4 order: 3 explicit 1st stage: 1 @@ -1049,7 +1018,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +DIRK Table ID 104 stages: 4 order: 3 explicit 1st stage: 1 @@ -1088,7 +1057,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_CASH_5_2_4 +DIRK Table ID 105 stages: 5 order: 4 explicit 1st stage: 0 @@ -1127,7 +1096,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_CASH_5_3_4 +DIRK Table ID 106 stages: 5 order: 4 explicit 1st stage: 0 @@ -1166,7 +1135,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_SDIRK_5_3_4 +DIRK Table ID 107 stages: 5 order: 4 explicit 1st stage: 0 @@ -1205,7 +1174,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_5_3_4 +DIRK Table ID 108 stages: 5 order: 4 explicit 1st stage: 1 @@ -1244,7 +1213,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +DIRK Table ID 109 stages: 6 order: 4 explicit 1st stage: 1 @@ -1283,7 +1252,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_7_4_5 +DIRK Table ID 110 stages: 7 order: 5 explicit 1st stage: 1 @@ -1300,29 +1269,29 @@ Fi RHS evals: Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 31 - expected: 31 + actual: 25 + expected: 25 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 49 - expected: 49 + actual: 37 + expected: 37 -------------------- Dense Output Fi RHS evals: - actual: 50 - expected: 50 + actual: 38 + expected: 38 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 68 - expected: 68 + actual: 50 + expected: 50 -------------------- ======================== -DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +DIRK Table ID 111 stages: 8 order: 5 explicit 1st stage: 1 @@ -1339,29 +1308,29 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fi RHS evals: - actual: 36 - expected: 36 + actual: 29 + expected: 29 -------------------- Steps: 3 NLS iters: 21 Fi RHS evals: - actual: 57 - expected: 57 + actual: 43 + expected: 43 -------------------- Dense Output Fi RHS evals: - actual: 58 - expected: 58 + actual: 44 + expected: 44 -------------------- Steps: 4 NLS iters: 28 Fi RHS evals: - actual: 79 - expected: 79 + actual: 58 + expected: 58 -------------------- ======================== -DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +DIRK Table ID 112 stages: 7 order: 4 explicit 1st stage: 1 @@ -1400,7 +1369,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +DIRK Table ID 113 stages: 8 order: 5 explicit 1st stage: 1 @@ -1417,29 +1386,29 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fi RHS evals: - actual: 36 - expected: 36 + actual: 29 + expected: 29 -------------------- Steps: 3 NLS iters: 21 Fi RHS evals: - actual: 57 - expected: 57 + actual: 43 + expected: 43 -------------------- Dense Output Fi RHS evals: - actual: 58 - expected: 58 + actual: 44 + expected: 44 -------------------- Steps: 4 NLS iters: 28 Fi RHS evals: - actual: 79 - expected: 79 + actual: 58 + expected: 58 -------------------- ======================== -DIRK: ARKODE_ESDIRK324L2SA_4_2_3 +DIRK Table ID 114 stages: 4 order: 3 explicit 1st stage: 1 @@ -1478,7 +1447,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK325L2SA_5_2_3 +DIRK Table ID 115 stages: 5 order: 3 explicit 1st stage: 1 @@ -1517,7 +1486,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 +DIRK Table ID 116 stages: 5 order: 3 explicit 1st stage: 1 @@ -1556,7 +1525,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK436L2SA_6_3_4 +DIRK Table ID 117 stages: 6 order: 4 explicit 1st stage: 1 @@ -1595,7 +1564,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 +DIRK Table ID 118 stages: 6 order: 4 explicit 1st stage: 1 @@ -1634,7 +1603,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_QESDIRK436L2SA_6_3_4 +DIRK Table ID 119 stages: 6 order: 4 explicit 1st stage: 1 @@ -1673,7 +1642,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK437L2SA_7_3_4 +DIRK Table ID 120 stages: 7 order: 4 explicit 1st stage: 1 @@ -1712,7 +1681,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK547L2SA_7_4_5 +DIRK Table ID 121 stages: 7 order: 5 explicit 1st stage: 1 @@ -1729,29 +1698,29 @@ Fi RHS evals: Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 31 - expected: 31 + actual: 25 + expected: 25 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 49 - expected: 49 + actual: 37 + expected: 37 -------------------- Dense Output Fi RHS evals: - actual: 50 - expected: 50 + actual: 38 + expected: 38 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 68 - expected: 68 + actual: 50 + expected: 50 -------------------- ======================== -DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 +DIRK Table ID 122 stages: 7 order: 5 explicit 1st stage: 1 @@ -1768,29 +1737,29 @@ Fi RHS evals: Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 31 - expected: 31 + actual: 25 + expected: 25 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 49 - expected: 49 + actual: 37 + expected: 37 -------------------- Dense Output Fi RHS evals: - actual: 50 - expected: 50 + actual: 38 + expected: 38 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 68 - expected: 68 + actual: 50 + expected: 50 -------------------- ======================== -DIRK: ARKODE_ARK2_DIRK_3_1_2 +DIRK Table ID 123 stages: 3 order: 2 explicit 1st stage: 1 @@ -1828,123 +1797,6 @@ Fi RHS evals: 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 ===================== @@ -2004,8 +1856,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK2_DIRK_3_1_2 -ERK: ARKODE_ARK2_ERK_3_1_2 +IMEX Table ID 0 stages: 3 order: 2 explicit 1st stage: 1 @@ -2059,8 +1910,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 -ERK: ARKODE_ARK324L2SA_ERK_4_2_3 +IMEX Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -2114,8 +1964,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 -ERK: ARKODE_ARK436L2SA_ERK_6_3_4 +IMEX Table ID 2 stages: 6 order: 4 explicit 1st stage: 1 @@ -2169,8 +2018,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 -ERK: ARKODE_ARK437L2SA_ERK_7_3_4 +IMEX Table ID 3 stages: 7 order: 4 explicit 1st stage: 1 @@ -2224,8 +2072,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 -ERK: ARKODE_ARK548L2SA_ERK_8_4_5 +IMEX Table ID 4 stages: 8 order: 5 explicit 1st stage: 1 @@ -2245,42 +2092,41 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fe RHS evals: - actual: 23 - expected: 23 + actual: 16 + expected: 16 Fi RHS evals: - actual: 37 - expected: 37 + actual: 30 + expected: 30 -------------------- Steps: 3 NLS iters: 21 Fe RHS evals: - actual: 38 - expected: 38 + actual: 24 + expected: 24 Fi RHS evals: - actual: 59 - expected: 59 + actual: 45 + expected: 45 -------------------- Dense Output Fe RHS evals: - actual: 40 - expected: 40 + actual: 26 + expected: 26 Fi RHS evals: - actual: 61 - expected: 61 + actual: 47 + expected: 47 -------------------- Steps: 4 NLS iters: 28 Fe RHS evals: - actual: 54 - expected: 54 + actual: 33 + expected: 33 Fi RHS evals: - actual: 82 - expected: 82 + actual: 61 + expected: 61 -------------------- ======================== -DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 -ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 +IMEX Table ID 5 stages: 8 order: 5 explicit 1st stage: 1 @@ -2300,37 +2146,37 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fe RHS evals: - actual: 23 - expected: 23 + actual: 16 + expected: 16 Fi RHS evals: - actual: 37 - expected: 37 + actual: 30 + expected: 30 -------------------- Steps: 3 NLS iters: 21 Fe RHS evals: - actual: 38 - expected: 38 + actual: 24 + expected: 24 Fi RHS evals: - actual: 59 - expected: 59 + actual: 45 + expected: 45 -------------------- Dense Output Fe RHS evals: - actual: 40 - expected: 40 + actual: 26 + expected: 26 Fi RHS evals: - actual: 61 - expected: 61 + actual: 47 + expected: 47 -------------------- Steps: 4 NLS iters: 28 Fe RHS evals: - actual: 54 - expected: 54 + actual: 33 + expected: 33 Fi RHS evals: - actual: 82 - expected: 82 + actual: 61 + expected: 61 -------------------- 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 deleted file mode 100644 index a5d862a551..0000000000 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0_0.out +++ /dev/null @@ -1,2337 +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 - 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_1_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1.out similarity index 88% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1_1.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1.out index dc65841178..63acf12fd8 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1_1.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1.out @@ -7,14 +7,49 @@ Dahlquist ODE test problem: relative tol = 0.0001 absolute tol = 1e-06 interp type = Lagrange - pred type = Max order (1) + pred type = Trivial (0) ======================== Test explicit RK methods ======================== ======================== -ERK: ARKODE_HEUN_EULER_2_1_2 +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 @@ -49,7 +84,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 +ERK Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -84,7 +119,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK324L2SA_ERK_4_2_3 +ERK Table ID 2 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +154,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ZONNEVELD_5_3_4 +ERK Table ID 3 stages: 5 order: 4 explicit 1st stage: 1 @@ -154,7 +189,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK436L2SA_ERK_6_3_4 +ERK Table ID 4 stages: 6 order: 4 explicit 1st stage: 1 @@ -189,7 +224,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SAYFY_ABURUB_6_3_4 +ERK Table ID 5 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +259,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_CASH_KARP_6_4_5 +ERK Table ID 6 stages: 6 order: 5 explicit 1st stage: 1 @@ -259,7 +294,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FEHLBERG_6_4_5 +ERK Table ID 7 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +329,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_DORMAND_PRINCE_7_4_5 +ERK Table ID 8 stages: 7 order: 5 explicit 1st stage: 1 @@ -329,7 +364,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK548L2SA_ERK_8_4_5 +ERK Table ID 9 stages: 8 order: 5 explicit 1st stage: 1 @@ -364,7 +399,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_8_5_6 +ERK Table ID 10 stages: 8 order: 6 explicit 1st stage: 1 @@ -399,7 +434,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FEHLBERG_13_7_8 +ERK Table ID 11 stages: 13 order: 8 explicit 1st stage: 1 @@ -434,7 +469,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_KNOTH_WOLKE_3_3 +ERK Table ID 12 stages: 3 order: 3 explicit 1st stage: 1 @@ -469,7 +504,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK437L2SA_ERK_7_3_4 +ERK Table ID 13 stages: 7 order: 4 explicit 1st stage: 1 @@ -504,7 +539,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 +ERK Table ID 14 stages: 8 order: 5 explicit 1st stage: 1 @@ -539,7 +574,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK2_ERK_3_1_2 +ERK Table ID 15 stages: 3 order: 2 explicit 1st stage: 1 @@ -574,7 +609,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 +ERK Table ID 16 stages: 5 order: 4 explicit 1st stage: 1 @@ -609,7 +644,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SHU_OSHER_3_2_3 +ERK Table ID 17 stages: 3 order: 3 explicit 1st stage: 1 @@ -644,7 +679,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_9_5_6 +ERK Table ID 18 stages: 9 order: 6 explicit 1st stage: 1 @@ -679,7 +714,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_10_6_7 +ERK Table ID 19 stages: 10 order: 7 explicit 1st stage: 1 @@ -714,7 +749,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_13_7_8 +ERK Table ID 20 stages: 13 order: 8 explicit 1st stage: 1 @@ -749,7 +784,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_16_8_9 +ERK Table ID 21 stages: 16 order: 9 explicit 1st stage: 1 @@ -784,116 +819,50 @@ Fe RHS evals: -------------------- ======================== -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 +Test implicit RK methods ======================== --------------------- -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 +Implicit Euler + stages: 1 + order: 1 + explicit 1st stage: 0 + stiffly accurate: 1 first same as last: 0 ======================== -------------------- Steps: 1 -Fe RHS evals: +NLS iters: 1 +Fi RHS evals: actual: 2 expected: 2 -------------------- Steps: 2 -Fe RHS evals: +NLS iters: 2 +Fi RHS evals: actual: 4 expected: 4 -------------------- Steps: 3 -Fe RHS evals: +NLS iters: 3 +Fi RHS evals: actual: 6 expected: 6 -------------------- Dense Output -Fe RHS evals: +Fi RHS evals: actual: 6 expected: 6 -------------------- Steps: 4 -Fe RHS evals: +NLS iters: 4 +Fi RHS evals: actual: 8 expected: 8 -------------------- ======================== -Test implicit RK methods -======================== - -======================== -DIRK: ARKODE_SDIRK_2_1_2 +DIRK Table ID 100 stages: 2 order: 2 explicit 1st stage: 0 @@ -932,7 +901,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_BILLINGTON_3_3_2 +DIRK Table ID 101 stages: 3 order: 2 explicit 1st stage: 0 @@ -971,7 +940,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_TRBDF2_3_3_2 +DIRK Table ID 102 stages: 3 order: 2 explicit 1st stage: 1 @@ -1010,7 +979,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_4_2_3 +DIRK Table ID 103 stages: 4 order: 3 explicit 1st stage: 1 @@ -1049,7 +1018,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +DIRK Table ID 104 stages: 4 order: 3 explicit 1st stage: 1 @@ -1088,7 +1057,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_CASH_5_2_4 +DIRK Table ID 105 stages: 5 order: 4 explicit 1st stage: 0 @@ -1127,7 +1096,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_CASH_5_3_4 +DIRK Table ID 106 stages: 5 order: 4 explicit 1st stage: 0 @@ -1166,7 +1135,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_SDIRK_5_3_4 +DIRK Table ID 107 stages: 5 order: 4 explicit 1st stage: 0 @@ -1205,7 +1174,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_5_3_4 +DIRK Table ID 108 stages: 5 order: 4 explicit 1st stage: 1 @@ -1244,7 +1213,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +DIRK Table ID 109 stages: 6 order: 4 explicit 1st stage: 1 @@ -1283,7 +1252,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_7_4_5 +DIRK Table ID 110 stages: 7 order: 5 explicit 1st stage: 1 @@ -1322,7 +1291,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +DIRK Table ID 111 stages: 8 order: 5 explicit 1st stage: 1 @@ -1361,7 +1330,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +DIRK Table ID 112 stages: 7 order: 4 explicit 1st stage: 1 @@ -1400,7 +1369,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +DIRK Table ID 113 stages: 8 order: 5 explicit 1st stage: 1 @@ -1439,7 +1408,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK324L2SA_4_2_3 +DIRK Table ID 114 stages: 4 order: 3 explicit 1st stage: 1 @@ -1478,7 +1447,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK325L2SA_5_2_3 +DIRK Table ID 115 stages: 5 order: 3 explicit 1st stage: 1 @@ -1517,7 +1486,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 +DIRK Table ID 116 stages: 5 order: 3 explicit 1st stage: 1 @@ -1556,7 +1525,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK436L2SA_6_3_4 +DIRK Table ID 117 stages: 6 order: 4 explicit 1st stage: 1 @@ -1595,7 +1564,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 +DIRK Table ID 118 stages: 6 order: 4 explicit 1st stage: 1 @@ -1634,7 +1603,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_QESDIRK436L2SA_6_3_4 +DIRK Table ID 119 stages: 6 order: 4 explicit 1st stage: 1 @@ -1673,7 +1642,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK437L2SA_7_3_4 +DIRK Table ID 120 stages: 7 order: 4 explicit 1st stage: 1 @@ -1712,7 +1681,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK547L2SA_7_4_5 +DIRK Table ID 121 stages: 7 order: 5 explicit 1st stage: 1 @@ -1751,7 +1720,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 +DIRK Table ID 122 stages: 7 order: 5 explicit 1st stage: 1 @@ -1790,7 +1759,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK2_DIRK_3_1_2 +DIRK Table ID 123 stages: 3 order: 2 explicit 1st stage: 1 @@ -1828,123 +1797,6 @@ Fi RHS evals: 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 ===================== @@ -2004,8 +1856,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK2_DIRK_3_1_2 -ERK: ARKODE_ARK2_ERK_3_1_2 +IMEX Table ID 0 stages: 3 order: 2 explicit 1st stage: 1 @@ -2059,8 +1910,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 -ERK: ARKODE_ARK324L2SA_ERK_4_2_3 +IMEX Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -2114,8 +1964,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 -ERK: ARKODE_ARK436L2SA_ERK_6_3_4 +IMEX Table ID 2 stages: 6 order: 4 explicit 1st stage: 1 @@ -2169,8 +2018,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 -ERK: ARKODE_ARK437L2SA_ERK_7_3_4 +IMEX Table ID 3 stages: 7 order: 4 explicit 1st stage: 1 @@ -2224,8 +2072,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 -ERK: ARKODE_ARK548L2SA_ERK_8_4_5 +IMEX Table ID 4 stages: 8 order: 5 explicit 1st stage: 1 @@ -2279,8 +2126,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 -ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 +IMEX Table ID 5 stages: 8 order: 5 explicit 1st stage: 1 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 deleted file mode 100644 index 85b1436888..0000000000 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1_0.out +++ /dev/null @@ -1,2337 +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 = 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_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_-1_0.out deleted file mode 100644 index a635cf9f2b..0000000000 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_-1_0.out +++ /dev/null @@ -1,2337 +0,0 @@ - -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 -======================== - -======================== -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_0_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0.out similarity index 86% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0_1.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0.out index db53a029b4..02af9aea19 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0_1.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0.out @@ -7,14 +7,49 @@ Dahlquist ODE test problem: relative tol = 0.0001 absolute tol = 1e-06 interp type = Hermite - pred type = Max order (1) + pred type = Trivial (0) ======================== Test explicit RK methods ======================== ======================== -ERK: ARKODE_HEUN_EULER_2_1_2 +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 @@ -49,7 +84,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 +ERK Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -84,7 +119,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK324L2SA_ERK_4_2_3 +ERK Table ID 2 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +154,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ZONNEVELD_5_3_4 +ERK Table ID 3 stages: 5 order: 4 explicit 1st stage: 1 @@ -154,7 +189,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK436L2SA_ERK_6_3_4 +ERK Table ID 4 stages: 6 order: 4 explicit 1st stage: 1 @@ -189,7 +224,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SAYFY_ABURUB_6_3_4 +ERK Table ID 5 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +259,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_CASH_KARP_6_4_5 +ERK Table ID 6 stages: 6 order: 5 explicit 1st stage: 1 @@ -259,7 +294,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FEHLBERG_6_4_5 +ERK Table ID 7 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +329,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_DORMAND_PRINCE_7_4_5 +ERK Table ID 8 stages: 7 order: 5 explicit 1st stage: 1 @@ -329,7 +364,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK548L2SA_ERK_8_4_5 +ERK Table ID 9 stages: 8 order: 5 explicit 1st stage: 1 @@ -364,7 +399,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_8_5_6 +ERK Table ID 10 stages: 8 order: 6 explicit 1st stage: 1 @@ -399,7 +434,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FEHLBERG_13_7_8 +ERK Table ID 11 stages: 13 order: 8 explicit 1st stage: 1 @@ -434,7 +469,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_KNOTH_WOLKE_3_3 +ERK Table ID 12 stages: 3 order: 3 explicit 1st stage: 1 @@ -469,7 +504,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK437L2SA_ERK_7_3_4 +ERK Table ID 13 stages: 7 order: 4 explicit 1st stage: 1 @@ -504,7 +539,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 +ERK Table ID 14 stages: 8 order: 5 explicit 1st stage: 1 @@ -539,7 +574,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK2_ERK_3_1_2 +ERK Table ID 15 stages: 3 order: 2 explicit 1st stage: 1 @@ -574,7 +609,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 +ERK Table ID 16 stages: 5 order: 4 explicit 1st stage: 1 @@ -609,7 +644,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SHU_OSHER_3_2_3 +ERK Table ID 17 stages: 3 order: 3 explicit 1st stage: 1 @@ -644,7 +679,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_9_5_6 +ERK Table ID 18 stages: 9 order: 6 explicit 1st stage: 1 @@ -679,7 +714,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_10_6_7 +ERK Table ID 19 stages: 10 order: 7 explicit 1st stage: 1 @@ -714,7 +749,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_13_7_8 +ERK Table ID 20 stages: 13 order: 8 explicit 1st stage: 1 @@ -749,7 +784,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_16_8_9 +ERK Table ID 21 stages: 16 order: 9 explicit 1st stage: 1 @@ -784,116 +819,50 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FORWARD_EULER_1_1 +Test implicit RK methods +======================== + +======================== +Implicit Euler stages: 1 order: 1 - explicit 1st stage: 1 - stiffly accurate: 0 + explicit 1st stage: 0 + stiffly accurate: 1 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: +NLS iters: 1 +Fi 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 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 -------------------- Steps: 3 -Fe RHS evals: - actual: 6 - expected: 6 --------------------- -Dense Output -Fe RHS evals: +NLS iters: 3 +Fi 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: +Fi RHS evals: actual: 7 expected: 7 -------------------- Steps: 4 -Fe RHS evals: - actual: 8 - expected: 8 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 -------------------- ======================== -Test implicit RK methods -======================== - -======================== -DIRK: ARKODE_SDIRK_2_1_2 +DIRK Table ID 100 stages: 2 order: 2 explicit 1st stage: 0 @@ -932,7 +901,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_BILLINGTON_3_3_2 +DIRK Table ID 101 stages: 3 order: 2 explicit 1st stage: 0 @@ -971,7 +940,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_TRBDF2_3_3_2 +DIRK Table ID 102 stages: 3 order: 2 explicit 1st stage: 1 @@ -1010,7 +979,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_4_2_3 +DIRK Table ID 103 stages: 4 order: 3 explicit 1st stage: 1 @@ -1049,7 +1018,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +DIRK Table ID 104 stages: 4 order: 3 explicit 1st stage: 1 @@ -1088,7 +1057,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_CASH_5_2_4 +DIRK Table ID 105 stages: 5 order: 4 explicit 1st stage: 0 @@ -1127,7 +1096,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_CASH_5_3_4 +DIRK Table ID 106 stages: 5 order: 4 explicit 1st stage: 0 @@ -1166,7 +1135,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_SDIRK_5_3_4 +DIRK Table ID 107 stages: 5 order: 4 explicit 1st stage: 0 @@ -1205,7 +1174,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_5_3_4 +DIRK Table ID 108 stages: 5 order: 4 explicit 1st stage: 1 @@ -1244,7 +1213,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +DIRK Table ID 109 stages: 6 order: 4 explicit 1st stage: 1 @@ -1283,7 +1252,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_7_4_5 +DIRK Table ID 110 stages: 7 order: 5 explicit 1st stage: 1 @@ -1300,29 +1269,29 @@ Fi RHS evals: Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 31 - expected: 31 + actual: 25 + expected: 25 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 49 - expected: 49 + actual: 37 + expected: 37 -------------------- Dense Output Fi RHS evals: - actual: 50 - expected: 50 + actual: 38 + expected: 38 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 68 - expected: 68 + actual: 50 + expected: 50 -------------------- ======================== -DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +DIRK Table ID 111 stages: 8 order: 5 explicit 1st stage: 1 @@ -1339,29 +1308,29 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fi RHS evals: - actual: 36 - expected: 36 + actual: 29 + expected: 29 -------------------- Steps: 3 NLS iters: 21 Fi RHS evals: - actual: 57 - expected: 57 + actual: 43 + expected: 43 -------------------- Dense Output Fi RHS evals: - actual: 58 - expected: 58 + actual: 44 + expected: 44 -------------------- Steps: 4 NLS iters: 28 Fi RHS evals: - actual: 79 - expected: 79 + actual: 58 + expected: 58 -------------------- ======================== -DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +DIRK Table ID 112 stages: 7 order: 4 explicit 1st stage: 1 @@ -1400,7 +1369,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +DIRK Table ID 113 stages: 8 order: 5 explicit 1st stage: 1 @@ -1417,29 +1386,29 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fi RHS evals: - actual: 36 - expected: 36 + actual: 29 + expected: 29 -------------------- Steps: 3 NLS iters: 21 Fi RHS evals: - actual: 57 - expected: 57 + actual: 43 + expected: 43 -------------------- Dense Output Fi RHS evals: - actual: 58 - expected: 58 + actual: 44 + expected: 44 -------------------- Steps: 4 NLS iters: 28 Fi RHS evals: - actual: 79 - expected: 79 + actual: 58 + expected: 58 -------------------- ======================== -DIRK: ARKODE_ESDIRK324L2SA_4_2_3 +DIRK Table ID 114 stages: 4 order: 3 explicit 1st stage: 1 @@ -1478,7 +1447,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK325L2SA_5_2_3 +DIRK Table ID 115 stages: 5 order: 3 explicit 1st stage: 1 @@ -1517,7 +1486,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 +DIRK Table ID 116 stages: 5 order: 3 explicit 1st stage: 1 @@ -1556,7 +1525,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK436L2SA_6_3_4 +DIRK Table ID 117 stages: 6 order: 4 explicit 1st stage: 1 @@ -1595,7 +1564,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 +DIRK Table ID 118 stages: 6 order: 4 explicit 1st stage: 1 @@ -1634,7 +1603,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_QESDIRK436L2SA_6_3_4 +DIRK Table ID 119 stages: 6 order: 4 explicit 1st stage: 1 @@ -1673,7 +1642,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK437L2SA_7_3_4 +DIRK Table ID 120 stages: 7 order: 4 explicit 1st stage: 1 @@ -1712,7 +1681,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK547L2SA_7_4_5 +DIRK Table ID 121 stages: 7 order: 5 explicit 1st stage: 1 @@ -1729,29 +1698,29 @@ Fi RHS evals: Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 31 - expected: 31 + actual: 25 + expected: 25 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 49 - expected: 49 + actual: 37 + expected: 37 -------------------- Dense Output Fi RHS evals: - actual: 50 - expected: 50 + actual: 38 + expected: 38 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 68 - expected: 68 + actual: 50 + expected: 50 -------------------- ======================== -DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 +DIRK Table ID 122 stages: 7 order: 5 explicit 1st stage: 1 @@ -1768,29 +1737,29 @@ Fi RHS evals: Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 31 - expected: 31 + actual: 25 + expected: 25 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 49 - expected: 49 + actual: 37 + expected: 37 -------------------- Dense Output Fi RHS evals: - actual: 50 - expected: 50 + actual: 38 + expected: 38 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 68 - expected: 68 + actual: 50 + expected: 50 -------------------- ======================== -DIRK: ARKODE_ARK2_DIRK_3_1_2 +DIRK Table ID 123 stages: 3 order: 2 explicit 1st stage: 1 @@ -1828,123 +1797,6 @@ Fi RHS evals: 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 ===================== @@ -2004,8 +1856,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK2_DIRK_3_1_2 -ERK: ARKODE_ARK2_ERK_3_1_2 +IMEX Table ID 0 stages: 3 order: 2 explicit 1st stage: 1 @@ -2059,8 +1910,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 -ERK: ARKODE_ARK324L2SA_ERK_4_2_3 +IMEX Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -2114,8 +1964,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 -ERK: ARKODE_ARK436L2SA_ERK_6_3_4 +IMEX Table ID 2 stages: 6 order: 4 explicit 1st stage: 1 @@ -2169,8 +2018,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 -ERK: ARKODE_ARK437L2SA_ERK_7_3_4 +IMEX Table ID 3 stages: 7 order: 4 explicit 1st stage: 1 @@ -2224,8 +2072,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 -ERK: ARKODE_ARK548L2SA_ERK_8_4_5 +IMEX Table ID 4 stages: 8 order: 5 explicit 1st stage: 1 @@ -2245,42 +2092,41 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fe RHS evals: - actual: 23 - expected: 23 + actual: 16 + expected: 16 Fi RHS evals: - actual: 37 - expected: 37 + actual: 30 + expected: 30 -------------------- Steps: 3 NLS iters: 21 Fe RHS evals: - actual: 38 - expected: 38 + actual: 24 + expected: 24 Fi RHS evals: - actual: 59 - expected: 59 + actual: 45 + expected: 45 -------------------- Dense Output Fe RHS evals: - actual: 40 - expected: 40 + actual: 26 + expected: 26 Fi RHS evals: - actual: 61 - expected: 61 + actual: 47 + expected: 47 -------------------- Steps: 4 NLS iters: 28 Fe RHS evals: - actual: 54 - expected: 54 + actual: 33 + expected: 33 Fi RHS evals: - actual: 82 - expected: 82 + actual: 61 + expected: 61 -------------------- ======================== -DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 -ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 +IMEX Table ID 5 stages: 8 order: 5 explicit 1st stage: 1 @@ -2300,37 +2146,37 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fe RHS evals: - actual: 23 - expected: 23 + actual: 16 + expected: 16 Fi RHS evals: - actual: 37 - expected: 37 + actual: 30 + expected: 30 -------------------- Steps: 3 NLS iters: 21 Fe RHS evals: - actual: 38 - expected: 38 + actual: 24 + expected: 24 Fi RHS evals: - actual: 59 - expected: 59 + actual: 45 + expected: 45 -------------------- Dense Output Fe RHS evals: - actual: 40 - expected: 40 + actual: 26 + expected: 26 Fi RHS evals: - actual: 61 - expected: 61 + actual: 47 + expected: 47 -------------------- Steps: 4 NLS iters: 28 Fe RHS evals: - actual: 54 - expected: 54 + actual: 33 + expected: 33 Fi RHS evals: - actual: 82 - expected: 82 + actual: 61 + expected: 61 -------------------- 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 deleted file mode 100644 index 17271d2d55..0000000000 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0_0.out +++ /dev/null @@ -1,2337 +0,0 @@ - -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_1_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1.out similarity index 88% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1_1.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1.out index 7b6e6eaa43..8e54df6754 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1_1.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1.out @@ -7,14 +7,49 @@ Dahlquist ODE test problem: relative tol = 0.0001 absolute tol = 1e-06 interp type = Lagrange - pred type = Max order (1) + pred type = Trivial (0) ======================== Test explicit RK methods ======================== ======================== -ERK: ARKODE_HEUN_EULER_2_1_2 +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 @@ -49,7 +84,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 +ERK Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -84,7 +119,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK324L2SA_ERK_4_2_3 +ERK Table ID 2 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +154,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ZONNEVELD_5_3_4 +ERK Table ID 3 stages: 5 order: 4 explicit 1st stage: 1 @@ -154,7 +189,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK436L2SA_ERK_6_3_4 +ERK Table ID 4 stages: 6 order: 4 explicit 1st stage: 1 @@ -189,7 +224,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SAYFY_ABURUB_6_3_4 +ERK Table ID 5 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +259,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_CASH_KARP_6_4_5 +ERK Table ID 6 stages: 6 order: 5 explicit 1st stage: 1 @@ -259,7 +294,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FEHLBERG_6_4_5 +ERK Table ID 7 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +329,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_DORMAND_PRINCE_7_4_5 +ERK Table ID 8 stages: 7 order: 5 explicit 1st stage: 1 @@ -329,7 +364,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK548L2SA_ERK_8_4_5 +ERK Table ID 9 stages: 8 order: 5 explicit 1st stage: 1 @@ -364,7 +399,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_8_5_6 +ERK Table ID 10 stages: 8 order: 6 explicit 1st stage: 1 @@ -399,7 +434,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FEHLBERG_13_7_8 +ERK Table ID 11 stages: 13 order: 8 explicit 1st stage: 1 @@ -434,7 +469,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_KNOTH_WOLKE_3_3 +ERK Table ID 12 stages: 3 order: 3 explicit 1st stage: 1 @@ -469,7 +504,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK437L2SA_ERK_7_3_4 +ERK Table ID 13 stages: 7 order: 4 explicit 1st stage: 1 @@ -504,7 +539,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 +ERK Table ID 14 stages: 8 order: 5 explicit 1st stage: 1 @@ -539,7 +574,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK2_ERK_3_1_2 +ERK Table ID 15 stages: 3 order: 2 explicit 1st stage: 1 @@ -574,7 +609,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 +ERK Table ID 16 stages: 5 order: 4 explicit 1st stage: 1 @@ -609,7 +644,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SHU_OSHER_3_2_3 +ERK Table ID 17 stages: 3 order: 3 explicit 1st stage: 1 @@ -644,7 +679,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_9_5_6 +ERK Table ID 18 stages: 9 order: 6 explicit 1st stage: 1 @@ -679,7 +714,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_10_6_7 +ERK Table ID 19 stages: 10 order: 7 explicit 1st stage: 1 @@ -714,7 +749,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_13_7_8 +ERK Table ID 20 stages: 13 order: 8 explicit 1st stage: 1 @@ -749,7 +784,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_16_8_9 +ERK Table ID 21 stages: 16 order: 9 explicit 1st stage: 1 @@ -784,116 +819,50 @@ Fe RHS evals: -------------------- ======================== -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 +Test implicit RK methods ======================== --------------------- -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 +Implicit Euler + stages: 1 + order: 1 + explicit 1st stage: 0 + stiffly accurate: 1 first same as last: 0 ======================== -------------------- Steps: 1 -Fe RHS evals: +NLS iters: 1 +Fi RHS evals: actual: 2 expected: 2 -------------------- Steps: 2 -Fe RHS evals: +NLS iters: 2 +Fi RHS evals: actual: 4 expected: 4 -------------------- Steps: 3 -Fe RHS evals: +NLS iters: 3 +Fi RHS evals: actual: 6 expected: 6 -------------------- Dense Output -Fe RHS evals: +Fi RHS evals: actual: 6 expected: 6 -------------------- Steps: 4 -Fe RHS evals: +NLS iters: 4 +Fi RHS evals: actual: 8 expected: 8 -------------------- ======================== -Test implicit RK methods -======================== - -======================== -DIRK: ARKODE_SDIRK_2_1_2 +DIRK Table ID 100 stages: 2 order: 2 explicit 1st stage: 0 @@ -932,7 +901,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_BILLINGTON_3_3_2 +DIRK Table ID 101 stages: 3 order: 2 explicit 1st stage: 0 @@ -971,7 +940,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_TRBDF2_3_3_2 +DIRK Table ID 102 stages: 3 order: 2 explicit 1st stage: 1 @@ -1010,7 +979,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_4_2_3 +DIRK Table ID 103 stages: 4 order: 3 explicit 1st stage: 1 @@ -1049,7 +1018,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +DIRK Table ID 104 stages: 4 order: 3 explicit 1st stage: 1 @@ -1088,7 +1057,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_CASH_5_2_4 +DIRK Table ID 105 stages: 5 order: 4 explicit 1st stage: 0 @@ -1127,7 +1096,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_CASH_5_3_4 +DIRK Table ID 106 stages: 5 order: 4 explicit 1st stage: 0 @@ -1166,7 +1135,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_SDIRK_5_3_4 +DIRK Table ID 107 stages: 5 order: 4 explicit 1st stage: 0 @@ -1205,7 +1174,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_5_3_4 +DIRK Table ID 108 stages: 5 order: 4 explicit 1st stage: 1 @@ -1244,7 +1213,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +DIRK Table ID 109 stages: 6 order: 4 explicit 1st stage: 1 @@ -1283,7 +1252,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_7_4_5 +DIRK Table ID 110 stages: 7 order: 5 explicit 1st stage: 1 @@ -1322,7 +1291,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +DIRK Table ID 111 stages: 8 order: 5 explicit 1st stage: 1 @@ -1361,7 +1330,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +DIRK Table ID 112 stages: 7 order: 4 explicit 1st stage: 1 @@ -1400,7 +1369,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +DIRK Table ID 113 stages: 8 order: 5 explicit 1st stage: 1 @@ -1439,7 +1408,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK324L2SA_4_2_3 +DIRK Table ID 114 stages: 4 order: 3 explicit 1st stage: 1 @@ -1478,7 +1447,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK325L2SA_5_2_3 +DIRK Table ID 115 stages: 5 order: 3 explicit 1st stage: 1 @@ -1517,7 +1486,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 +DIRK Table ID 116 stages: 5 order: 3 explicit 1st stage: 1 @@ -1556,7 +1525,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK436L2SA_6_3_4 +DIRK Table ID 117 stages: 6 order: 4 explicit 1st stage: 1 @@ -1595,7 +1564,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 +DIRK Table ID 118 stages: 6 order: 4 explicit 1st stage: 1 @@ -1634,7 +1603,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_QESDIRK436L2SA_6_3_4 +DIRK Table ID 119 stages: 6 order: 4 explicit 1st stage: 1 @@ -1673,7 +1642,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK437L2SA_7_3_4 +DIRK Table ID 120 stages: 7 order: 4 explicit 1st stage: 1 @@ -1712,7 +1681,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK547L2SA_7_4_5 +DIRK Table ID 121 stages: 7 order: 5 explicit 1st stage: 1 @@ -1751,7 +1720,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 +DIRK Table ID 122 stages: 7 order: 5 explicit 1st stage: 1 @@ -1790,7 +1759,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK2_DIRK_3_1_2 +DIRK Table ID 123 stages: 3 order: 2 explicit 1st stage: 1 @@ -1828,123 +1797,6 @@ Fi RHS evals: 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 ===================== @@ -2004,8 +1856,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK2_DIRK_3_1_2 -ERK: ARKODE_ARK2_ERK_3_1_2 +IMEX Table ID 0 stages: 3 order: 2 explicit 1st stage: 1 @@ -2059,8 +1910,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 -ERK: ARKODE_ARK324L2SA_ERK_4_2_3 +IMEX Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -2114,8 +1964,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 -ERK: ARKODE_ARK436L2SA_ERK_6_3_4 +IMEX Table ID 2 stages: 6 order: 4 explicit 1st stage: 1 @@ -2169,8 +2018,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 -ERK: ARKODE_ARK437L2SA_ERK_7_3_4 +IMEX Table ID 3 stages: 7 order: 4 explicit 1st stage: 1 @@ -2224,8 +2072,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 -ERK: ARKODE_ARK548L2SA_ERK_8_4_5 +IMEX Table ID 4 stages: 8 order: 5 explicit 1st stage: 1 @@ -2279,8 +2126,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 -ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 +IMEX Table ID 5 stages: 8 order: 5 explicit 1st stage: 1 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 deleted file mode 100644 index 360e2985b9..0000000000 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1_0.out +++ /dev/null @@ -1,2337 +0,0 @@ - -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_2_-1_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_-1_0.out deleted file mode 100644 index 7febbb08dc..0000000000 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_-1_0.out +++ /dev/null @@ -1,2337 +0,0 @@ - -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 -======================== - -======================== -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_ark_2_0_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0.out similarity index 88% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0_0.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0.out index e10f1f5d4c..363b66b2ac 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0_0.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0.out @@ -14,7 +14,42 @@ Test explicit RK methods ======================== ======================== -ERK: ARKODE_HEUN_EULER_2_1_2 +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 @@ -49,7 +84,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 +ERK Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -84,7 +119,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK324L2SA_ERK_4_2_3 +ERK Table ID 2 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +154,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ZONNEVELD_5_3_4 +ERK Table ID 3 stages: 5 order: 4 explicit 1st stage: 1 @@ -154,7 +189,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK436L2SA_ERK_6_3_4 +ERK Table ID 4 stages: 6 order: 4 explicit 1st stage: 1 @@ -189,7 +224,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SAYFY_ABURUB_6_3_4 +ERK Table ID 5 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +259,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_CASH_KARP_6_4_5 +ERK Table ID 6 stages: 6 order: 5 explicit 1st stage: 1 @@ -259,7 +294,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FEHLBERG_6_4_5 +ERK Table ID 7 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +329,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_DORMAND_PRINCE_7_4_5 +ERK Table ID 8 stages: 7 order: 5 explicit 1st stage: 1 @@ -329,7 +364,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK548L2SA_ERK_8_4_5 +ERK Table ID 9 stages: 8 order: 5 explicit 1st stage: 1 @@ -364,7 +399,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_8_5_6 +ERK Table ID 10 stages: 8 order: 6 explicit 1st stage: 1 @@ -399,7 +434,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FEHLBERG_13_7_8 +ERK Table ID 11 stages: 13 order: 8 explicit 1st stage: 1 @@ -434,7 +469,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_KNOTH_WOLKE_3_3 +ERK Table ID 12 stages: 3 order: 3 explicit 1st stage: 1 @@ -469,7 +504,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK437L2SA_ERK_7_3_4 +ERK Table ID 13 stages: 7 order: 4 explicit 1st stage: 1 @@ -504,7 +539,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 +ERK Table ID 14 stages: 8 order: 5 explicit 1st stage: 1 @@ -539,7 +574,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK2_ERK_3_1_2 +ERK Table ID 15 stages: 3 order: 2 explicit 1st stage: 1 @@ -574,7 +609,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 +ERK Table ID 16 stages: 5 order: 4 explicit 1st stage: 1 @@ -609,7 +644,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SHU_OSHER_3_2_3 +ERK Table ID 17 stages: 3 order: 3 explicit 1st stage: 1 @@ -644,7 +679,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_9_5_6 +ERK Table ID 18 stages: 9 order: 6 explicit 1st stage: 1 @@ -679,7 +714,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_10_6_7 +ERK Table ID 19 stages: 10 order: 7 explicit 1st stage: 1 @@ -714,7 +749,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_13_7_8 +ERK Table ID 20 stages: 13 order: 8 explicit 1st stage: 1 @@ -749,7 +784,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_16_8_9 +ERK Table ID 21 stages: 16 order: 9 explicit 1st stage: 1 @@ -784,116 +819,50 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FORWARD_EULER_1_1 +Test implicit RK methods +======================== + +======================== +Implicit Euler stages: 1 order: 1 - explicit 1st stage: 1 - stiffly accurate: 0 + explicit 1st stage: 0 + stiffly accurate: 1 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: +NLS iters: 1 +Fi 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 +NLS iters: 2 +Fi RHS evals: + actual: 5 + expected: 5 -------------------- Steps: 3 -Fe RHS evals: - actual: 6 - expected: 6 --------------------- -Dense Output -Fe RHS evals: +NLS iters: 3 +Fi 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: +Fi RHS evals: actual: 7 expected: 7 -------------------- Steps: 4 -Fe RHS evals: - actual: 8 - expected: 8 +NLS iters: 4 +Fi RHS evals: + actual: 9 + expected: 9 -------------------- ======================== -Test implicit RK methods -======================== - -======================== -DIRK: ARKODE_SDIRK_2_1_2 +DIRK Table ID 100 stages: 2 order: 2 explicit 1st stage: 0 @@ -932,7 +901,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_BILLINGTON_3_3_2 +DIRK Table ID 101 stages: 3 order: 2 explicit 1st stage: 0 @@ -971,7 +940,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_TRBDF2_3_3_2 +DIRK Table ID 102 stages: 3 order: 2 explicit 1st stage: 1 @@ -1010,7 +979,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_4_2_3 +DIRK Table ID 103 stages: 4 order: 3 explicit 1st stage: 1 @@ -1049,7 +1018,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +DIRK Table ID 104 stages: 4 order: 3 explicit 1st stage: 1 @@ -1088,7 +1057,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_CASH_5_2_4 +DIRK Table ID 105 stages: 5 order: 4 explicit 1st stage: 0 @@ -1127,7 +1096,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_CASH_5_3_4 +DIRK Table ID 106 stages: 5 order: 4 explicit 1st stage: 0 @@ -1166,7 +1135,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_SDIRK_5_3_4 +DIRK Table ID 107 stages: 5 order: 4 explicit 1st stage: 0 @@ -1205,7 +1174,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_5_3_4 +DIRK Table ID 108 stages: 5 order: 4 explicit 1st stage: 1 @@ -1244,7 +1213,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +DIRK Table ID 109 stages: 6 order: 4 explicit 1st stage: 1 @@ -1283,7 +1252,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_7_4_5 +DIRK Table ID 110 stages: 7 order: 5 explicit 1st stage: 1 @@ -1322,7 +1291,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +DIRK Table ID 111 stages: 8 order: 5 explicit 1st stage: 1 @@ -1361,7 +1330,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +DIRK Table ID 112 stages: 7 order: 4 explicit 1st stage: 1 @@ -1400,7 +1369,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +DIRK Table ID 113 stages: 8 order: 5 explicit 1st stage: 1 @@ -1439,7 +1408,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK324L2SA_4_2_3 +DIRK Table ID 114 stages: 4 order: 3 explicit 1st stage: 1 @@ -1478,7 +1447,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK325L2SA_5_2_3 +DIRK Table ID 115 stages: 5 order: 3 explicit 1st stage: 1 @@ -1517,7 +1486,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 +DIRK Table ID 116 stages: 5 order: 3 explicit 1st stage: 1 @@ -1556,7 +1525,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK436L2SA_6_3_4 +DIRK Table ID 117 stages: 6 order: 4 explicit 1st stage: 1 @@ -1595,7 +1564,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 +DIRK Table ID 118 stages: 6 order: 4 explicit 1st stage: 1 @@ -1634,7 +1603,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_QESDIRK436L2SA_6_3_4 +DIRK Table ID 119 stages: 6 order: 4 explicit 1st stage: 1 @@ -1673,7 +1642,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK437L2SA_7_3_4 +DIRK Table ID 120 stages: 7 order: 4 explicit 1st stage: 1 @@ -1712,7 +1681,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK547L2SA_7_4_5 +DIRK Table ID 121 stages: 7 order: 5 explicit 1st stage: 1 @@ -1751,7 +1720,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 +DIRK Table ID 122 stages: 7 order: 5 explicit 1st stage: 1 @@ -1790,7 +1759,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK2_DIRK_3_1_2 +DIRK Table ID 123 stages: 3 order: 2 explicit 1st stage: 1 @@ -1828,123 +1797,6 @@ Fi RHS evals: 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 ===================== @@ -2004,8 +1856,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK2_DIRK_3_1_2 -ERK: ARKODE_ARK2_ERK_3_1_2 +IMEX Table ID 0 stages: 3 order: 2 explicit 1st stage: 1 @@ -2059,8 +1910,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 -ERK: ARKODE_ARK324L2SA_ERK_4_2_3 +IMEX Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -2114,8 +1964,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 -ERK: ARKODE_ARK436L2SA_ERK_6_3_4 +IMEX Table ID 2 stages: 6 order: 4 explicit 1st stage: 1 @@ -2169,8 +2018,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 -ERK: ARKODE_ARK437L2SA_ERK_7_3_4 +IMEX Table ID 3 stages: 7 order: 4 explicit 1st stage: 1 @@ -2224,8 +2072,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 -ERK: ARKODE_ARK548L2SA_ERK_8_4_5 +IMEX Table ID 4 stages: 8 order: 5 explicit 1st stage: 1 @@ -2279,8 +2126,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 -ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 +IMEX Table ID 5 stages: 8 order: 5 explicit 1st stage: 1 diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1.out similarity index 88% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1_0.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1.out index 6104aab893..bf8edcf74b 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1_0.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1.out @@ -14,7 +14,42 @@ Test explicit RK methods ======================== ======================== -ERK: ARKODE_HEUN_EULER_2_1_2 +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 @@ -49,7 +84,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 +ERK Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -84,7 +119,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK324L2SA_ERK_4_2_3 +ERK Table ID 2 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +154,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ZONNEVELD_5_3_4 +ERK Table ID 3 stages: 5 order: 4 explicit 1st stage: 1 @@ -154,7 +189,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK436L2SA_ERK_6_3_4 +ERK Table ID 4 stages: 6 order: 4 explicit 1st stage: 1 @@ -189,7 +224,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SAYFY_ABURUB_6_3_4 +ERK Table ID 5 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +259,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_CASH_KARP_6_4_5 +ERK Table ID 6 stages: 6 order: 5 explicit 1st stage: 1 @@ -259,7 +294,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FEHLBERG_6_4_5 +ERK Table ID 7 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +329,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_DORMAND_PRINCE_7_4_5 +ERK Table ID 8 stages: 7 order: 5 explicit 1st stage: 1 @@ -329,7 +364,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK548L2SA_ERK_8_4_5 +ERK Table ID 9 stages: 8 order: 5 explicit 1st stage: 1 @@ -364,7 +399,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_8_5_6 +ERK Table ID 10 stages: 8 order: 6 explicit 1st stage: 1 @@ -399,7 +434,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_FEHLBERG_13_7_8 +ERK Table ID 11 stages: 13 order: 8 explicit 1st stage: 1 @@ -434,7 +469,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_KNOTH_WOLKE_3_3 +ERK Table ID 12 stages: 3 order: 3 explicit 1st stage: 1 @@ -469,7 +504,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK437L2SA_ERK_7_3_4 +ERK Table ID 13 stages: 7 order: 4 explicit 1st stage: 1 @@ -504,7 +539,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 +ERK Table ID 14 stages: 8 order: 5 explicit 1st stage: 1 @@ -539,7 +574,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_ARK2_ERK_3_1_2 +ERK Table ID 15 stages: 3 order: 2 explicit 1st stage: 1 @@ -574,7 +609,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 +ERK Table ID 16 stages: 5 order: 4 explicit 1st stage: 1 @@ -609,7 +644,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_SHU_OSHER_3_2_3 +ERK Table ID 17 stages: 3 order: 3 explicit 1st stage: 1 @@ -644,7 +679,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_9_5_6 +ERK Table ID 18 stages: 9 order: 6 explicit 1st stage: 1 @@ -679,7 +714,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_10_6_7 +ERK Table ID 19 stages: 10 order: 7 explicit 1st stage: 1 @@ -714,7 +749,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_13_7_8 +ERK Table ID 20 stages: 13 order: 8 explicit 1st stage: 1 @@ -749,7 +784,7 @@ Fe RHS evals: -------------------- ======================== -ERK: ARKODE_VERNER_16_8_9 +ERK Table ID 21 stages: 16 order: 9 explicit 1st stage: 1 @@ -784,116 +819,50 @@ Fe RHS evals: -------------------- ======================== -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 +Test implicit RK methods ======================== --------------------- -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 +Implicit Euler + stages: 1 + order: 1 + explicit 1st stage: 0 + stiffly accurate: 1 first same as last: 0 ======================== -------------------- Steps: 1 -Fe RHS evals: +NLS iters: 1 +Fi RHS evals: actual: 2 expected: 2 -------------------- Steps: 2 -Fe RHS evals: +NLS iters: 2 +Fi RHS evals: actual: 4 expected: 4 -------------------- Steps: 3 -Fe RHS evals: +NLS iters: 3 +Fi RHS evals: actual: 6 expected: 6 -------------------- Dense Output -Fe RHS evals: +Fi RHS evals: actual: 6 expected: 6 -------------------- Steps: 4 -Fe RHS evals: +NLS iters: 4 +Fi RHS evals: actual: 8 expected: 8 -------------------- ======================== -Test implicit RK methods -======================== - -======================== -DIRK: ARKODE_SDIRK_2_1_2 +DIRK Table ID 100 stages: 2 order: 2 explicit 1st stage: 0 @@ -932,7 +901,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_BILLINGTON_3_3_2 +DIRK Table ID 101 stages: 3 order: 2 explicit 1st stage: 0 @@ -971,7 +940,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_TRBDF2_3_3_2 +DIRK Table ID 102 stages: 3 order: 2 explicit 1st stage: 1 @@ -1010,7 +979,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_4_2_3 +DIRK Table ID 103 stages: 4 order: 3 explicit 1st stage: 1 @@ -1049,7 +1018,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +DIRK Table ID 104 stages: 4 order: 3 explicit 1st stage: 1 @@ -1088,7 +1057,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_CASH_5_2_4 +DIRK Table ID 105 stages: 5 order: 4 explicit 1st stage: 0 @@ -1127,7 +1096,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_CASH_5_3_4 +DIRK Table ID 106 stages: 5 order: 4 explicit 1st stage: 0 @@ -1166,7 +1135,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_SDIRK_5_3_4 +DIRK Table ID 107 stages: 5 order: 4 explicit 1st stage: 0 @@ -1205,7 +1174,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_5_3_4 +DIRK Table ID 108 stages: 5 order: 4 explicit 1st stage: 1 @@ -1244,7 +1213,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +DIRK Table ID 109 stages: 6 order: 4 explicit 1st stage: 1 @@ -1283,7 +1252,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_KVAERNO_7_4_5 +DIRK Table ID 110 stages: 7 order: 5 explicit 1st stage: 1 @@ -1322,7 +1291,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +DIRK Table ID 111 stages: 8 order: 5 explicit 1st stage: 1 @@ -1361,7 +1330,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +DIRK Table ID 112 stages: 7 order: 4 explicit 1st stage: 1 @@ -1400,7 +1369,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +DIRK Table ID 113 stages: 8 order: 5 explicit 1st stage: 1 @@ -1439,7 +1408,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK324L2SA_4_2_3 +DIRK Table ID 114 stages: 4 order: 3 explicit 1st stage: 1 @@ -1478,7 +1447,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK325L2SA_5_2_3 +DIRK Table ID 115 stages: 5 order: 3 explicit 1st stage: 1 @@ -1517,7 +1486,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 +DIRK Table ID 116 stages: 5 order: 3 explicit 1st stage: 1 @@ -1556,7 +1525,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK436L2SA_6_3_4 +DIRK Table ID 117 stages: 6 order: 4 explicit 1st stage: 1 @@ -1595,7 +1564,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 +DIRK Table ID 118 stages: 6 order: 4 explicit 1st stage: 1 @@ -1634,7 +1603,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_QESDIRK436L2SA_6_3_4 +DIRK Table ID 119 stages: 6 order: 4 explicit 1st stage: 1 @@ -1673,7 +1642,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK437L2SA_7_3_4 +DIRK Table ID 120 stages: 7 order: 4 explicit 1st stage: 1 @@ -1712,7 +1681,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK547L2SA_7_4_5 +DIRK Table ID 121 stages: 7 order: 5 explicit 1st stage: 1 @@ -1751,7 +1720,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 +DIRK Table ID 122 stages: 7 order: 5 explicit 1st stage: 1 @@ -1790,7 +1759,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK2_DIRK_3_1_2 +DIRK Table ID 123 stages: 3 order: 2 explicit 1st stage: 1 @@ -1828,123 +1797,6 @@ Fi RHS evals: 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 ===================== @@ -2004,8 +1856,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK2_DIRK_3_1_2 -ERK: ARKODE_ARK2_ERK_3_1_2 +IMEX Table ID 0 stages: 3 order: 2 explicit 1st stage: 1 @@ -2059,8 +1910,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 -ERK: ARKODE_ARK324L2SA_ERK_4_2_3 +IMEX Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -2114,8 +1964,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 -ERK: ARKODE_ARK436L2SA_ERK_6_3_4 +IMEX Table ID 2 stages: 6 order: 4 explicit 1st stage: 1 @@ -2169,8 +2018,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 -ERK: ARKODE_ARK437L2SA_ERK_7_3_4 +IMEX Table ID 3 stages: 7 order: 4 explicit 1st stage: 1 @@ -2224,8 +2072,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 -ERK: ARKODE_ARK548L2SA_ERK_8_4_5 +IMEX Table ID 4 stages: 8 order: 5 explicit 1st stage: 1 @@ -2279,8 +2126,7 @@ Fi RHS evals: -------------------- ======================== -DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 -ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 +IMEX Table ID 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 deleted file mode 100644 index 8e069fe420..0000000000 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1_1.out +++ /dev/null @@ -1,2337 +0,0 @@ - -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 2de9d17dca..9338d33550 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,7 +46,6 @@ enum class interp_type { - none = -1, hermite, lagrange }; @@ -72,9 +71,8 @@ struct ProblemOptions sunrealtype h = SUN_RCONST(0.01); // Interpolant type - // -1 = None - // 0 = Hermite - // 1 = Lagrange + // 0 = Hermite + // 1 = Lagrange interp_type i_type = interp_type::hermite; }; @@ -111,20 +109,8 @@ int main(int argc, char* argv[]) // Check for inputs 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; - } + if (std::stoi(argv[1]) == 0) { prob_opts.i_type = interp_type::hermite; } + else { prob_opts.i_type = interp_type::lagrange; } } // Output problem setup @@ -137,11 +123,7 @@ int main(int argc, char* argv[]) { 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"; } + else { std::cout << " interp type = Lagrange\n"; } // Create SUNDIALS context sundials::Context sunctx; @@ -162,6 +144,30 @@ 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)); @@ -170,8 +176,7 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "get_method_properties", 1)) { return 1; } std::cout << "\n========================" << std::endl; - std::cout << ARKodeButcherTable_ERKIDToName(static_cast<ARKODE_ERKTableID>(i)) - << std::endl; + std::cout << "ERK Table ID " << i << std::endl; std::cout << " stages: " << stages << std::endl; std::cout << " order: " << order << std::endl; std::cout << " explicit 1st stage: " << explicit_first_stage << std::endl; @@ -229,27 +234,22 @@ int run_tests(ARKodeButcherTable Be, ProblemData& prob_data, if (check_flag((void*)erkstep_mem, "ERKStepCreate", 0)) { return 1; } // Set user data - flag = ARKodeSetUserData(erkstep_mem, &prob_data); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ERKStepSetUserData(erkstep_mem, &prob_data); + if (check_flag(&flag, "ERKStepSetUserData", 1)) { return 1; } // Specify tolerances - flag = ARKodeSStolerances(erkstep_mem, prob_opts.reltol, prob_opts.abstol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ERKStepSStolerances(erkstep_mem, prob_opts.reltol, prob_opts.abstol); + if (check_flag(&flag, "ERKStepSStolerances", 1)) { return 1; } // Specify fixed time step size - flag = ARKodeSetFixedStep(erkstep_mem, prob_opts.h); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = ERKStepSetFixedStep(erkstep_mem, prob_opts.h); + if (check_flag(&flag, "ERKStepSetFixedStep", 1)) { return 1; } // Lagrange interpolant (removes additional RHS evaluation with DIRK methods) if (prob_opts.i_type == interp_type::lagrange) { - flag = 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; } + flag = ERKStepSetInterpolantType(erkstep_mem, ARK_INTERP_LAGRANGE); + if (check_flag(&flag, "ERKStepSetInterpolantType", 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 = ARKodeEvolve(erkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); - if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } + flag = ERKStepEvolve(erkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); + if (check_flag(&flag, "ERKStepEvolve", 1)) { return 1; } // Update output time t_out += prob_opts.h; @@ -302,14 +302,11 @@ int run_tests(ARKodeButcherTable Be, ProblemData& prob_data, std::cout << "Dense Output" << std::endl; sunrealtype h_last; - flag = ARKodeGetLastStep(erkstep_mem, &h_last); - if (check_flag(&flag, "ARKodeGetLastStep", 1)) { return 1; } + flag = ERKStepGetLastStep(erkstep_mem, &h_last); + if (check_flag(&flag, "ERKStepGetLastStep", 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; } - } + flag = ERKStepGetDky(erkstep_mem, t_ret - h_last / TWO, 0, y); + if (check_flag(&flag, "ERKStepGetDky", 1)) { return 1; } // Stiffly accurate (and FSAL) methods do not require an additional RHS // evaluation to get the new RHS value at the end of a step for dense @@ -345,8 +342,8 @@ int run_tests(ARKodeButcherTable Be, ProblemData& prob_data, if (numfails == 0) { // Advance in time - flag = ARKodeEvolve(erkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); - if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } + flag = ERKStepEvolve(erkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); + if (check_flag(&flag, "ERKStepEvolve", 1)) { return 1; } // Update output time t_out += prob_opts.h; @@ -365,7 +362,7 @@ int run_tests(ARKodeButcherTable Be, ProblemData& prob_data, // Clean up // -------- - ARKodeFree(&erkstep_mem); + ERKStepFree(&erkstep_mem); N_VDestroy(y); return numfails; @@ -412,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 = ARKodeGetNumSteps(erkstep_mem, &nst); - if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } + flag = ERKStepGetNumSteps(erkstep_mem, &nst); + if (check_flag(&flag, "ERKStepGetNumSteps", 1)) { return 1; } // Expected number of explicit functions evaluations nfe_expected = 0; @@ -448,8 +445,8 @@ int check_rhs_evals(void* erkstep_mem, long int nfe_expected) int flag = 0; long int nst = 0; - flag = ARKodeGetNumSteps(erkstep_mem, &nst); - if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } + flag = ERKStepGetNumSteps(erkstep_mem, &nst); + if (check_flag(&flag, "ERKStepGetNumSteps", 1)) { return 1; } long int nfe; flag = ERKStepGetNumRhsEvals(erkstep_mem, &nfe); 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.out similarity index 62% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk_-1.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.out index 7943fd7e1b..d4900dcca0 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.out @@ -4,14 +4,49 @@ Dahlquist ODE test problem: step size = 0.01 relative tol = 0.0001 absolute tol = 1e-06 - interp type = None + interp type = Hermite ======================== Test explicit RK methods ======================== ======================== -ARKODE_HEUN_EULER_2_1_2 +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 @@ -36,8 +71,8 @@ Fe RHS evals: -------------------- Dense Output Fe RHS evals: - actual: 6 - expected: 6 + actual: 7 + expected: 7 -------------------- Steps: 4 Fe RHS evals: @@ -46,7 +81,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_BOGACKI_SHAMPINE_4_2_3 +ERK Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -81,7 +116,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK324L2SA_ERK_4_2_3 +ERK Table ID 2 stages: 4 order: 3 explicit 1st stage: 1 @@ -106,8 +141,8 @@ Fe RHS evals: -------------------- Dense Output Fe RHS evals: - actual: 12 - expected: 12 + actual: 13 + expected: 13 -------------------- Steps: 4 Fe RHS evals: @@ -116,7 +151,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ZONNEVELD_5_3_4 +ERK Table ID 3 stages: 5 order: 4 explicit 1st stage: 1 @@ -141,8 +176,8 @@ Fe RHS evals: -------------------- Dense Output Fe RHS evals: - actual: 15 - expected: 15 + actual: 16 + expected: 16 -------------------- Steps: 4 Fe RHS evals: @@ -151,7 +186,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK436L2SA_ERK_6_3_4 +ERK Table ID 4 stages: 6 order: 4 explicit 1st stage: 1 @@ -176,8 +211,8 @@ Fe RHS evals: -------------------- Dense Output Fe RHS evals: - actual: 18 - expected: 18 + actual: 19 + expected: 19 -------------------- Steps: 4 Fe RHS evals: @@ -186,7 +221,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_SAYFY_ABURUB_6_3_4 +ERK Table ID 5 stages: 6 order: 4 explicit 1st stage: 1 @@ -211,8 +246,8 @@ Fe RHS evals: -------------------- Dense Output Fe RHS evals: - actual: 18 - expected: 18 + actual: 19 + expected: 19 -------------------- Steps: 4 Fe RHS evals: @@ -221,7 +256,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_CASH_KARP_6_4_5 +ERK Table ID 6 stages: 6 order: 5 explicit 1st stage: 1 @@ -246,17 +281,17 @@ Fe RHS evals: -------------------- Dense Output Fe RHS evals: - actual: 18 - expected: 18 + actual: 20 + expected: 20 -------------------- Steps: 4 Fe RHS evals: - actual: 24 - expected: 24 + actual: 25 + expected: 25 -------------------- ======================== -ARKODE_FEHLBERG_6_4_5 +ERK Table ID 7 stages: 6 order: 5 explicit 1st stage: 1 @@ -281,17 +316,17 @@ Fe RHS evals: -------------------- Dense Output Fe RHS evals: - actual: 18 - expected: 18 + actual: 20 + expected: 20 -------------------- Steps: 4 Fe RHS evals: - actual: 24 - expected: 24 + actual: 25 + expected: 25 -------------------- ======================== -ARKODE_DORMAND_PRINCE_7_4_5 +ERK Table ID 8 stages: 7 order: 5 explicit 1st stage: 1 @@ -316,17 +351,17 @@ Fe RHS evals: -------------------- Dense Output Fe RHS evals: - actual: 19 - expected: 19 + actual: 20 + expected: 20 -------------------- Steps: 4 Fe RHS evals: - actual: 25 - expected: 25 + actual: 26 + expected: 26 -------------------- ======================== -ARKODE_ARK548L2SA_ERK_8_4_5 +ERK Table ID 9 stages: 8 order: 5 explicit 1st stage: 1 @@ -351,17 +386,17 @@ Fe RHS evals: -------------------- Dense Output Fe RHS evals: - actual: 24 - expected: 24 + actual: 26 + expected: 26 -------------------- Steps: 4 Fe RHS evals: - actual: 32 - expected: 32 + actual: 33 + expected: 33 -------------------- ======================== -ARKODE_VERNER_8_5_6 +ERK Table ID 10 stages: 8 order: 6 explicit 1st stage: 1 @@ -386,17 +421,17 @@ Fe RHS evals: -------------------- Dense Output Fe RHS evals: - actual: 24 - expected: 24 + actual: 29 + expected: 29 -------------------- Steps: 4 Fe RHS evals: - actual: 32 - expected: 32 + actual: 36 + expected: 36 -------------------- ======================== -ARKODE_FEHLBERG_13_7_8 +ERK Table ID 11 stages: 13 order: 8 explicit 1st stage: 1 @@ -421,17 +456,17 @@ Fe RHS evals: -------------------- Dense Output Fe RHS evals: - actual: 39 - expected: 39 + actual: 44 + expected: 44 -------------------- Steps: 4 Fe RHS evals: - actual: 52 - expected: 52 + actual: 56 + expected: 56 -------------------- ======================== -ARKODE_KNOTH_WOLKE_3_3 +ERK Table ID 12 stages: 3 order: 3 explicit 1st stage: 1 @@ -456,8 +491,8 @@ Fe RHS evals: -------------------- Dense Output Fe RHS evals: - actual: 9 - expected: 9 + actual: 10 + expected: 10 -------------------- Steps: 4 Fe RHS evals: @@ -466,7 +501,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK437L2SA_ERK_7_3_4 +ERK Table ID 13 stages: 7 order: 4 explicit 1st stage: 1 @@ -491,8 +526,8 @@ Fe RHS evals: -------------------- Dense Output Fe RHS evals: - actual: 21 - expected: 21 + actual: 22 + expected: 22 -------------------- Steps: 4 Fe RHS evals: @@ -501,7 +536,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK548L2SAb_ERK_8_4_5 +ERK Table ID 14 stages: 8 order: 5 explicit 1st stage: 1 @@ -526,17 +561,17 @@ Fe RHS evals: -------------------- Dense Output Fe RHS evals: - actual: 24 - expected: 24 + actual: 26 + expected: 26 -------------------- Steps: 4 Fe RHS evals: - actual: 32 - expected: 32 + actual: 33 + expected: 33 -------------------- ======================== -ARKODE_ARK2_ERK_3_1_2 +ERK Table ID 15 stages: 3 order: 2 explicit 1st stage: 1 @@ -560,329 +595,14 @@ Fe RHS evals: expected: 9 -------------------- Dense Output -Fe RHS evals: - actual: 9 - expected: 9 --------------------- -Steps: 4 -Fe RHS evals: - actual: 12 - expected: 12 --------------------- - -======================== -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 --------------------- - -======================== -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 --------------------- - -======================== -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 --------------------- - -======================== -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 --------------------- - -======================== -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 --------------------- - -======================== -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 --------------------- - -======================== -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 --------------------- - -======================== -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 --------------------- - -======================== -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 + actual: 12 + expected: 12 -------------------- 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 e252ae486b..7e2256037c 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,7 +11,42 @@ Test explicit RK methods ======================== ======================== -ARKODE_HEUN_EULER_2_1_2 +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 @@ -46,7 +81,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_BOGACKI_SHAMPINE_4_2_3 +ERK Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -81,7 +116,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK324L2SA_ERK_4_2_3 +ERK Table ID 2 stages: 4 order: 3 explicit 1st stage: 1 @@ -116,7 +151,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ZONNEVELD_5_3_4 +ERK Table ID 3 stages: 5 order: 4 explicit 1st stage: 1 @@ -151,7 +186,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK436L2SA_ERK_6_3_4 +ERK Table ID 4 stages: 6 order: 4 explicit 1st stage: 1 @@ -186,7 +221,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_SAYFY_ABURUB_6_3_4 +ERK Table ID 5 stages: 6 order: 4 explicit 1st stage: 1 @@ -221,7 +256,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_CASH_KARP_6_4_5 +ERK Table ID 6 stages: 6 order: 5 explicit 1st stage: 1 @@ -256,7 +291,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_FEHLBERG_6_4_5 +ERK Table ID 7 stages: 6 order: 5 explicit 1st stage: 1 @@ -291,7 +326,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_DORMAND_PRINCE_7_4_5 +ERK Table ID 8 stages: 7 order: 5 explicit 1st stage: 1 @@ -326,7 +361,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK548L2SA_ERK_8_4_5 +ERK Table ID 9 stages: 8 order: 5 explicit 1st stage: 1 @@ -361,7 +396,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_VERNER_8_5_6 +ERK Table ID 10 stages: 8 order: 6 explicit 1st stage: 1 @@ -396,7 +431,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_FEHLBERG_13_7_8 +ERK Table ID 11 stages: 13 order: 8 explicit 1st stage: 1 @@ -431,7 +466,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_KNOTH_WOLKE_3_3 +ERK Table ID 12 stages: 3 order: 3 explicit 1st stage: 1 @@ -466,7 +501,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK437L2SA_ERK_7_3_4 +ERK Table ID 13 stages: 7 order: 4 explicit 1st stage: 1 @@ -501,7 +536,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK548L2SAb_ERK_8_4_5 +ERK Table ID 14 stages: 8 order: 5 explicit 1st stage: 1 @@ -536,7 +571,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK2_ERK_3_1_2 +ERK Table ID 15 stages: 3 order: 2 explicit 1st stage: 1 @@ -571,7 +606,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_SOFRONIOU_SPALETTA_5_3_4 +ERK Table ID 16 stages: 5 order: 4 explicit 1st stage: 1 @@ -606,7 +641,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_SHU_OSHER_3_2_3 +ERK Table ID 17 stages: 3 order: 3 explicit 1st stage: 1 @@ -641,7 +676,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_VERNER_9_5_6 +ERK Table ID 18 stages: 9 order: 6 explicit 1st stage: 1 @@ -676,7 +711,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_VERNER_10_6_7 +ERK Table ID 19 stages: 10 order: 7 explicit 1st stage: 1 @@ -711,7 +746,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_VERNER_13_7_8 +ERK Table ID 20 stages: 13 order: 8 explicit 1st stage: 1 @@ -746,7 +781,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_VERNER_16_8_9 +ERK Table ID 21 stages: 16 order: 9 explicit 1st stage: 1 @@ -780,110 +815,5 @@ Fe RHS evals: expected: 68 -------------------- -======================== -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 --------------------- - -======================== -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 --------------------- - -======================== -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 --------------------- - 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 c62f75edf0..74bc1b6a8d 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,7 +11,42 @@ Test explicit RK methods ======================== ======================== -ARKODE_HEUN_EULER_2_1_2 +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 @@ -46,7 +81,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_BOGACKI_SHAMPINE_4_2_3 +ERK Table ID 1 stages: 4 order: 3 explicit 1st stage: 1 @@ -81,7 +116,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK324L2SA_ERK_4_2_3 +ERK Table ID 2 stages: 4 order: 3 explicit 1st stage: 1 @@ -116,7 +151,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ZONNEVELD_5_3_4 +ERK Table ID 3 stages: 5 order: 4 explicit 1st stage: 1 @@ -151,7 +186,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK436L2SA_ERK_6_3_4 +ERK Table ID 4 stages: 6 order: 4 explicit 1st stage: 1 @@ -186,7 +221,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_SAYFY_ABURUB_6_3_4 +ERK Table ID 5 stages: 6 order: 4 explicit 1st stage: 1 @@ -221,7 +256,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_CASH_KARP_6_4_5 +ERK Table ID 6 stages: 6 order: 5 explicit 1st stage: 1 @@ -256,7 +291,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_FEHLBERG_6_4_5 +ERK Table ID 7 stages: 6 order: 5 explicit 1st stage: 1 @@ -291,7 +326,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_DORMAND_PRINCE_7_4_5 +ERK Table ID 8 stages: 7 order: 5 explicit 1st stage: 1 @@ -326,7 +361,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK548L2SA_ERK_8_4_5 +ERK Table ID 9 stages: 8 order: 5 explicit 1st stage: 1 @@ -361,7 +396,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_VERNER_8_5_6 +ERK Table ID 10 stages: 8 order: 6 explicit 1st stage: 1 @@ -396,7 +431,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_FEHLBERG_13_7_8 +ERK Table ID 11 stages: 13 order: 8 explicit 1st stage: 1 @@ -431,7 +466,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_KNOTH_WOLKE_3_3 +ERK Table ID 12 stages: 3 order: 3 explicit 1st stage: 1 @@ -466,7 +501,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK437L2SA_ERK_7_3_4 +ERK Table ID 13 stages: 7 order: 4 explicit 1st stage: 1 @@ -501,7 +536,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK548L2SAb_ERK_8_4_5 +ERK Table ID 14 stages: 8 order: 5 explicit 1st stage: 1 @@ -536,7 +571,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_ARK2_ERK_3_1_2 +ERK Table ID 15 stages: 3 order: 2 explicit 1st stage: 1 @@ -571,7 +606,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_SOFRONIOU_SPALETTA_5_3_4 +ERK Table ID 16 stages: 5 order: 4 explicit 1st stage: 1 @@ -606,7 +641,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_SHU_OSHER_3_2_3 +ERK Table ID 17 stages: 3 order: 3 explicit 1st stage: 1 @@ -641,7 +676,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_VERNER_9_5_6 +ERK Table ID 18 stages: 9 order: 6 explicit 1st stage: 1 @@ -676,7 +711,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_VERNER_10_6_7 +ERK Table ID 19 stages: 10 order: 7 explicit 1st stage: 1 @@ -711,7 +746,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_VERNER_13_7_8 +ERK Table ID 20 stages: 13 order: 8 explicit 1st stage: 1 @@ -746,7 +781,7 @@ Fe RHS evals: -------------------- ======================== -ARKODE_VERNER_16_8_9 +ERK Table ID 21 stages: 16 order: 9 explicit 1st stage: 1 @@ -780,110 +815,5 @@ Fe RHS evals: expected: 64 -------------------- -======================== -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 --------------------- - -======================== -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 --------------------- - -======================== -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 --------------------- - 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 202e1780ef..06546062e5 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,7 +24,6 @@ #include <cstring> #include <iomanip> #include <iostream> -#include <map> #include <nvector/nvector_serial.h> #include <string> #include <sundials/sundials_core.hpp> @@ -43,45 +42,16 @@ #define FSYM "f" #endif -enum class interp_type -{ - none = -1, - hermite, - lagrange, -}; +using namespace std; -// Problem parameters -struct ProblemData +// User data structure +struct UserData { 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); @@ -90,11 +60,12 @@ 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 std::string funcname, int opt); +static int check_flag(void* flagvalue, const string funcname, int opt); // Test drivers -static int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, - ProblemData& prob_data, SUNContext ctx); +static int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, + sunrealtype hs, sunrealtype hf, sunrealtype reltol, + sunrealtype abstol, UserData* udata, SUNContext ctx); // ----------------------------------------------------------------------------- // Main Program @@ -102,61 +73,58 @@ static int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, int main(int argc, char* argv[]) { - // Problem data and options structures - ProblemData prob_data; - ProblemOptions prob_opts; + // 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; // Check for inputs - 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; - } - } + 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]); } // Output problem setup - 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"; } + 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"; + // Create SUNDIALS context sundials::Context sunctx; // Test methods int numfails = 0; - numfails += run_tests(MRISTEP_EXPLICIT, prob_opts, prob_data, sunctx); + numfails += run_tests(MRISTEP_EXPLICIT, t0, nsteps, hs, hf, reltol, abstol, + &udata, sunctx); - numfails += run_tests(MRISTEP_IMPLICIT, prob_opts, prob_data, sunctx); + numfails += run_tests(MRISTEP_IMPLICIT, t0, nsteps, hs, hf, reltol, abstol, + &udata, sunctx); - numfails += run_tests(MRISTEP_IMEX, prob_opts, prob_data, sunctx); + numfails += run_tests(MRISTEP_IMEX, t0, nsteps, hs, hf, reltol, abstol, + &udata, sunctx); - if (numfails) { std::cout << "\n\nFailed " << numfails << " tests!\n"; } - else { std::cout << "\n\nAll tests passed!\n"; } + if (numfails) { cout << "\n\nFailed " << numfails << " tests!\n"; } + else { cout << "\n\nAll tests passed!\n"; } // Return test status return numfails; @@ -166,8 +134,9 @@ int main(int argc, char* argv[]) // Test drivers // ----------------------------------------------------------------------------- -int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, - ProblemData& prob_data, SUNContext sunctx) +int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, + sunrealtype hs, sunrealtype hf, sunrealtype reltol, + sunrealtype abstol, UserData* udata, SUNContext sunctx) { // Reusable error-checking flag int flag; @@ -200,32 +169,20 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, // ---------------------- // Create explicit fast integrator - void* arkstep_mem = ARKStepCreate(ff, nullptr, prob_opts.t0, y, sunctx); + void* arkstep_mem = ARKStepCreate(ff, nullptr, t0, y, sunctx); if (check_flag((void*)arkstep_mem, "ARKStepCreate", 0)) { return 1; } // Set user data - flag = ARKodeSetUserData(arkstep_mem, &prob_data); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(arkstep_mem, udata); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } // Specify tolerances - flag = ARKodeSStolerances(arkstep_mem, prob_opts.reltol, prob_opts.abstol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkstep_mem, reltol, abstol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } // Specify fixed time step size - 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; } - } + flag = ARKStepSetFixedStep(arkstep_mem, hf); + if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } // Wrap ARKStep integrator as fast integrator object MRIStepInnerStepper inner_stepper = nullptr; @@ -241,121 +198,118 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, if (type == MRISTEP_EXPLICIT) { - mristep_mem = MRIStepCreate(fe, nullptr, prob_opts.t0, y, inner_stepper, - sunctx); + mristep_mem = MRIStepCreate(fe, nullptr, t0, y, inner_stepper, sunctx); } else if (type == MRISTEP_IMPLICIT) { - mristep_mem = MRIStepCreate(nullptr, fi, prob_opts.t0, y, inner_stepper, - sunctx); + mristep_mem = MRIStepCreate(nullptr, fi, t0, y, inner_stepper, sunctx); } else if (type == MRISTEP_IMEX) { - mristep_mem = MRIStepCreate(fe, fi, prob_opts.t0, y, inner_stepper, sunctx); + mristep_mem = MRIStepCreate(fe, fi, 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, &prob_data); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = MRIStepSetUserData(mristep_mem, udata); + if (check_flag(&flag, "MRIStepSetUserData", 1)) { return 1; } // Specify tolerances - flag = ARKodeSStolerances(mristep_mem, prob_opts.reltol, prob_opts.abstol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = MRIStepSStolerances(mristep_mem, reltol, abstol); + if (check_flag(&flag, "MRIStepSStolerances", 1)) { return 1; } // Specify fixed time step sizes - flag = ARKodeSetFixedStep(mristep_mem, prob_opts.hs); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = MRIStepSetFixedStep(mristep_mem, hs); + if (check_flag(&flag, "MRIStepSetFixedStep", 1)) { return 1; } if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) { // Attach linear solver - flag = ARKodeSetLinearSolver(mristep_mem, LS, A); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = MRIStepSetLinearSolver(mristep_mem, LS, A); + if (check_flag(&flag, "MRIStepSetLinearSolver", 1)) { return 1; } // Set Jacobian function - flag = ARKodeSetJacFn(mristep_mem, Ji); - if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } + flag = MRIStepSetJacFn(mristep_mem, Ji); + if (check_flag(&flag, "MRIStepSetJacFn", 1)) { return 1; } // Specify linearly implicit RHS, with non-time-dependent Jacobian - flag = ARKodeSetLinear(mristep_mem, 0); - 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; } + flag = MRIStepSetLinear(mristep_mem, 0); + if (check_flag(&flag, "MRIStepSetLinear", 1)) { return 1; } } // ------------------------------------ // Evolve with various IMEX MRI methods // ------------------------------------ - // Methods to test paired with whether they are stiffly accurate - std::map<std::string, bool> 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; if (type == MRISTEP_EXPLICIT) { - 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}, - {"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}}); + cout << "\n=========================\n"; + 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; } else if (type == MRISTEP_IMPLICIT) { - 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}, - {"ARKODE_MRI_GARK_IMPLICIT_MIDPOINT", false}, - {"ARKODE_MRI_GARK_ESDIRK34a", true}, - {"ARKODE_MRI_GARK_ESDIRK46a", true}}); + cout << "\n=========================\n"; + 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; } else if (type == MRISTEP_IMEX) { - 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}, - {"ARKODE_IMEX_MRI_GARK_MIDPOINT", false}, - {"ARKODE_IMEX_MRI_GARK3a", false}, - {"ARKODE_IMEX_MRI_GARK3b", false}, - {"ARKODE_IMEX_MRI_GARK4", false}}); + cout << "\n=====================\n"; + 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; } else { return 1; } - for (const auto& pair : methods) + for (int i = 0; i < num_methods; i++) { - std::string id = pair.first; - bool stiffly_accurate = pair.second; - std::cout << "\nTesting method " << id << "\n"; + cout << "\nTesting method " << i << "\n"; // ------------- // Select method // ------------- // Load method table - MRIStepCoupling C = MRIStepCoupling_LoadTableByName(id.c_str()); + MRIStepCoupling C = MRIStepCoupling_LoadTable(methods[i]); if (check_flag((void*)C, "MRIStepCoupling_LoadTable", 0)) { return 1; } MRIStepCoupling_Write(C, stdout); @@ -367,7 +321,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, flag = mriStepCoupling_GetStageMap(C, stage_map, &nstages_stored); if (check_flag(&flag, "mriStepCoupling_GetStageMap", 1)) { return 1; } - std::cout << " Stored stages = " << nstages_stored << "\n"; + cout << " Stored stages = " << nstages_stored << "\n"; delete[] stage_map; // Set coupling table @@ -378,17 +332,17 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, // Output statistics // ----------------- - sunrealtype t = prob_opts.t0; - sunrealtype tf = prob_opts.nsteps * prob_opts.hs; + sunrealtype t = t0; + sunrealtype tf = nsteps * hs; - for (int i = 0; i < prob_opts.nsteps; i++) + for (int i = 0; i < nsteps; i++) { // Advance in time - flag = ARKodeEvolve(mristep_mem, tf, y, &t, ARK_ONE_STEP); - if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } + flag = MRIStepEvolve(mristep_mem, tf, y, &t, ARK_ONE_STEP); + if (check_flag(&flag, "MRIStepEvolve", 1)) { return 1; } // Update output time - tf += prob_opts.hs; + tf += hs; } // ----------------- @@ -399,96 +353,107 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, long int mri_nni, mri_ncfn; // nonlinear solver long int mri_nsetups, mri_nje, mri_nfeLS; // linear solver - flag = ARKodeGetNumSteps(mristep_mem, &mri_nst); - if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } + flag = MRIStepGetNumSteps(mristep_mem, &mri_nst); + if (check_flag(&flag, "MRIStepGetNumSteps", 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 = ARKodeGetNumNonlinSolvIters(mristep_mem, &mri_nni); - if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return 1; } + flag = MRIStepGetNumNonlinSolvIters(mristep_mem, &mri_nni); + if (check_flag(&flag, "MRIStepGetNumNonlinSolvIters", 1)) { return 1; } - flag = ARKodeGetNumNonlinSolvConvFails(mristep_mem, &mri_ncfn); - if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return 1; } + flag = MRIStepGetNumNonlinSolvConvFails(mristep_mem, &mri_ncfn); + if (check_flag(&flag, "MRIStepGetNumNonlinSolvConvFails", 1)) + { + return 1; + } - flag = ARKodeGetNumLinSolvSetups(mristep_mem, &mri_nsetups); - if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return 1; } + flag = MRIStepGetNumLinSolvSetups(mristep_mem, &mri_nsetups); + if (check_flag(&flag, "MRIStepGetNumLinSolvSetups", 1)) { return 1; } - flag = ARKodeGetNumJacEvals(mristep_mem, &mri_nje); - if (check_flag(&flag, "ARKodeGetNumJacEvals", 1)) { return 1; } + flag = MRIStepGetNumJacEvals(mristep_mem, &mri_nje); + if (check_flag(&flag, "MRIStepGetNumJacEvals", 1)) { return 1; } - flag = ARKodeGetNumLinRhsEvals(mristep_mem, &mri_nfeLS); - check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1); + flag = MRIStepGetNumLinRhsEvals(mristep_mem, &mri_nfeLS); + check_flag(&flag, "MRIStepGetNumLinRhsEvals", 1); } - sunrealtype pow = prob_data.lambda_f; + sunrealtype pow = udata->lambda_f; if (type == MRISTEP_EXPLICIT || type == MRISTEP_IMEX) { - pow += prob_data.lambda_e; + pow += udata->lambda_e; } if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) { - pow += prob_data.lambda_i; + pow += udata->lambda_i; } sunrealtype ytrue = exp(pow * t); sunrealtype* ydata = N_VGetArrayPointer(y); sunrealtype error = ytrue - ydata[0]; - 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"; + 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"; if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) { - 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"; + 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"; } // ---------------- // Check statistics // ---------------- - std::cout << "\nComparing Solver Statistics:\n"; + 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_evaluated; + fe_evals = mri_nst * nstages_stored; } if (mri_nfse != fe_evals) { numfails++; - std::cout << "Fe RHS evals: " << mri_nfse << " vs " << fe_evals << "\n"; + cout << "Fe RHS evals: " << mri_nfse << " vs " << fe_evals << "\n"; } long int fi_evals = 0; if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) { - fi_evals = mri_nst * nstages_evaluated + mri_nni; + if (stiffly_accurate[i]) + { + // The last stage is implicit so it does not correspond to a column of + // zeros in the coupling matrix and is counted in "nstages_stored" + // however we do not evaluate the RHS functions after the solve since + // the methods is "FSAL" (the index map value and allocated space is + // used in the nonlinear for this stage). The RHS functions will be + // evaluated and stored at the start of the next step. + fi_evals = mri_nst * (nstages_stored - 1) + mri_nni; + } + else { fi_evals = mri_nst * nstages_stored + mri_nni; } } if (mri_nfsi != fi_evals) { numfails++; - std::cout << "Fi RHS evals: " << mri_nfsi << " vs " << fi_evals << "\n"; + cout << "Fi RHS evals: " << mri_nfsi << " vs " << fi_evals << "\n"; } - if (numfails) { std::cout << "Failed " << numfails << " tests\n"; } - else { std::cout << "All checks passed\n"; } + if (numfails) { cout << "Failed " << numfails << " tests\n"; } + else { cout << "All checks passed\n"; } // ------------------- // Setup for next test @@ -501,21 +466,21 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, N_VConst(SUN_RCONST(1.0), y); // Re-initialize fast integrator - flag = ARKStepReInit(arkstep_mem, ff, nullptr, prob_opts.t0, y); + flag = ARKStepReInit(arkstep_mem, ff, nullptr, 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, prob_opts.t0, y); + flag = MRIStepReInit(mristep_mem, fe, nullptr, t0, y); } else if (type == MRISTEP_IMPLICIT) { - flag = MRIStepReInit(mristep_mem, nullptr, fi, prob_opts.t0, y); + flag = MRIStepReInit(mristep_mem, nullptr, fi, t0, y); } else if (type == MRISTEP_IMEX) { - flag = MRIStepReInit(mristep_mem, fe, fi, prob_opts.t0, y); + flag = MRIStepReInit(mristep_mem, fe, fi, t0, y); } else { return 1; } if (check_flag(&flag, "MRIStepReInit", 1)) { return 1; } @@ -523,14 +488,16 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, // Clean up MRIStepInnerStepper_Free(&inner_stepper); - ARKodeFree(&mristep_mem); - ARKodeFree(&arkstep_mem); + MRIStepFree(&mristep_mem); + ARKStepFree(&arkstep_mem); if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) { SUNLinSolFree(LS); SUNMatDestroy(A); } N_VDestroy(y); + delete[] methods; + delete[] stiffly_accurate; return numfails; } @@ -542,11 +509,11 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, // 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); - ProblemData* prob_data = static_cast<ProblemData*>(user_data); + sunrealtype* y_data = N_VGetArrayPointer(y); + sunrealtype* yd_data = N_VGetArrayPointer(ydot); + UserData* udata = static_cast<UserData*>(user_data); - yd_data[0] = prob_data->lambda_e * y_data[0]; + yd_data[0] = udata->lambda_e * y_data[0]; return 0; } @@ -554,11 +521,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); - ProblemData* prob_data = static_cast<ProblemData*>(user_data); + sunrealtype* y_data = N_VGetArrayPointer(y); + sunrealtype* yd_data = N_VGetArrayPointer(ydot); + UserData* udata = static_cast<UserData*>(user_data); - yd_data[0] = prob_data->lambda_i * y_data[0]; + yd_data[0] = udata->lambda_i * y_data[0]; return 0; } @@ -566,11 +533,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); - ProblemData* prob_data = static_cast<ProblemData*>(user_data); + sunrealtype* y_data = N_VGetArrayPointer(y); + sunrealtype* yd_data = N_VGetArrayPointer(ydot); + UserData* udata = static_cast<UserData*>(user_data); - yd_data[0] = prob_data->lambda_f * y_data[0]; + yd_data[0] = udata->lambda_f * y_data[0]; return 0; } @@ -579,10 +546,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); - ProblemData* prob_data = static_cast<ProblemData*>(user_data); + sunrealtype* J_data = SUNDenseMatrix_Data(J); + UserData* udata = static_cast<UserData*>(user_data); - J_data[0] = prob_data->lambda_i; + J_data[0] = udata->lambda_i; return 0; } @@ -592,15 +559,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 std::string funcname, int opt) +static int check_flag(void* flagvalue, const string funcname, int opt) { int* errflag; // Check if function returned NULL pointer - no memory allocated if (opt == 0 && flagvalue == nullptr) { - std::cerr << "\nMEMORY_ERROR: " << funcname - << " failed - returned NULL pointer\n\n"; + cerr << "\nMEMORY_ERROR: " << funcname + << " failed - returned NULL pointer\n\n"; return 1; } // Check if flag < 0 @@ -609,8 +576,8 @@ static int check_flag(void* flagvalue, const std::string funcname, int opt) errflag = (int*)flagvalue; if (*errflag < 0) { - std::cerr << "\nSUNDIALS_ERROR: " << funcname - << " failed with flag = " << *errflag << "\n\n"; + 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_-1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.out similarity index 79% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_-1.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.out index 9f09d86912..5e7243e3e8 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.out @@ -7,13 +7,12 @@ Dahlquist ODE test problem: h fast = 0.01 relative tol = 0.0001 absolute tol = 1e-06 - interp type = None ========================= Test explicit MRI methods ========================= -Testing method ARKODE_MIS_KW3 +Testing method 0 nmat = 1 stages = 4 method order (q) = 3 @@ -39,57 +38,7 @@ MRIStep Statistics: 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 +Testing method 1 nmat = 2 stages = 4 method order (q) = 3 @@ -121,7 +70,7 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed -Testing method ARKODE_MRI_GARK_ERK45a +Testing method 2 nmat = 2 stages = 6 method order (q) = 4 @@ -157,109 +106,28 @@ 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 ARKODE_MRI_GARK_BACKWARD_EULER +Testing method 0 nmat = 1 stages = 3 - method order (q) = 1 + method order (q) = 2 embedding order (p) = 0 c = 0 1 1 G[0] = 0 0 0 1 0 0 - -1 0 1 + -0.5 0 0.5 Stored stages = 2 MRIStep Statistics: Time = 0.01 y(t) = 0.980199 - y_n = 0.980297 - Error = -9.80272e-05 + y_n = 0.980199 + Error = -8.22598e-10 Steps = 1 Fe evals = 0 Fi evals = 2 @@ -272,7 +140,7 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed -Testing method ARKODE_MRI_GARK_ESDIRK34a +Testing method 1 nmat = 1 stages = 7 method order (q) = 3 @@ -306,7 +174,7 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed -Testing method ARKODE_MRI_GARK_ESDIRK46a +Testing method 2 nmat = 2 stages = 11 method order (q) = 4 @@ -357,72 +225,11 @@ 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 ARKODE_IMEX_MRI_GARK3a +Testing method 0 nmat = 1 stages = 8 method order (q) = 3 @@ -467,7 +274,7 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed -Testing method ARKODE_IMEX_MRI_GARK3b +Testing method 1 nmat = 1 stages = 8 method order (q) = 3 @@ -512,7 +319,7 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed -Testing method ARKODE_IMEX_MRI_GARK4 +Testing method 2 nmat = 2 stages = 12 method order (q) = 4 @@ -593,114 +400,5 @@ 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! 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 deleted file mode 100644 index 4591cb3cd3..0000000000 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_0.out +++ /dev/null @@ -1,706 +0,0 @@ - -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 deleted file mode 100644 index 5311a51fcd..0000000000 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_1.out +++ /dev/null @@ -1,706 +0,0 @@ - -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! 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 9b53b9083b..7dee98545f 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) ] * ---------------------------------------------------------------------------*/ -static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +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 @@ static 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) ] * ---------------------------------------------------------------------------*/ -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) +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 @@ static int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, // ----------------------------------------------------------------------------- // Check function return flag -static int check_flag(int flag, const std::string funcname) +int check_flag(int flag, const std::string funcname) { if (!flag) { return 0; } if (flag < 0) { std::cerr << "ERROR: "; } @@ -155,7 +155,7 @@ static int check_flag(int flag, const std::string funcname) } // Check if a function returned a NULL pointer -static int check_ptr(void* ptr, const std::string funcname) +int check_ptr(void* ptr, const std::string funcname) { if (ptr) { return 0; } std::cerr << "ERROR: " << funcname << " returned NULL" << std::endl; @@ -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 = ARKodeSStolerances(arkode_mem, rtol, atol); - if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + flag = ARKStepSStolerances(arkode_mem, rtol, atol); + if (check_flag(flag, "ARKStepSStolerances")) { 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 = ARKodeSetLinearSolver(arkode_mem, LS, A); - if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, A); + if (check_flag(flag, "ARKStepSetLinearSolver")) { return 1; } sunrealtype udata[4] = {-TWO, HALF, HALF, -ONE}; - flag = ARKodeSetUserData(arkode_mem, udata); - if (check_flag(flag, "ARKodeSetUserData")) { return 1; } + flag = ARKStepSetUserData(arkode_mem, udata); + if (check_flag(flag, "ARKStepSetUserData")) { return 1; } // Initial time and fist output time sunrealtype tret = ZERO; sunrealtype tout = tret + SUN_RCONST(0.1); // Advance one step in time - flag = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_ONE_STEP); - if (check_flag(flag, "ARKode")) { return 1; } + flag = ARKStepEvolve(arkode_mem, tout, y, &tret, ARK_ONE_STEP); + if (check_flag(flag, "ARKStep")) { return 1; } // Get the internal finite difference approximation to J SUNMatrix Jdq; - flag = ARKodeGetJac(arkode_mem, &Jdq); - if (check_flag(flag, "ARKodeGetJac")) { return 1; } + flag = ARKStepGetJac(arkode_mem, &Jdq); + if (check_flag(flag, "ARKStepGetJac")) { return 1; } // Get the step and time at which the approximation was computed long int nst_Jdq; - flag = ARKodeGetJacNumSteps(arkode_mem, &nst_Jdq); - if (check_flag(flag, "ARKodeGetJacNumSteps")) { return 1; } + flag = ARKStepGetJacNumSteps(arkode_mem, &nst_Jdq); + if (check_flag(flag, "ARKStepGetJacNumSteps")) { return 1; } sunrealtype t_Jdq; - flag = ARKodeGetJacTime(arkode_mem, &t_Jdq); - if (check_flag(flag, "ARKodeGetJacTime")) { return 1; } + flag = ARKStepGetJacTime(arkode_mem, &t_Jdq); + if (check_flag(flag, "ARKStepGetJacTime")) { 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); - ARKodeFree(&arkode_mem); + ARKStepFree(&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 4737434ff6..4ad57a55e4 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) ] * ---------------------------------------------------------------------------*/ -static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +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 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) /* ----------------------------------------------------------------------------- * Compute the fast ODE RHS function * ---------------------------------------------------------------------------*/ -static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +int f0(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { N_VConst(ZERO, ydot); return 0; @@ -127,8 +127,8 @@ static 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) ] * ---------------------------------------------------------------------------*/ -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) +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 @@ static int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, // ----------------------------------------------------------------------------- // Check function return flag -static int check_flag(int flag, const std::string funcname) +int check_flag(int flag, const std::string funcname) { if (!flag) { return 0; } if (flag < 0) { std::cerr << "ERROR: "; } @@ -165,7 +165,7 @@ static int check_flag(int flag, const std::string funcname) } // Check if a function returned a NULL pointer -static int check_ptr(void* ptr, const std::string funcname) +int check_ptr(void* ptr, const std::string funcname) { if (ptr) { return 0; } std::cerr << "ERROR: " << funcname << " returned NULL" << std::endl; @@ -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 = ARKodeSStolerances(arkode_mem, rtol, atol); - if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + flag = MRIStepSStolerances(arkode_mem, rtol, atol); + if (check_flag(flag, "MRIStepSStolerances")) { return 1; } - flag = ARKodeSetFixedStep(arkode_mem, SUN_RCONST(1.0e-5)); - if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + flag = MRIStepSetFixedStep(arkode_mem, SUN_RCONST(1.0e-5)); + if (check_flag(flag, "MRIStepSetFixedStep")) { 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 = ARKodeSetLinearSolver(arkode_mem, LS, A); - if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } + flag = MRIStepSetLinearSolver(arkode_mem, LS, A); + if (check_flag(flag, "MRIStepSetLinearSolver")) { return 1; } sunrealtype udata[4] = {-TWO, HALF, HALF, -ONE}; - flag = ARKodeSetUserData(arkode_mem, udata); - if (check_flag(flag, "ARKodeSetUserData")) { return 1; } + flag = MRIStepSetUserData(arkode_mem, udata); + if (check_flag(flag, "MRIStepSetUserData")) { return 1; } // Initial time and fist output time sunrealtype tret = ZERO; sunrealtype tout = tret + SUN_RCONST(0.1); // Advance one step in time - flag = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_ONE_STEP); - if (check_flag(flag, "ARKode")) { return 1; } + flag = MRIStepEvolve(arkode_mem, tout, y, &tret, ARK_ONE_STEP); + if (check_flag(flag, "MRIStep")) { return 1; } // Get the internal finite difference approximation to J SUNMatrix Jdq; - flag = ARKodeGetJac(arkode_mem, &Jdq); - if (check_flag(flag, "ARKodeGetJac")) { return 1; } + flag = MRIStepGetJac(arkode_mem, &Jdq); + if (check_flag(flag, "MRIStepGetJac")) { return 1; } // Get the step and time at which the approximation was computed long int nst_Jdq; - flag = ARKodeGetJacNumSteps(arkode_mem, &nst_Jdq); - if (check_flag(flag, "ARKodeGetJacNumSteps")) { return 1; } + flag = MRIStepGetJacNumSteps(arkode_mem, &nst_Jdq); + if (check_flag(flag, "MRIStepGetJacNumSteps")) { return 1; } sunrealtype t_Jdq; - flag = ARKodeGetJacTime(arkode_mem, &t_Jdq); - if (check_flag(flag, "ARKodeGetJacTime")) { return 1; } + flag = MRIStepGetJacTime(arkode_mem, &t_Jdq); + if (check_flag(flag, "MRIStepGetJacTime")) { 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); - ARKodeFree(&inner_arkode_mem); - ARKodeFree(&arkode_mem); + ARKStepFree(&inner_arkode_mem); + MRIStepFree(&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 7fdb34daf2..6ea963f176 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 = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } /* Set stop time */ - flag = ARKodeSetStopTime(arkode_mem, Tf); - if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = ARKStepSetStopTime(arkode_mem, Tf); + if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } /* Set max steps before output */ - flag = ARKodeSetMaxNumSteps(arkode_mem, mxsteps); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKStepSetMaxNumSteps(arkode_mem, mxsteps); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 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 = ARKodeEvolve(arkode_mem, Tf, y, &tret, ARK_NORMAL); + flag = ARKStepEvolve(arkode_mem, Tf, y, &tret, ARK_NORMAL); /* check for errors */ if (flag < 0) { - fprintf(stderr, "ARKodeEvolve failure, flag = %d\n", flag); + fprintf(stderr, "ARKStep failure, flag = %d\n", flag); return 1; } /* get some integrator stats */ - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); printf("Explicit stats:\n"); printf("Steps = %li (attempted = %li)\n\n", nst, nst_a); /* Free integrator memory */ - ARKodeFree(&arkode_mem); + ARKStepFree(&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 = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } /* Set stop time */ - flag = ARKodeSetStopTime(arkode_mem, Tf); - if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = ARKStepSetStopTime(arkode_mem, Tf); + if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } /* Set max steps before output */ - flag = ARKodeSetMaxNumSteps(arkode_mem, mxsteps); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKStepSetMaxNumSteps(arkode_mem, mxsteps); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } /* Attach matrix and linear solver */ - flag = ARKodeSetLinearSolver(arkode_mem, LS, A); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, A); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } /* Set Jacobian routine */ - flag = ARKodeSetJacFn(arkode_mem, Jac); - if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } + flag = ARKStepSetJacFn(arkode_mem, Jac); + if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } /* Specify linearly implicit RHS, with non-time-dependent Jacobian */ - flag = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 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 = ARKodeEvolve(arkode_mem, Tf, y, &tret, ARK_NORMAL); + flag = ARKStepEvolve(arkode_mem, Tf, y, &tret, ARK_NORMAL); /* check for errors */ if (flag < 0) { - fprintf(stderr, "ARKodeEvolve failure, flag = %d\n", flag); + fprintf(stderr, "ARKStep failure, flag = %d\n", flag); return 1; } /* get some integrator stats */ - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); printf("Implicit stats:\n"); printf("Steps = %li (attempted = %li)\n\n", nst, nst_a); /* Free integrator memory */ - ARKodeFree(&arkode_mem); + ARKStepFree(&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 = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } /* Set stop time */ - flag = ARKodeSetStopTime(arkode_mem, Tf); - if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = ARKStepSetStopTime(arkode_mem, Tf); + if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } /* Set max steps before output */ - flag = ARKodeSetMaxNumSteps(arkode_mem, mxsteps); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKStepSetMaxNumSteps(arkode_mem, mxsteps); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } /* Attach matrix and linear solver */ - flag = ARKodeSetLinearSolver(arkode_mem, LS, A); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, A); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } /* Set Jacobian routine */ - flag = ARKodeSetJacFn(arkode_mem, Jac); - if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } + flag = ARKStepSetJacFn(arkode_mem, Jac); + if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } /* Specify linearly implicit RHS, with non-time-dependent Jacobian */ - flag = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 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 = ARKodeEvolve(arkode_mem, Tf, y, &tret, ARK_NORMAL); + flag = ARKStepEvolve(arkode_mem, Tf, y, &tret, ARK_NORMAL); /* check for errors */ if (flag < 0) { - fprintf(stderr, "ARKodeEvolve failure, flag = %d\n", flag); + fprintf(stderr, "ARKStep failure, flag = %d\n", flag); return 1; } /* get some integrator stats */ - flag = ARKodeGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKStepGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKodeGetNumStepAttempts", 1); + flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKStepGetNumStepAttempts", 1); printf("IMEX stats:\n"); printf("Steps = %li (attempted = %li)\n\n", nst, nst_a); /* Free integrator memory */ - ARKodeFree(&arkode_mem); + ARKStepFree(&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 25c5de6982..1f57ea41fd 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 = ARKodeSetUserData(arkode_mem, &udata_in); + retval = ARKStepSetUserData(arkode_mem, &udata_in); if (retval) { - fprintf(stderr, "ARKodeSetUserData returned %i\n", retval); + fprintf(stderr, "ARKStepSetUserData returned %i\n", retval); return 1; } /* Get user data */ - retval = ARKodeGetUserData(arkode_mem, &udata_out); + retval = ARKStepGetUserData(arkode_mem, &udata_out); if (retval) { - fprintf(stderr, "ARKodeGetUserData returned %i\n", retval); + fprintf(stderr, "ARKStepGetUserData returned %i\n", retval); return 1; } @@ -104,7 +104,7 @@ int main(int argc, char* argv[]) udata_out = NULL; /* Free integrator memory */ - ARKodeFree(&arkode_mem); + ARKStepFree(&arkode_mem); /* ------------ * * Test ERKStep * @@ -119,18 +119,18 @@ int main(int argc, char* argv[]) } /* Set user data */ - retval = ARKodeSetUserData(arkode_mem, &udata_in); + retval = ERKStepSetUserData(arkode_mem, &udata_in); if (retval) { - fprintf(stderr, "ARKodeSetUserData returned %i\n", retval); + fprintf(stderr, "ERKStepSetUserData returned %i\n", retval); return 1; } /* Get user data */ - retval = ARKodeGetUserData(arkode_mem, &udata_out); + retval = ERKStepGetUserData(arkode_mem, &udata_out); if (retval) { - fprintf(stderr, "ARKodeGetUserData returned %i\n", retval); + fprintf(stderr, "ERKStepGetUserData returned %i\n", retval); return 1; } @@ -150,7 +150,7 @@ int main(int argc, char* argv[]) udata_out = NULL; /* Free integrator memory */ - ARKodeFree(&arkode_mem); + ERKStepFree(&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, "MRIStepCreate returned NULL\n"); + fprintf(stderr, "ARKStepCreate returned NULL\n"); return 1; } /* Set user data */ - retval = ARKodeSetUserData(arkode_mem, &udata_in); + retval = MRIStepSetUserData(arkode_mem, &udata_in); if (retval) { - fprintf(stderr, "ARKodeSetUserData returned %i\n", retval); + fprintf(stderr, "ARKStepSetUserData returned %i\n", retval); return 1; } /* Get user data */ - retval = ARKodeGetUserData(arkode_mem, &udata_out); + retval = MRIStepGetUserData(arkode_mem, &udata_out); if (retval) { - fprintf(stderr, "ARKodeGetUserData returned %i\n", retval); + fprintf(stderr, "ARKStepGetUserData returned %i\n", retval); return 1; } @@ -212,8 +212,8 @@ int main(int argc, char* argv[]) udata_out = NULL; /* Free integrator memory */ - ARKodeFree(&arkode_mem); - ARKodeFree(&arkode_inner_mem); + MRIStepFree(&arkode_mem); + ARKStepFree(&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 7e16e77946..315f819089 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) -static int ode_slow_rhs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +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 @@ static int ode_slow_rhs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_dat return 0; } -static int fast_evolve(MRIStepInnerStepper fast_mem, sunrealtype t0, - sunrealtype tf, N_Vector y) +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); @@ -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 = ARKodeSetFixedStep(arkode_mem, SUN_RCONST(0.01)); + flag = MRIStepSetFixedStep(arkode_mem, SUN_RCONST(0.01)); if (flag) { return 1; } - flag = ARKodeSetInterpolantType(arkode_mem, ARK_INTERP_HERMITE); + flag = MRIStepSetInterpolantType(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 = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); - printf("ARKodeEvolve returned %i\n", arkode_flag); + arkode_flag = MRIStepEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + printf("MRIStepEvolve returned %i\n", arkode_flag); if (arkode_flag != ARK_RHSFUNC_FAIL) { return 1; } /* ----------------------- @@ -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 = ARKodeSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE); + flag = MRIStepSetInterpolantType(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 = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); - printf("ARKodeEvolve returned %i\n", arkode_flag); + arkode_flag = MRIStepEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + printf("MRIStepEvolve 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); - ARKodeFree(&arkode_mem); + MRIStepFree(&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 00eff80a35..88d0636954 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 = ARKodeSetUserData(arkode_mem, &lambda); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(arkode_mem, &lambda); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } /* select Hermite interpolation module */ - flag = ARKodeSetInterpolantType(arkode_mem, ARK_INTERP_HERMITE); - if (check_flag(&flag, "ARKodeSetInterpolantType", 1)) { return 1; } + flag = ARKStepSetInterpolantType(arkode_mem, ARK_INTERP_HERMITE); + if (check_flag(&flag, "ARKStepSetInterpolantType", 1)) { return 1; } /* set dense output polynomial degree */ - flag = ARKodeSetInterpolantDegree(arkode_mem, ideg); - if (check_flag(&flag, "ARKodeSetInterpolantDegree", 1)) { return 1; } + flag = ARKStepSetInterpolantDegree(arkode_mem, ideg); + if (check_flag(&flag, "ARKStepSetInterpolantDegree", 1)) { return 1; } /* set fixed time-stepping with desired time step size */ - flag = ARKodeSetFixedStep(arkode_mem, hvals[ih]); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = ARKStepSetFixedStep(arkode_mem, hvals[ih]); + if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } /* set solver tolerances */ - flag = ARKodeSStolerances(arkode_mem, rtol, atol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkode_mem, rtol, atol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } /* indicate linearity of problem */ - flag = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } /* attach linear solver */ - flag = ARKodeSetLinearSolver(arkode_mem, LS, A); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, A); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } /* increase maximum number of time steps */ - flag = ARKodeSetMaxNumSteps(arkode_mem, 100000); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKStepSetMaxNumSteps(arkode_mem, 100000); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } /* set RK order to highest available value */ - flag = ARKodeSetOrder(arkode_mem, 5); - if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } + flag = ARKStepSetOrder(arkode_mem, 5); + if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } /* evolve to Tf to prepare interpolation structure */ - 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; } + 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; } /* 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 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; } + /* 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; } /* set error values */ /* y */ @@ -318,8 +318,8 @@ int main(int argc, char* argv[]) } /* end itest loop */ - /* free ARKode memory (to prepare for next call) */ - ARKodeFree(&arkode_mem); + /* free ARKStep memory (to prepare for next call) */ + ARKStepFree(&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 = ARKodeSetUserData(arkode_mem, &lambda); - if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKStepSetUserData(arkode_mem, &lambda); + if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } /* select Lagrange interpolation module */ - flag = ARKodeSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE); - if (check_flag(&flag, "ARKodeSetInterpolantType", 1)) { return 1; } + flag = ARKStepSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE); + if (check_flag(&flag, "ARKStepSetInterpolantType", 1)) { return 1; } /* set dense output polynomial degree */ - flag = ARKodeSetInterpolantDegree(arkode_mem, ideg); - if (check_flag(&flag, "ARKodeSetInterpolantDegree", 1)) { return 1; } + flag = ARKStepSetInterpolantDegree(arkode_mem, ideg); + if (check_flag(&flag, "ARKStepSetInterpolantDegree", 1)) { return 1; } /* set fixed time-stepping with desired time step size */ - flag = ARKodeSetFixedStep(arkode_mem, hvals[ih]); - if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = ARKStepSetFixedStep(arkode_mem, hvals[ih]); + if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } /* set solver tolerances */ - flag = ARKodeSStolerances(arkode_mem, rtol, atol); - if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKStepSStolerances(arkode_mem, rtol, atol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } /* indicate linearity of problem */ - flag = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKStepSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } /* attach linear solver */ - flag = ARKodeSetLinearSolver(arkode_mem, LS, A); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKStepSetLinearSolver(arkode_mem, LS, A); + if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } /* increase maximum number of time steps */ - flag = ARKodeSetMaxNumSteps(arkode_mem, 100000); - if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKStepSetMaxNumSteps(arkode_mem, 100000); + if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } /* set RK order to highest available value */ - flag = ARKodeSetOrder(arkode_mem, 5); - if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } + flag = ARKStepSetOrder(arkode_mem, 5); + if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } /* evolve to Tf to prepare interpolation structure */ - 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; } + 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; } /* 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 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; } + /* 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; } /* set error values */ /* y */ @@ -525,8 +525,8 @@ int main(int argc, char* argv[]) } /* end itest loop */ - /* free ARKode memory (to prepare for next call) */ - ARKodeFree(&arkode_mem); + /* free ARKStep memory (to prepare for next call) */ + ARKStepFree(&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 d50eed86c0..586028cd1c 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_mass.c +++ b/test/unit_tests/arkode/C_serial/ark_test_mass.c @@ -92,9 +92,8 @@ static int check_retval(void* flagvalue, const char* funcname, int opt) return 0; } -static int solve(const char* im, const char* ex, int steps, - sunbooleantype time_dep, sunbooleantype deduce_implicit_rhs, - long int expected_mass_solves) +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; @@ -132,57 +131,57 @@ static int solve(const char* im, const char* ex, int steps, retval = ARKStepSetTableName(arkode_mem, im, ex); if (check_retval(&retval, "ARKStepSetTableNum", 1)) return 1; - retval = ARKodeSetUserData(arkode_mem, &time_dep); - if (check_retval(&retval, "ARKodeSetUserData", 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 = ARKodeSetInitStep(arkode_mem, 0.01); - if (check_retval(&retval, "ARKodeSetInitStep", 1)) return 1; + 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 = ARKodeSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE); - if (check_retval(&retval, "ARKodeSetInterpolantType", 1)) return 1; + 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 = ARKodeSetLinearSolver(arkode_mem, jacobian_ls, jacobian_mat); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) 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 = ARKodeSetMassLinearSolver(arkode_mem, mass_ls, mass_mat, time_dep); - if (check_retval(&retval, "ARKodeSetMassLinearSolver", 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 = ARKodeSetDeduceImplicitRhs(arkode_mem, deduce_implicit_rhs); - if (check_retval(&retval, "ARKodeSetDeduceImplicitRhs", 1)) 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 = ARKodeSetJacFn(arkode_mem, NULL); - if (check_retval(&retval, "ARKodeSetJacFn", 1)) return 1; + retval = ARKStepSetJacFn(arkode_mem, NULL); + if (check_retval(&retval, "ARKStepSetJacFn", 1)) return 1; - retval = ARKodeSetMassFn(arkode_mem, mass); - if (check_retval(&retval, "ARKodeSetMassFn", 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 = ARKodeEvolve(arkode_mem, t, y, &t, ARK_ONE_STEP); - if (check_retval(&retval, "ARKodeEvolve", 1)) return 1; + retval = ARKStepEvolve(arkode_mem, t, y, &t, ARK_ONE_STEP); + if (check_retval(&retval, "ARKStepEvolve", 1)) return 1; } - retval = ARKodeGetNumMassSolves(arkode_mem, &actual_mass_solves); - if (check_retval(&retval, "ARKodeGetNumMassSolves", 1)) return 1; + retval = ARKStepGetNumMassSolves(arkode_mem, &actual_mass_solves); + if (check_retval(&retval, "ARKStepGetNumMassSolves", 1)) return 1; /* Free integrator memory */ - ARKodeFree(&arkode_mem); + ARKStepFree(&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 445850399f..529c2879cd 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_reset.c +++ b/test/unit_tests/arkode/C_serial/ark_test_reset.c @@ -11,7 +11,8 @@ * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End *--------------------------------------------------------------- - * Routine to test that ARKodeReset functions correctly. + * Routine to test that ARKStepReset, ERKStepReset and + * MRIStepReset function correctly. * * This runs the same test problem as in * examples/arkode/C_serial/ark_analytic.c: @@ -106,199 +107,196 @@ 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 = 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); + 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); /* Initially evolve to dTout, and check result */ - 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; } + 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; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Initial ARKodeEvolve had insufficient accuracy\n"); + printf(" Initial ERKStepEvolve 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 ARKodeEvolve call successful\n"); } + else { printf(" Initial ERKStepEvolve 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 = 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; } + 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; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Second ARKodeEvolve call had insufficient accuracy\n"); + printf(" Second ERKStepEvolve 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 ARKodeEvolve call successful\n"); } + else { printf(" Second ERKStepEvolve 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 = 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; } + 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; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Third ARKodeEvolve call had insufficient accuracy\n"); + printf(" Third ERKStepEvolve 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 ARKodeEvolve call successful\n"); } + else { printf(" Third ERKStepEvolve 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 = 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; } + 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; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Fourth ARKodeEvolve call had insufficient accuracy\n"); + printf(" Fourth ERKStepEvolve 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 ARKodeEvolve call successful\n"); } + else { printf(" Fourth ERKStepEvolve call successful\n"); } /* Free ERKStep memory structure */ - ARKodeFree(&arkode_mem); + ERKStepFree(&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 = 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); + 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); /* 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; } + retval = ARKStepEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKStepEvolve", 1)) { return 1; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Initial ARKodeEvolve had insufficient accuracy\n"); + printf(" Initial ARKStepEvolve 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 ARKodeEvolve call successful\n"); } + else { printf(" Initial ARKStepEvolve 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 = 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; } + 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; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Second ARKodeEvolve call had insufficient accuracy\n"); + printf(" Second ARKStepEvolve 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 ARKodeEvolve call successful\n"); } + else { printf(" Second ARKStepEvolve 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 = 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; } + 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; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Third ARKodeEvolve call had insufficient accuracy\n"); + printf(" Third ARKStepEvolve 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 ARKodeEvolve call successful\n"); } + else { printf(" Third ARKStepEvolve 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 = 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; } + 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; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Fourth ARKodeEvolve call had insufficient accuracy\n"); + printf(" Fourth ARKStepEvolve 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 ARKodeEvolve call successful\n"); } + else { printf(" Fourth ARKStepEvolve call successful\n"); } /* Free ARKStep memory structure */ - ARKodeFree(&arkode_mem); + ARKStepFree(&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 = ARKodeSStolerances(arkode_mem, rtol, atol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } - retval = ARKodeSetMaxNumSteps(arkode_mem, 100); - check_retval(&retval, "ARKodeSetMaxNumSteps", 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 = ARKStepCreateMRIStepInnerStepper(arkode_mem, &inner_stepper); if (check_retval(&retval, "ARKStepCreateMRIStepInnerStepper", 1)) { @@ -306,91 +304,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 = 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); + 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); /* 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; } + retval = MRIStepEvolve(mristep_mem, t + dTout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "MRIStepEvolve", 1)) { return 1; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Initial ARKodeEvolve had insufficient accuracy\n"); + printf(" Initial MRIStepEvolve 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 ARKodeEvolve call successful\n"); } + else { printf(" Initial MRIStepEvolve 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 = 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; } + 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; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Second ARKodeEvolve call had insufficient accuracy\n"); + printf(" Second MRIStepEvolve 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 ARKodeEvolve call successful\n"); } + else { printf(" Second MRIStepEvolve 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 = 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; } + 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; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Third ARKodeEvolve call had insufficient accuracy\n"); + printf(" Third MRIStepEvolve 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 ARKodeEvolve call successful\n"); } + else { printf(" Third MRIStepEvolve 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 = 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; } + 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; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Fourth ARKodeEvolve call had insufficient accuracy\n"); + printf(" Fourth MRIStepEvolve 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 ARKodeEvolve call successful\n"); } + else { printf(" Fourth MRIStepEvolve call successful\n"); } /* Free MRIStep and ARKStep memory structures */ - ARKodeFree(&mristep_mem); + MRIStepFree(&mristep_mem); MRIStepInnerStepper_Free(&inner_stepper); - ARKodeFree(&arkode_mem); + ARKStepFree(&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 80cb6b9e2f..7e952e8a42 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_tstop.c +++ b/test/unit_tests/arkode/C_serial/ark_test_tstop.c @@ -33,16 +33,15 @@ #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) -static int ode_rhs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +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; } -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) +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; @@ -93,7 +92,7 @@ int main(int argc, char* argv[]) arkode_mem = ARKStepCreate(NULL, ode_rhs, ZERO, y, sunctx); if (!arkode_mem) { return 1; } - flag = ARKodeSStolerances(arkode_mem, SUN_RCONST(1.0e-4), SUN_RCONST(1.0e-8)); + flag = ARKStepSStolerances(arkode_mem, SUN_RCONST(1.0e-4), SUN_RCONST(1.0e-8)); if (flag) { return 1; } A = SUNDenseMatrix(1, 1, sunctx); @@ -102,16 +101,16 @@ int main(int argc, char* argv[]) LS = SUNLinSol_Dense(y, A, sunctx); if (!LS) { return 1; } - flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + flag = ARKStepSetLinearSolver(arkode_mem, LS, A); if (flag) { return 1; } - flag = ARKodeSetJacFn(arkode_mem, ode_jac); + flag = ARKStepSetJacFn(arkode_mem, ode_jac); if (flag) { return 1; } - flag = ARKodeSetOrder(arkode_mem, 2); + flag = ARKStepSetOrder(arkode_mem, 2); if (flag) { return 1; } - flag = ARKodeSetStopTime(arkode_mem, tstop); + flag = ARKStepSetStopTime(arkode_mem, tstop); if (flag) { return 1; } /* --------------- @@ -124,14 +123,14 @@ int main(int argc, char* argv[]) for (i = 1; i <= 6; i++) { - arkode_flag = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + arkode_flag = ARKStepEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); if (arkode_flag < 0) { flag = 1; break; } - flag = ARKodeGetCurrentTime(arkode_mem, &tcur); + flag = ARKStepGetCurrentTime(arkode_mem, &tcur); if (flag) { break; } printf("%i: tout = %" GSYM ", tstop = %" GSYM ", tret = %" GSYM @@ -158,7 +157,7 @@ int main(int argc, char* argv[]) /* Update stop time */ tstop += dt_tstop; - flag = ARKodeSetStopTime(arkode_mem, tstop); + flag = ARKStepSetStopTime(arkode_mem, tstop); if (flag) { break; } } @@ -174,7 +173,7 @@ int main(int argc, char* argv[]) /* Update stop time */ tstop += dt_tstop; - flag = ARKodeSetStopTime(arkode_mem, tstop); + flag = ARKStepSetStopTime(arkode_mem, tstop); if (flag) { break; } } @@ -218,7 +217,7 @@ int main(int argc, char* argv[]) * Clean up * -------- */ - ARKodeFree(&arkode_mem); + ARKStepFree(&arkode_mem); N_VDestroy(y); SUNMatDestroy(A); SUNLinSolFree(LS); 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 ab06dfa929..55ef49d612 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 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 96099d427f..44bfcc9c5c 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); - ARKodeFree(&arkode_mem); + ARKStepFree(&arkode_mem); } void* arkode_mem; @@ -70,7 +70,7 @@ TEST_F(ARKodeErrConditionTest, ErrorIsPrinted) { SUNLogger_SetErrorFilename(logger, errfile.c_str()); // negative reltol is illegal - ARKodeSStolerances(arkode_mem, /* reltol= */ -1e-4, /* abstol= */ 1e-4); + ARKStepSStolerances(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]"), 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 4475159260..b671ad3911 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) ] * ---------------------------------------------------------------------------*/ -static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +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 @@ static 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) ] * ---------------------------------------------------------------------------*/ -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) +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 @@ static int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, // ----------------------------------------------------------------------------- // Check function return flag -static int check_flag(int flag, const std::string funcname) +int check_flag(int flag, const std::string funcname) { if (!flag) { return 0; } if (flag < 0) { std::cerr << "ERROR: "; } @@ -155,7 +155,7 @@ static int check_flag(int flag, const std::string funcname) } // Check if a function returned a NULL pointer -static int check_ptr(void* ptr, const std::string funcname) +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 1a0675efbb..e4d8cd1884 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 -static int check_flag(int flag, const string funcname) +int check_flag(int flag, const string funcname) { if (!flag) { return 0; } if (flag < 0) { cerr << "ERROR: "; } @@ -138,7 +138,7 @@ static int check_flag(int flag, const string funcname) } // Check if a function returned a NULL pointer -static int check_ptr(void* ptr, const string funcname) +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 -static void InputHelp() +void InputHelp() { cout << endl; cout << "Command line options:" << endl; @@ -217,7 +217,7 @@ static void InputHelp() cout << " --nout : number of outputs\n"; } -static int ReadInputs(vector<string>& args, TestOptions& opts, SUNContext ctx) +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 f8809e2c19..33a5a2bcc6 100644 --- a/test/unit_tests/cvode/C_serial/cv_test_tstop.c +++ b/test/unit_tests/cvode/C_serial/cv_test_tstop.c @@ -33,16 +33,15 @@ #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) -static int ode_rhs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +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; } -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) +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 df16114295..997358abdb 100644 --- a/test/unit_tests/cvode/gtest/CMakeLists.txt +++ b/test/unit_tests/cvode/gtest/CMakeLists.txt @@ -20,17 +20,12 @@ 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 6c26d1bf3d..0b805b419b 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) ] * ---------------------------------------------------------------------------*/ -static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +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 @@ static 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) ] * ---------------------------------------------------------------------------*/ -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) +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 @@ static int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, // ----------------------------------------------------------------------------- // Check function return flag -static int check_flag(int flag, const std::string funcname) +int check_flag(int flag, const std::string funcname) { if (!flag) { return 0; } if (flag < 0) { std::cerr << "ERROR: "; } @@ -154,7 +154,7 @@ static int check_flag(int flag, const std::string funcname) } // Check if a function returned a NULL pointer -static int check_ptr(void* ptr, const std::string funcname) +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 6142b566c9..a669dd9b1b 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 -static int check_flag(int flag, const string funcname) +int check_flag(int flag, const string funcname) { if (!flag) { return 0; } if (flag < 0) { cerr << "ERROR: "; } @@ -138,7 +138,7 @@ static int check_flag(int flag, const string funcname) } // Check if a function returned a NULL pointer -static int check_ptr(void* ptr, const string funcname) +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 -static void InputHelp() +void InputHelp() { cout << endl; cout << "Command line options:" << endl; @@ -217,7 +217,7 @@ static void InputHelp() cout << " --nout : number of outputs\n"; } -static int ReadInputs(vector<string>& args, TestOptions& opts, SUNContext ctx) +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 ede859ef67..a465618540 100644 --- a/test/unit_tests/cvodes/C_serial/cvs_test_tstop.c +++ b/test/unit_tests/cvodes/C_serial/cvs_test_tstop.c @@ -33,16 +33,15 @@ #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) -static int ode_rhs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +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; } -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) +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 aa372836e3..72e2b48b25 100644 --- a/test/unit_tests/ida/CXX_serial/ida_test_getjac.cpp +++ b/test/unit_tests/ida/CXX_serial/ida_test_getjac.cpp @@ -105,8 +105,7 @@ 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 * ---------------------------------------------------------------------------*/ -static int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector res, - void* user_data) +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]; @@ -138,9 +137,8 @@ static int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector res, * [2 a u - 2 u' - 2 cj u 2 b v ] * [2 c u 2 d v - 2 v' - 2 cj v ] * ---------------------------------------------------------------------------*/ -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) +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]; @@ -169,8 +167,8 @@ static int J(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, // Custom linear solver solve function // ----------------------------------------------------------------------------- -static int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, sunrealtype tol) +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); @@ -198,7 +196,7 @@ static int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, // ----------------------------------------------------------------------------- // Check function return flag -static int check_flag(int flag, const std::string funcname) +int check_flag(int flag, const std::string funcname) { if (!flag) { return 0; } if (flag < 0) { std::cerr << "ERROR: "; } @@ -208,7 +206,7 @@ static int check_flag(int flag, const std::string funcname) } // Check if a function returned a NULL pointer -static int check_ptr(void* ptr, const std::string funcname) +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 b7088929e3..ab5573b882 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 -static int check_flag(int flag, const string funcname) +int check_flag(int flag, const string funcname) { if (!flag) { return 0; } if (flag < 0) { cerr << "ERROR: "; } @@ -132,7 +132,7 @@ static int check_flag(int flag, const string funcname) } // Check if a function returned a NULL pointer -static int check_ptr(void* ptr, const string funcname) +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 -static void InputHelp() +void InputHelp() { cout << endl; cout << "Command line options:" << endl; @@ -205,7 +205,7 @@ static void InputHelp() cout << " --nout : number of outputs\n"; } -static int ReadInputs(vector<string>& args, TestOptions& opts, SUNContext ctx) +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 27fffde375..180fe263a8 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) -static int dae_res(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector res, - void* user_data) +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 @@ static int dae_res(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector res, return 0; } -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) +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 0775840110..7c50f7f5da 100644 --- a/test/unit_tests/idas/CXX_serial/idas_test_getjac.cpp +++ b/test/unit_tests/idas/CXX_serial/idas_test_getjac.cpp @@ -105,8 +105,7 @@ 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 * ---------------------------------------------------------------------------*/ -static int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector res, - void* user_data) +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]; @@ -138,9 +137,8 @@ static int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector res, * [2 a u - 2 u' - 2 cj u 2 b v ] * [2 c u 2 d v - 2 v' - 2 cj v ] * ---------------------------------------------------------------------------*/ -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) +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]; @@ -169,8 +167,8 @@ static int J(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, // Custom linear solver solve function // ----------------------------------------------------------------------------- -static int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, sunrealtype tol) +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); @@ -198,7 +196,7 @@ static int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, // ----------------------------------------------------------------------------- // Check function return flag -static int check_flag(int flag, const std::string funcname) +int check_flag(int flag, const std::string funcname) { if (!flag) { return 0; } if (flag < 0) { std::cerr << "ERROR: "; } @@ -208,7 +206,7 @@ static int check_flag(int flag, const std::string funcname) } // Check if a function returned a NULL pointer -static int check_ptr(void* ptr, const std::string funcname) +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 95f91c331d..2860e2e511 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 -static int check_flag(int flag, const string funcname) +int check_flag(int flag, const string funcname) { if (!flag) { return 0; } if (flag < 0) { cerr << "ERROR: "; } @@ -132,7 +132,7 @@ static int check_flag(int flag, const string funcname) } // Check if a function returned a NULL pointer -static int check_ptr(void* ptr, const string funcname) +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 -static void InputHelp() +void InputHelp() { cout << endl; cout << "Command line options:" << endl; @@ -205,7 +205,7 @@ static void InputHelp() cout << " --nout : number of outputs\n"; } -static int ReadInputs(vector<string>& args, TestOptions& opts, SUNContext ctx) +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 3303a390a8..b647c9fd8e 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) -static int dae_res(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector res, - void* user_data) +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 @@ static int dae_res(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector res, return 0; } -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) +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 cb3abe9da2..67185076a6 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 * ---------------------------------------------------------------------------*/ -static int res(N_Vector uu, N_Vector fuu, void* user_data) +int res(N_Vector uu, N_Vector fuu, void* user_data) { /* Get vector data arrays */ sunrealtype* udata = N_VGetArrayPointer(uu); @@ -108,8 +108,8 @@ static int res(N_Vector uu, N_Vector fuu, void* user_data) * [ exp(-x(y-1))(1-y) -exp(-x(y-1))x 20 ] * ---------------------------------------------------------------------------*/ -static int J(N_Vector uu, N_Vector fuu, SUNMatrix J, void* user_data, - N_Vector tmp1, N_Vector tmp2) +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 @@ static int J(N_Vector uu, N_Vector fuu, SUNMatrix J, void* user_data, // Custom linear solver solve function // ----------------------------------------------------------------------------- -static int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, sunrealtype tol) +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 @@ static int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, // ----------------------------------------------------------------------------- // Check function return flag -static int check_flag(int flag, const std::string funcname) +int check_flag(int flag, const std::string funcname) { if (!flag) { return 0; } if (flag < 0) { std::cerr << "ERROR: "; } @@ -179,7 +179,7 @@ static int check_flag(int flag, const std::string funcname) } // Check if a function returned a NULL pointer -static int check_ptr(void* ptr, const std::string funcname) +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 0db4c3e101..8b4bcfc820 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" -static int sleep(SUNProfiler prof, int sec, double* chrono) +int sleep(SUNProfiler prof, int sec, double* chrono) { auto begin = std::chrono::steady_clock::now(); @@ -43,7 +43,7 @@ static int sleep(SUNProfiler prof, int sec, double* chrono) return 0; } -static int print_timings(SUNProfiler prof) +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 bda983b0dc..4e7601def4 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; -static int testPlusWithInts() +int testPlusWithInts() { const std::string testStr = "Running testPlusWithInts"; @@ -41,7 +41,7 @@ static int testPlusWithInts() return !pass; } -static int testPlusWithDoubles() +int testPlusWithDoubles() { const std::string testStr = "Running testPlusWithDoubles"; @@ -60,7 +60,7 @@ static int testPlusWithDoubles() return !pass; } -static int testMaximumWithInts() +int testMaximumWithInts() { const std::string testStr = "Running testMaximumWithInts"; @@ -83,7 +83,7 @@ static int testMaximumWithInts() return !pass; } -static int testMaximumWithDoubles() +int testMaximumWithDoubles() { const std::string testStr = "Running testMaximumWithDoubles"; @@ -106,7 +106,7 @@ static int testMaximumWithDoubles() return !pass; } -static int testMinimumWithInts() +int testMinimumWithInts() { const std::string testStr = "Running testMinimumWithInts"; @@ -129,7 +129,7 @@ static int testMinimumWithInts() return !pass; } -static int testMinimumWithDoubles() +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 2abba4d927..4fab019e00 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> -static int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, - bool print_test_status) +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 9d57384fcc..4df2e660f7 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> -static std::string dumpstderr(SUNContext sunctx, const std::string& errfile) +std::string dumpstderr(SUNContext sunctx, const std::string& errfile) { SUNLogger logger = NULL; SUNContext_GetLogger(sunctx, &logger);