Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arkode-fullrhs #293

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ Updated the F2003 utility routines `SUNDIALSFileOpen` and `SUNDIALSFileClose`
to support user specification of `stdout` and `stderr` strings for the output
file names.

Updated main ARKODE infrastructure so that the time-stepping module `fullrhs` routine,
and the `MRIStepInnerFullRhsFn` for MRIStep are optional. These may still be
required based on integrator usage, including: use of the internal initial time step
size selection algorithm, use of the Hermite interpolation module, use of temporal
root-finding, use of the now-deprecated "bootstrap" predictor method (see
`MRIStepSetPredictorMethod` and `ARKStepSetPredictorMethod`). When `fullrhs`
is not in fact required, one vector of ARKODE storage (the size of the IVP solution)
is left unallocated.

## Changes to SUNDIALS in release 6.5.1

Added the functions `ARKStepClearStopTime`, `ERKStepClearStopTime`,
Expand Down
9 changes: 9 additions & 0 deletions doc/arkode/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,15 @@ Updated the F2003 utility routines :c:func:`SUNDIALSFileOpen` and :c:func:`SUNDI
to support user specification of ``stdout`` and ``stderr`` strings for the output
file names.

Updated main ARKODE infrastructure so that the time-stepping module `fullrhs` routine,
and the :c:type:`MRIStepInnerFullRhsFn` for MRIStep are optional. These may still be
required based on integrator usage, including: use of the internal initial time step
size selection algorithm, use of the Hermite interpolation module, use of temporal
root-finding, use of the now-deprecated "bootstrap" predictor method (see
:c:func:`MRIStepSetPredictorMethod` and :c:func:`ARKStepSetPredictorMethod`). When
`fullrhs` is not in fact required, one vector of ARKODE storage (the size of the IVP
solution) is left unallocated.

Changes in v5.5.1
-----------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,12 @@ member functions:
* ``examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp``


Optional Member Functions
"""""""""""""""""""""""""

An :c:type:`MRIStepInnerStepper` *may* provide implementations of any of the
following member functions:

.. c:type:: int (*MRIStepInnerFullRhsFn)(MRIStepInnerStepper stepper, realtype t, N_Vector v, N_Vector f, int mode)

This function computes the full right-hand side function of the inner (fast)
Expand Down Expand Up @@ -393,11 +399,16 @@ member functions:
**Example codes:**
* ``examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp``

Optional Member Functions
"""""""""""""""""""""""""
.. note::

This function will instead be required by MRIStep if: the Hermite interpolation
module is used, the user requests temporal root-finding, or the user requests the
now-deprecated "bootstrap" predictor method (see :c:func:`MRIStepSetPredictorMethod`).
drreynolds marked this conversation as resolved.
Show resolved Hide resolved

.. versionchanged:: 5.6.0

This function was made optional

An :c:type:`MRIStepInnerStepper` *may* provide implementations of any of the
following member functions:

.. c:type:: int (*MRIStepInnerResetFn)(MRIStepInnerStepper stepper, realtype tR, N_Vector vR)

Expand Down
2 changes: 2 additions & 0 deletions examples/arkode/C_serial/ark_analytic.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ int main()
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); /* Lagrange interpolant */
if (check_flag(&flag, "ARKStepSetInterpolantType", 1)) return 1;

/* Initialize dense matrix data structure and solver */
A = SUNDenseMatrix(NEQ, NEQ, ctx);
Expand Down
2 changes: 2 additions & 0 deletions examples/arkode/C_serial/ark_analytic_mels.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ int main()
if (check_retval(&retval, "ARKStepSetUserData", 1)) return 1;
retval = ARKStepSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */
if (check_retval(&retval, "ARKStepSStolerances", 1)) return 1;
retval = ARKStepSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE); /* Lagrange interpolant */
if (check_retval(&retval, "ARKStepSetInterpolantType", 1)) return 1;

/* Initialize custom matrix-embedded linear solver */
LS = MatrixEmbeddedLS(arkode_mem, ctx);
Expand Down
4 changes: 4 additions & 0 deletions examples/arkode/C_serial/ark_analytic_nonlin.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ int main()
flag = ERKStepSStolerances(arkode_mem, reltol, abstol);
if (check_flag(&flag, "ERKStepSStolerances", 1)) return 1;

/* Set Lagrange interpolation module */
flag = ERKStepSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE);
if (check_flag(&flag, "ERKStepSetInterpolantType", 1)) return 1;

/* Open output stream for results, output comment line */
UFID = fopen("solution.txt","w");
fprintf(UFID,"# t u\n");
Expand Down
10 changes: 5 additions & 5 deletions examples/arkode/C_serial/ark_analytic_nonlin.out
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ Analytical ODE test problem:
t u
---------------------
1.000000 0.916291
2.000000 1.609437
3.000000 2.140066
4.000000 2.564949
2.000000 1.609435
3.000000 2.140064
4.000000 2.564948
5.000000 2.917770
6.000000 3.218876
7.000000 3.481240
7.000000 3.481239
8.000000 3.713572
9.000000 3.921973
10.000000 4.110874
10.000000 4.110873
---------------------

Final Statistics:
Expand Down
2 changes: 2 additions & 0 deletions examples/arkode/C_serial/ark_brusselator1D.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ int main()
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); /* Lagrange interpolant */
if (check_flag(&flag, "ARKStepSetInterpolantType", 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);
Expand Down
148 changes: 74 additions & 74 deletions examples/arkode/C_serial/ark_brusselator1D.out
Original file line number Diff line number Diff line change
Expand Up @@ -8,105 +8,105 @@
t ||u||_rms ||v||_rms ||w||_rms
----------------------------------------------
0.100000 0.673914 3.377329 1.999987
0.200000 0.684316 3.356619 1.999987
0.200000 0.684316 3.356619 1.999986
0.300000 0.695306 3.334633 1.999986
0.400000 0.706918 3.311313 1.999986
0.500000 0.719185 3.286601 1.999986
0.500000 0.719184 3.286601 1.999986
0.600000 0.732137 3.260442 1.999986
0.700000 0.745798 3.232787 1.999985
0.800000 0.760185 3.203596 1.999985
0.900000 0.775303 3.172839 1.999985
1.000000 0.791135 3.140510 1.999984
1.100000 0.807648 3.106624 1.999984
1.200000 0.824771 3.071233 1.999984
1.300000 0.842402 3.034426 1.999983
1.400000 0.860384 2.996350 1.999983
1.500000 0.878514 2.957206 1.999983
1.600000 0.896525 2.917266 1.999982
1.700000 0.914089 2.876873 1.999982
1.800000 0.930823 2.836438 1.999982
1.900000 0.946292 2.796446 1.999982
2.000000 0.960033 2.757430 1.999981
2.100000 0.971576 2.719962 1.999981
2.200000 0.980475 2.684623 1.999981
2.300000 0.986338 2.651980 1.999981
2.400000 0.988852 2.622560 1.999981
2.500000 0.987815 2.596818 1.999981
2.600000 0.983141 2.575128 1.999981
2.700000 0.974858 2.557766 1.999981
2.800000 0.963114 2.544903 1.999981
2.900000 0.948154 2.536611 1.999981
3.000000 0.930299 2.532868 1.999982
3.100000 0.909930 2.533567 1.999982
3.200000 0.887464 2.538529 1.999983
3.300000 0.863335 2.547515 1.999983
3.400000 0.837978 2.560241 1.999983
3.500000 0.811818 2.576391 1.999984
3.600000 0.785255 2.595624 1.999984
3.700000 0.758659 2.617587 1.999985
3.800000 0.732363 2.641922 1.999986
3.900000 0.706662 2.668274 1.999986
4.000000 0.681809 2.696300 1.999986
4.100000 0.658012 2.725670 1.999987
4.200000 0.635435 2.756075 1.999987
4.300000 0.614205 2.787228 1.999988
4.400000 0.594404 2.818869 1.999988
4.500000 0.576082 2.850764 1.999989
4.600000 0.559255 2.882710 1.999989
4.700000 0.543909 2.914529 1.999989
0.700000 0.745795 3.232790 1.999985
0.800000 0.760184 3.203596 1.999985
0.900000 0.775294 3.172847 1.999985
1.000000 0.791132 3.140513 1.999984
1.100000 0.807633 3.106639 1.999984
1.200000 0.824765 3.071240 1.999984
1.300000 0.842379 3.034451 1.999983
1.400000 0.860372 2.996364 1.999983
1.500000 0.878491 2.957234 1.999983
1.600000 0.896508 2.917287 1.999982
1.700000 0.914081 2.876882 1.999982
1.800000 0.930808 2.836460 1.999982
1.900000 0.946289 2.796453 1.999982
2.000000 0.960031 2.757436 1.999981
2.100000 0.971579 2.719968 1.999981
2.200000 0.980482 2.684622 1.999981
2.300000 0.986339 2.651980 1.999981
2.400000 0.988870 2.622549 1.999981
2.500000 0.987832 2.596806 1.999981
2.600000 0.983142 2.575126 1.999981
2.700000 0.974875 2.557749 1.999981
2.800000 0.963129 2.544887 1.999981
2.900000 0.948160 2.536604 1.999981
3.000000 0.930300 2.532868 1.999982
3.100000 0.909935 2.533559 1.999982
3.200000 0.887466 2.538521 1.999983
3.300000 0.863335 2.547510 1.999983
3.400000 0.837978 2.560240 1.999983
3.500000 0.811817 2.576389 1.999984
3.600000 0.785252 2.595623 1.999984
3.700000 0.758655 2.617587 1.999985
3.800000 0.732361 2.641922 1.999986
3.900000 0.706662 2.668275 1.999986
4.000000 0.681805 2.696302 1.999986
4.100000 0.658007 2.725673 1.999987
4.200000 0.635432 2.756077 1.999987
4.300000 0.614204 2.787229 1.999988
4.400000 0.594402 2.818871 1.999988
4.500000 0.576079 2.850768 1.999989
4.600000 0.559252 2.882713 1.999989
4.700000 0.543908 2.914530 1.999989
4.800000 0.530011 2.946071 1.999990
4.900000 0.517506 2.977209 1.999990
5.000000 0.506326 3.007843 1.999990
5.100000 0.496394 3.037889 1.999990
5.200000 0.487626 3.067283 1.999990
5.300000 0.479935 3.095976 1.999991
5.400000 0.473237 3.123932 1.999991
5.500000 0.467445 3.151125 1.999991
4.900000 0.517504 2.977212 1.999990
5.000000 0.506325 3.007845 1.999990
5.100000 0.496393 3.037890 1.999990
5.200000 0.487625 3.067283 1.999990
5.300000 0.479935 3.095977 1.999991
5.400000 0.473237 3.123933 1.999991
5.500000 0.467446 3.151126 1.999991
5.600000 0.462480 3.177540 1.999991
5.700000 0.458264 3.203165 1.999991
5.800000 0.454726 3.227997 1.999991
5.900000 0.451800 3.252035 1.999991
5.800000 0.454726 3.227998 1.999991
5.900000 0.451800 3.252036 1.999991
6.000000 0.449425 3.275283 1.999991
6.100000 0.447546 3.297744 1.999991
6.200000 0.446115 3.319428 1.999991
6.300000 0.445086 3.340340 1.999991
6.400000 0.444419 3.360491 1.999991
6.400000 0.444419 3.360492 1.999991
6.500000 0.444079 3.379890 1.999991
6.600000 0.444034 3.398547 1.999991
6.600000 0.444034 3.398546 1.999991
6.700000 0.444257 3.416470 1.999991
6.800000 0.444722 3.433669 1.999991
6.800000 0.444723 3.433669 1.999991
6.900000 0.445409 3.450154 1.999991
7.000000 0.446297 3.465934 1.999991
7.100000 0.447370 3.481018 1.999991
7.100000 0.447371 3.481018 1.999991
7.200000 0.448614 3.495414 1.999991
7.300000 0.450016 3.509131 1.999991
7.300000 0.450017 3.509131 1.999991
7.400000 0.451564 3.522176 1.999991
7.500000 0.453249 3.534557 1.999991
7.500000 0.453250 3.534556 1.999991
7.600000 0.455064 3.546280 1.999991
7.700000 0.457000 3.557353 1.999991
7.700000 0.457001 3.557353 1.999991
7.800000 0.459052 3.567781 1.999991
7.900000 0.461216 3.577571 1.999991
8.000000 0.463486 3.586728 1.999991
8.100000 0.465860 3.595257 1.999991
8.200000 0.468335 3.603162 1.999991
8.300000 0.470909 3.610447 1.999991
8.300000 0.470910 3.610447 1.999991
8.400000 0.473582 3.617116 1.999991
8.500000 0.476352 3.623171 1.999991
8.600000 0.479220 3.628616 1.999991
8.500000 0.476353 3.623170 1.999991
8.600000 0.479221 3.628615 1.999991
8.700000 0.482186 3.633451 1.999991
8.800000 0.485250 3.637679 1.999990
8.900000 0.488416 3.641299 1.999990
9.000000 0.491684 3.644311 1.999990
9.100000 0.495058 3.646715 1.999990
9.200000 0.498540 3.648509 1.999990
9.300000 0.502134 3.649691 1.999990
9.400000 0.505844 3.650257 1.999990
9.500000 0.509675 3.650202 1.999990
8.800000 0.485252 3.637677 1.999990
8.900000 0.488417 3.641297 1.999990
9.000000 0.491685 3.644311 1.999990
9.100000 0.495059 3.646713 1.999990
9.200000 0.498541 3.648507 1.999990
9.300000 0.502134 3.649690 1.999990
9.400000 0.505845 3.650254 1.999990
9.500000 0.509676 3.650199 1.999990
9.600000 0.513632 3.649521 1.999990
9.700000 0.517722 3.648209 1.999990
9.800000 0.521951 3.646257 1.999990
9.900000 0.526326 3.643656 1.999990
10.000000 0.530857 3.640396 1.999990
9.700000 0.517724 3.648206 1.999990
9.800000 0.521953 3.646253 1.999990
9.900000 0.526327 3.643655 1.999990
10.000000 0.530859 3.640391 1.999990
----------------------------------------------

Final Solver Statistics:
Expand Down
8 changes: 8 additions & 0 deletions examples/arkode/C_serial/ark_brusselator1D_imexmri.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,10 @@ int main(int argc, char *argv[])
retval = ARKStepSetFixedStep(inner_arkode_mem, hf);
if (check_retval(&retval, "ARKStepSetFixedStep", 1)) return 1;

/* Set Lagrange interpolation type */
retval = ARKStepSetInterpolantType(inner_arkode_mem, ARK_INTERP_LAGRANGE);
if (check_retval(&retval, "ARKStepSetInterpolantType", 1)) return 1;

/* Create inner stepper */
retval = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem,
&inner_stepper);
Expand Down Expand Up @@ -648,6 +652,10 @@ int main(int argc, char *argv[])
retval = MRIStepSetMaxNumSteps(arkode_mem, 1000000);
if (check_retval(&retval, "MRIStepSetMaxNumSteps", 1)) return 1;

/* Set Lagrange interpolation type */
retval = MRIStepSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE);
if (check_retval(&retval, "MRIStepSetInterpolantType", 1)) return 1;

/*
* Integrate ODE
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Final Solver Statistics:
Slow Steps: nsts = 10001
Fast Steps: nstf = 120012
Total RHS evals: Fs = 30004, Ff = 994988
Total RHS evals: Fs = 30003, Ff = 864973
Fast Newton iters = 504937
Fast Newton conv fails = 0
Fast Jacobian evals = 2308
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Final Solver Statistics:
Slow Steps: nsts = 10001
Fast Steps: nstf = 120012
Total RHS evals: Fs = 68887, Ff = 400041
Total RHS evals: Fs = 68886, Ff = 360036
Slow Newton iters = 38883
Slow Newton conv fails = 0
Slow Jacobian evals = 501
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Final Solver Statistics:
Slow Steps: nsts = 10001
Fast Steps: nstf = 120012
Total RHS evals: Fs = 68887, Ff = 1000128
Total RHS evals: Fs = 68886, Ff = 840111
Slow Newton iters = 38883
Slow Newton conv fails = 0
Slow Jacobian evals = 501
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Final Solver Statistics:
Slow Steps: nsts = 10001
Fast Steps: nstf = 110011
Total RHS evals: Fse = 40005, Fsi = 78888, Ff = 370038
Total RHS evals: Fse = 40004, Fsi = 78887, Ff = 330033
Slow Newton iters = 38883
Slow Newton conv fails = 0
Slow Jacobian evals = 501
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Final Solver Statistics:
Slow Steps: nsts = 10001
Fast Steps: nstf = 110011
Total RHS evals: Fse = 40005, Fsi = 78888, Ff = 1174341
Total RHS evals: Fse = 40004, Fsi = 78887, Ff = 1024325
Slow Newton iters = 38883
Slow Newton conv fails = 0
Slow Jacobian evals = 501
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Final Solver Statistics:
Slow Steps: nsts = 10001
Fast Steps: nstf = 130013
Total RHS evals: Fse = 60007, Fsi = 118894, Ff = 580059
Total RHS evals: Fse = 60006, Fsi = 118893, Ff = 520052
Slow Newton iters = 58887
Slow Newton conv fails = 0
Slow Jacobian evals = 501
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Final Solver Statistics:
Slow Steps: nsts = 10001
Fast Steps: nstf = 130013
Total RHS evals: Fse = 60007, Fsi = 118894, Ff = 1946003
Total RHS evals: Fse = 60006, Fsi = 118893, Ff = 1885996
Slow Newton iters = 58887
Slow Newton conv fails = 0
Slow Jacobian evals = 501
Expand Down
2 changes: 2 additions & 0 deletions examples/arkode/C_serial/ark_brusselator1D_klu.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ int main()
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); /* Lagrange interpolation */
if (check_flag(&flag, "ARKStepSetInterpolantType", 1)) return 1;

/* Initialize sparse matrix data structure and KLU solver */
NNZ = 5*NEQ;
Expand Down
Loading
Loading