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

Feature/oo adaptivity #289

Closed
wants to merge 112 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
40e277e
Initial definition of SUNControl and SUNHeuristics classes
drreynolds Jun 9, 2023
a25a357
Initial implementation of SUNControl and SUNHeuristics classes
drreynolds Jun 9, 2023
e3e1885
Minor bugfixes
drreynolds Jun 9, 2023
9b5361c
Added fixed-step SUNControl implementation
drreynolds Jun 9, 2023
10cba38
Minor updates
drreynolds Jun 9, 2023
7d6f13d
Implementd PID controller
drreynolds Jun 12, 2023
c370132
Implemented PI controller
drreynolds Jun 12, 2023
0209365
Added missing Reset function
drreynolds Jun 12, 2023
525c5ff
Added missing Reset function
drreynolds Jun 12, 2023
4a6bdeb
Implemented I controller
drreynolds Jun 12, 2023
e6fa522
Implemented explicit Gustafsson controller
drreynolds Jun 12, 2023
8924cf4
Updated handling of 'pq' for adaptivity controllers
drreynolds Jun 12, 2023
5e24828
Implemented implicit and imex Gustafsson controllers
drreynolds Jun 12, 2023
1e986e0
Fixed return value of SUNControl 'SetParams' functions
drreynolds Jun 13, 2023
cca8653
Commenting update
drreynolds Jun 13, 2023
f495160
Removed implementation-specific 'destroy' functions, since top-level …
drreynolds Jun 13, 2023
e60ace6
Added missing 'return SUNCONTROL_SUCCESS' statements
drreynolds Jun 13, 2023
cb028ed
Fixed minor error
drreynolds Jun 13, 2023
52fd9d2
Added thorough comments on SUNControl objects to main sundials_contro…
drreynolds Jun 13, 2023
b031030
Initial draft of SUNHeuristics class, with default implementation
drreynolds Jun 13, 2023
5b1c40e
Initial draft of 'unconstrained' SUNHeuristics implementation
drreynolds Jun 13, 2023
24f5453
bugfixes in SUNControl implementations
drreynolds Jun 13, 2023
b6655cb
Initial integration of SUNControl and SUNHeuristics classes into ARKO…
drreynolds Jun 14, 2023
dddf0f9
Resoved build issues
drreynolds Jun 15, 2023
16f303c
Added missing return flag names
drreynolds Jun 15, 2023
ec400cd
Adjusted things to remove 'hmin' and 'hmax_inv' from ARKODE main memo…
drreynolds Jun 15, 2023
9cd352d
Removed 'fixed' SUNControl implementation, since fixed-step modes can…
drreynolds Jun 15, 2023
fbdfed7
Minor fix
drreynolds Jun 15, 2023
859770f
Added missing update to ark_mem->eta.
drreynolds Jun 16, 2023
f6d09da
Moved safety factor from SUNControl to SUNHeuristics
drreynolds Jun 16, 2023
8d8f48b
Added heuristics routine to enforce min/max bounds on first step; add…
drreynolds Jun 16, 2023
48724a0
Removed hmin,hmax compatibility checks from SUNHeuristicsSetMaxStep_D…
drreynolds Jun 16, 2023
42bd2b4
Fixed potential seg-fault if user calls *SetAdaptivityMethod with ada…
drreynolds Jun 16, 2023
7dd528a
Fixed typo
drreynolds Jun 16, 2023
a2c4464
Increased maximum CFL step size factor to ensure that it exceeds etamx1
drreynolds Jun 16, 2023
ca7cfe8
Fixed typos in Gustafsson controllers
drreynolds Jun 16, 2023
d32df6e
Minor cleanup
drreynolds Jun 16, 2023
851e809
Added missing update for previous step size
drreynolds Jun 16, 2023
67f39b5
Improved SUNControlWrite output
drreynolds Jun 16, 2023
c1b25d3
Improved SUNHeuristicsWrite output
drreynolds Jun 16, 2023
02d2e9c
Removed unused SUNHeuristicsFreeEmpty routine
drreynolds Jun 16, 2023
58b1bff
Added documentation on generic SUNControl and SUNHeuristics classes; …
drreynolds Jun 16, 2023
ea29a99
Initial draft of SUNControl and SUNHeuristics documentation
drreynolds Jun 18, 2023
7d2557e
Updated ARKODE documentation to note new SetController and SetHeurist…
drreynolds Jun 18, 2023
9ab1035
Added missing #includes
drreynolds Jun 18, 2023
0ea0d8d
Updated ARKODE examples that customize either heuristic or time step …
drreynolds Jun 19, 2023
f23fb09
Generated F2003 interfaces for SUNControl and SUNHeuristics modules; …
drreynolds Jun 19, 2023
ec0df0c
Updated swig and CMake files to enable F2003 examples to use new SUNC…
drreynolds Jun 19, 2023
fd5d5f3
Converged ark_analytic_f2003.f90 example to use new SUNControl API
drreynolds Jun 19, 2023
7c5ea8e
Merged changes in from develop
drreynolds Jun 19, 2023
4ece807
Update Fortran.rst
drreynolds Jun 20, 2023
31f1be6
Added SUNControl and SUNHeuristics documentation to the superbuild. …
drreynolds Jun 21, 2023
04d1446
Multiple minor fixes; updated ARKODE paper citation
drreynolds Jun 21, 2023
2dbea2f
Added 'dsm' (fast error estimate) to MRI controller definitions
drreynolds Jul 5, 2023
996c7da
Added 'Update' routines for controllers of type SUNDIALS_CONTROL_MRI_…
drreynolds Jul 5, 2023
6843166
Regenerated SWIG interfaces
drreynolds Jul 5, 2023
efa3c72
Merge branch 'develop' into feature/oo-adaptivity
gardner48 Sep 13, 2023
46495a4
post merge fix
gardner48 Sep 13, 2023
9c6ca6e
remove erroneous deprecation in docs
gardner48 Sep 13, 2023
43ed594
change dpreceated version to x.x.x
gardner48 Sep 13, 2023
49113f1
remvoe note, add versionadded
gardner48 Sep 13, 2023
65462a6
line wrap new doc files
gardner48 Sep 13, 2023
b940628
Merge branch 'develop' into feature/oo-adaptivity
gardner48 Sep 13, 2023
19ccd28
add caliper as needed to object libs
balos1 Sep 14, 2023
1988cbd
Merge remote-tracking branch 'origin/develop' into feature/oo-adaptivity
balos1 Sep 14, 2023
4d9041d
Fixed broken reference to ark_mem->hmin due to recent merge from develop
drreynolds Sep 15, 2023
1bd04a7
Fixed build issues (I'm guessing that this arose in a recent pull fro…
drreynolds Sep 15, 2023
fa3b082
Documentation updates to clarify correct usage of deprecated routines
drreynolds Sep 15, 2023
c32b734
Renamed SUNControl_ID to SUNControl_Type
drreynolds Sep 15, 2023
5297bfe
Added underscore between <class name> and <method> for generic methods
drreynolds Sep 15, 2023
7163f85
Regenerated F2003 interfaces
drreynolds Sep 15, 2023
fb58630
Update doc/shared/suncontrol/SUNControl_Description.rst
drreynolds Sep 15, 2023
5faf91f
Merge branch 'feature/oo-adaptivity' of github.com:LLNL/sundials into…
drreynolds Sep 15, 2023
03f38ad
Added integer return value to SUNControl_Destroy and SUNHeuristics_De…
drreynolds Sep 15, 2023
4fed64c
Fixed missing return values from non-void SUNControl_Destroy and SUNH…
drreynolds Sep 20, 2023
2525535
Fixed merge errors
drreynolds Sep 20, 2023
c79ef20
Renamed SUNControl to SUNAdaptController
drreynolds Sep 20, 2023
3d2cb13
Renamed SUNHeuristics to SUNTimestepHeuristics
drreynolds Sep 20, 2023
d139ad4
Implemented some of the changes requested in PR review
drreynolds Sep 20, 2023
d766b20
updated underscoring in SUNAdaptController implementations
drreynolds Sep 20, 2023
c72abc4
updated underscoring in SUNTimestepHeuristics implementations
drreynolds Sep 20, 2023
f725c39
Reverted ark_heat1D_adapt.c to continue using ARKStepSetAdaptivityMet…
drreynolds Sep 20, 2023
f777ffb
Removed default constructors for generic SUNAdaptController and SUNTi…
drreynolds Sep 20, 2023
b472601
Update src/arkode/arkode_io.c
drreynolds Sep 20, 2023
30a2106
Added changes requested in PR review
drreynolds Sep 20, 2023
4f88be5
Merge branch 'feature/oo-adaptivity' of github.com:LLNL/sundials into…
drreynolds Sep 20, 2023
7b1539f
Fixed underscoring in documentation for SUNAdaptController and SUNTim…
drreynolds Sep 20, 2023
5751880
Change the default 4th order ERK and DIRK methods to improve quality …
Steven-Roberts Sep 21, 2023
d61b586
Reorder so the default method is first
Steven-Roberts Sep 21, 2023
d4f2d67
Added ownership flags for SUNTimestepHeuristics and SUNAdaptControlle…
drreynolds Sep 21, 2023
31755a1
Added changes requested in PR review
drreynolds Sep 21, 2023
1a219c7
Regenerated SWIG interfaces
drreynolds Sep 21, 2023
a2127c0
Updated shared tarscript
drreynolds Sep 21, 2023
d942e1f
Fixed fmod/CMakeLists.txt to reference renamed controller/heuristics …
drreynolds Sep 21, 2023
0db3258
Fixed suncontrol->sunadaptcontroller and sunheuristics->suntimestephe…
drreynolds Sep 21, 2023
1b0588e
Set default 4th order ERK
Steven-Roberts Sep 21, 2023
4bdbdd7
Fixed a few missing sunheuristics->suntimestepheuristics changes
drreynolds Sep 21, 2023
e5dc744
Re-inserted leading underscores for hidden SUNTimestepAdaptivity and …
drreynolds Sep 21, 2023
fc7033c
regeneraged F2003 interfaces
drreynolds Sep 21, 2023
9cf9da0
Updated realtype -> sunrealtype in SUNAdaptController and SUNTimestep…
drreynolds Sep 22, 2023
7ab34e7
Regenerated F2003 interfaces
drreynolds Sep 22, 2023
7b5a6a1
Fixed typo
drreynolds Sep 22, 2023
2358138
update .out files
gardner48 Sep 22, 2023
af42e9b
update Fortran .out files
gardner48 Sep 22, 2023
54d9c4a
Add Sofroniou-Spaletta-ERK documentation
Steven-Roberts Sep 23, 2023
cf84a3e
Update changelog
Steven-Roberts Sep 27, 2023
b871bb0
Merged upstream changes from develop
drreynolds Sep 30, 2023
98b95c0
Fixed bug in backwards time integration
drreynolds Oct 2, 2023
8e4af3b
Fixed newly-introduced bug -- added default order adjustment of -1, b…
drreynolds Oct 4, 2023
2425293
Merge develop
Steven-Roberts Oct 4, 2023
e0797a0
Merge feature/default_order_4_ark into feature/oo-adaptivity
drreynolds Oct 5, 2023
f8d5419
move API descriptions to first section
gardner48 Oct 16, 2023
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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

## Changes to SUNDIALS in release X.X.X

Added `SUNAdaptController` and `SUNTimestepHeuristics` base classes. Ported
ARKODE's internal implementations of time step control and heuristic constraints
into implementations of these classes, and updated ARKODE to use these objects
instead of its own implementations. Added `ARKStepSetAdaptController`,
`ARKStepSetTimestepHeuristics`, `ERKStepSetAdaptController`, and
`ERKStepSetTimestepHeuristics` routines so that users can modify
controller/heuristic parameters, or even provide custom implementations.

Fixed a bug in `ARKStepSetTableNum` wherein it did not recognize `ARKODE_ARK2_ERK_3_1_2` and
`ARKODE_ARK2_DIRK_3_1_2` as a valid additive Runge--Kutta Butcher table pair.

Expand All @@ -13,6 +21,14 @@ Improved computational complexity of `SUNMatScaleAddI_Sparse` from `O(M*N)` to

Fixed scaling bug in `SUNMatScaleAddI_Sparse` for non-square matrices.

Changed the default fourth order DIRK method to `ARKODE_ARK436L2SA_DIRK_6_3_4`
for improved accuracy and embedded stability. To revert to the previous default,
use `ARKStepSetTableNum(arkode_mem, ARKODE_SDIRK_5_3_4, ARKODE_ERK_NONE)`.

Added the ERK method `ARKODE_SOFRONIOU_SPALETTA_5_3_4` which is now the default
fourth order ERK method. To revert to the previous default, use
`ERKStepSetTableNum(arkode_mem, ARKODE_ZONNEVELD_5_3_4)`.

Fixed missing soversions in some `SUNLinearSolver` CMake targets.

## Changes to SUNDIALS in release 6.6.1
Expand Down
8 changes: 8 additions & 0 deletions cmake/macros/SundialsAddLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ macro(sundials_add_library target)
if(SUNDIALS_RT_LIBRARY)
target_link_libraries(${obj_target} PRIVATE "${SUNDIALS_RT_LIBRARY}")
endif()
if(SUNDIALS_BUILD_WITH_PROFILING)
if(ENABLE_CALIPER)
target_link_libraries(${obj_target} PUBLIC caliper)
endif()
if(ENABLE_ADIAK)
target_link_libraries(${obj_target} PUBLIC adiak::adiak ${CMAKE_DL_LIBS})
endif()
endif()
if(sundials_add_library_LINK_LIBRARIES)
if(${_libtype} MATCHES "STATIC")
append_static_suffix(sundials_add_library_LINK_LIBRARIES _all_libs)
Expand Down
38 changes: 37 additions & 1 deletion doc/arkode/guide/source/Butcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,43 @@ This is the default 3th order slow and fast MRIStep method (from
Linear stability region for the Knoth-Wolke method


.. _Butcher.Sofroniou_Spaletta:

Sofroniou-Spaletta-5-3-4
^^^^^^^^^^^^^^^^^^^^^^^^

.. index:: Sofroniou-Spaletta-5-3-4 ERK method

Accessible via the constant ``ARKODE_SOFRONIOU_SPALETTA_5_3_4`` to
:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum`
or :c:func:`ARKodeButcherTable_LoadERK`.
Accessible via the string ``"ARKODE_SOFRONIOU_SPALETTA_5_3_4"`` to
:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or
:c:func:`ARKodeButcherTable_LoadERKByName`.
This is the default 4th order explicit method
(from :cite:p:`SoSp:04`).

.. math::

\renewcommand{\arraystretch}{1.5}
0 & 0 & 0 & 0 & 0 & 0 \\
\frac{2}{5} & \frac{2}{5} & 0 & 0 & 0 & 0 \\
\frac{3}{5} & -\frac{3}{20} & \frac{3}{4} & 0 & 0 & 0 \\
1 & \frac{19}{44} & -\frac{15}{44} & \frac{10}{11} & 0 & 0 \\
1 & \frac{11}{72} & \frac{25}{72} & \frac{25}{72} & \frac{11}{72} & 0 \\
4 & \frac{11}{72} & \frac{25}{72} & \frac{25}{72} & \frac{11}{72} & 0 \\
3 & \frac{1251515}{8970912} & \frac{3710105}{8970912} & \frac{2519695}{8970912} & \frac{61105}{8970912} & \frac{119041}{747576} \\
\end{array}

.. figure:: /figs/arkode/sofroniou_spaletta_erk_stab_region.png
:scale: 50 %
:align: center

Linear stability region for the Sofroniou-Spaletta method. The method's
region is outlined in blue; the embedding's region is in red.




.. _Butcher.Zonneveld:

Expand All @@ -345,7 +382,6 @@ or :c:func:`ARKodeButcherTable_LoadERK`.
Accessible via the string ``"ARKODE_ZONNEVELD_5_3_4"`` to
:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or
:c:func:`ARKodeButcherTable_LoadERKByName`.
This is the default 4th order explicit method
(from :cite:p:`Zon:63`).

.. math::
Expand Down
13 changes: 10 additions & 3 deletions doc/arkode/guide/source/Constants.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ contains the ARKODE output constants.
+-----------------------------------------------+------------------------------------------------------------+
| :index:`ARKODE_ARK324L2SA_ERK_4_2_3` | Use the ARK-4-2-3 ERK method. |
+-----------------------------------------------+------------------------------------------------------------+
| :index:`ARKODE_SOFRONIOU_SPALETTA_5_3_4` | Use the Sofroniou-Spaletta-5-3-4 ERK method. |
+-----------------------------------------------+------------------------------------------------------------+
| :index:`ARKODE_ZONNEVELD_5_3_4` | Use the Zonneveld-5-3-4 ERK method. |
+-----------------------------------------------+------------------------------------------------------------+
| :index:`ARKODE_ARK436L2SA_ERK_6_3_4` | Use the ARK-6-3-4 ERK method. |
Expand Down Expand Up @@ -111,7 +113,7 @@ contains the ARKODE output constants.
| | (ARKODE_BOGACKI_SHAMPINE_4_2_3). |
+-----------------------------------------------+------------------------------------------------------------+
| :index:`ARKSTEP_DEFAULT_ERK_4` | Use ARKStep's default fourth-order ERK method |
| | (ARKODE_ZONNEVELD_5_3_4). |
| | (ARKODE_SOFRONIOU_SPALETTA_5_3_4). |
+-----------------------------------------------+------------------------------------------------------------+
| :index:`ARKSTEP_DEFAULT_ERK_5` | Use ARKStep's default fifth-order ERK method |
| | (ARKODE_CASH_KARP_6_4_5). |
Expand All @@ -129,7 +131,7 @@ contains the ARKODE output constants.
| | (ARKODE_BOGACKI_SHAMPINE_4_2_3). |
+-----------------------------------------------+------------------------------------------------------------+
| :index:`ERKSTEP_DEFAULT_4` | Use ERKStep's default fourth-order ERK method |
| | (ARKODE_ZONNEVELD_5_3_4). |
| | (ARKODE_SOFRONIOU_SPALETTA_5_3_4). |
+-----------------------------------------------+------------------------------------------------------------+
| :index:`ERKSTEP_DEFAULT_5` | Use ERKStep's default fifth-order ERK method |
| | (ARKODE_CASH_KARP_6_4_5). |
Expand Down Expand Up @@ -433,7 +435,7 @@ contains the ARKODE output constants.
+-------------------------------------+------+------------------------------------------------------------+
| :index:`ARK_INVALID_TABLE` | -41 | An invalid Butcher or MRI table was encountered. |
+-------------------------------------+------+------------------------------------------------------------+
| :index:`ARK_CONTEXT_ERR` | -42 | An error occurred with the SUNDIALS context object |
| :index:`ARK_CONTEXT_ERR` | -42 | An error with the SUNContext object was encountered. |
+-------------------------------------+------+------------------------------------------------------------+
| :index:`ARK_RELAX_FAIL` | -43 | An error occurred in computing the relaxation parameter |
+-------------------------------------+------+------------------------------------------------------------+
Expand All @@ -444,6 +446,11 @@ contains the ARKODE output constants.
| :index:`ARK_RELAX_JAC_FAIL` | -46 | The relaxation Jacobian function returned an unrecoverable |
| | | error |
+-------------------------------------+------+------------------------------------------------------------+
| :index:`ARK_CONTROLLER_ERR` | -47 | An error with a SUNAdaptController object was encountered. |
+-------------------------------------+------+------------------------------------------------------------+
| :index:`ARK_HEURISTICS_ERR` | -48 | An error with the SUNTimestepHeuristics object was |
| | | encountered. |
+-------------------------------------+------+------------------------------------------------------------+
| :index:`ARK_UNRECOGNIZED_ERROR` | -99 | An unknown error was encountered. |
+-------------------------------------+------+------------------------------------------------------------+
| |
Expand Down
17 changes: 17 additions & 0 deletions doc/arkode/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@ Changes from previous versions
Changes in vX.X.X
-----------------

Added :c:type:`SUNAdaptController` and :c:type:`SUNTimestepHeuristics` base classes.
Ported ARKODE's internal implementations of time step control and heuristic
constraints into implementations of these classes, and updated ARKODE to use
these objects instead of its own implementations. Added
:c:func:`ARKStepSetAdaptController`, :c:func:`ARKStepSetTimestepHeuristics`,
:c:func:`ERKStepSetAdaptController`, and :c:func:`ERKStepSetTimestepHeuristics`
routines so that users can modify controller/heuristic parameters, or even provide
custom implementations.

Fixed a bug in :c:func:`ARKStepSetTableNum` wherein it did not recognize
`ARKODE_ARK2_ERK_3_1_2` and `ARKODE_ARK2_DIRK_3_1_2` as a valid additive
Runge--Kutta Butcher table pair.
Expand All @@ -144,6 +153,14 @@ Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices.

Fixed missing soversions in some ``SUNLinearSolver`` CMake targets.

Changed the default fourth order DIRK method to `ARKODE_ARK436L2SA_DIRK_6_3_4`
for improved accuracy and embedded stability. To revert to the previous default,
use `ARKStepSetTableNum(arkode_mem, ARKODE_SDIRK_5_3_4, ARKODE_ERK_NONE)`.

Added the ERK method `ARKODE_SOFRONIOU_SPALETTA_5_3_4` which is now the default
fourth order ERK method. To revert to the previous default, use
`ERKStepSetTableNum(arkode_mem, ARKODE_ZONNEVELD_5_3_4)`.

Changes in v5.6.1
-----------------

Expand Down
Loading
Loading