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/operator splitting #572

Open
wants to merge 209 commits into
base: feature/sunstepper
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 137 commits
Commits
Show all changes
209 commits
Select commit Hold shift + click to select a range
5f8ff59
Initial commit after rebase
Steven-Roberts Aug 12, 2024
dadf074
Merge branch 'develop' into feature/operator-splitting
Steven-Roberts Aug 12, 2024
9603515
Bug fixes for coefficients
Steven-Roberts Aug 16, 2024
8d95da0
Merge branch 'develop' into feature/operator-splitting
Steven-Roberts Aug 16, 2024
4e39e52
Finish splitting coefficient tests
Steven-Roberts Aug 20, 2024
280d369
Add mathematical description to docs
Steven-Roberts Aug 20, 2024
663a7ae
Add missing execution policy files
Steven-Roberts Aug 20, 2024
8e5c5f0
Template SplittingStep docs
Steven-Roberts Aug 20, 2024
fd1fc7b
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Aug 20, 2024
bede6b5
Rename to SplittingStepCoefficients
Steven-Roberts Aug 22, 2024
3c0d6ff
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Aug 22, 2024
19724c5
Finish ADR example
Steven-Roberts Aug 28, 2024
ac92708
Finish ADR example
Steven-Roberts Aug 28, 2024
d72be79
Add another example
Steven-Roberts Sep 1, 2024
cb039ea
Add 3rd order Suzuki method
Steven-Roberts Sep 1, 2024
08ba24b
3rd order Suzuki bug fix
Steven-Roberts Sep 1, 2024
eacb38e
Add skeleton docs
Steven-Roberts Sep 2, 2024
3ad9763
Add missing CMake file
Steven-Roberts Sep 2, 2024
24de70f
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Sep 2, 2024
a77f989
Finish coefficient docs
Steven-Roberts Sep 3, 2024
082e5ee
Clear up execution policy structure
Steven-Roberts Sep 3, 2024
a3dfce7
Make helper function for default integrator
Steven-Roberts Sep 3, 2024
2255ff8
Add splitting step comments
Steven-Roberts Sep 3, 2024
4a7bd60
Comments in analytic splitting example
Steven-Roberts Sep 3, 2024
b812411
Fix default coefficients bug
Steven-Roberts Sep 3, 2024
9e93ffe
Add docs for execution policy
Steven-Roberts Sep 3, 2024
4267f4a
Add coefficient ids to docs
Steven-Roberts Sep 3, 2024
fe44bdf
Apply formatter
Steven-Roberts Sep 4, 2024
1485fc4
Bring over forced splitting method
Steven-Roberts Sep 4, 2024
7bd615c
Add cli to ark analytic partitioned
Steven-Roberts Sep 5, 2024
61ff2be
Simplify setter freeing
Steven-Roberts Sep 5, 2024
18da846
Add doc on default coefficients
Steven-Roberts Sep 5, 2024
239d75a
Finish first draft of user callable
Steven-Roberts Sep 5, 2024
3b76690
Fix coefficient docs warnings
Steven-Roberts Sep 5, 2024
5164e7d
Update changelogs
Steven-Roberts Sep 5, 2024
9eda8e1
Polish math section
Steven-Roberts Sep 5, 2024
1c40071
Polish splitting step docs
Steven-Roberts Sep 5, 2024
9387de0
Add ForcingStep math docs
Steven-Roberts Sep 5, 2024
e881650
Add forcingstep to doc index
Steven-Roberts Sep 5, 2024
c40dda3
Fix tspan in comments
Steven-Roberts Sep 5, 2024
ce71f14
Align printfs
Steven-Roberts Sep 5, 2024
cf2aad2
Add ForcingStep docs
Steven-Roberts Sep 5, 2024
2d48c74
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Sep 5, 2024
6a41a5c
Raise error if not using fixed dt
Steven-Roberts Sep 6, 2024
b38d1d2
Add function to set step direction
Steven-Roberts Sep 6, 2024
653ffe9
Make invalid order a warning
Steven-Roberts Sep 6, 2024
10db02b
Add getter and setter for step direction
Steven-Roberts Sep 11, 2024
5417f85
Finish splittingstep test
Steven-Roberts Sep 12, 2024
42e5a60
Add logging messages
Steven-Roberts Sep 12, 2024
419c5b8
Make per partitions evolve stats
Steven-Roberts Sep 12, 2024
9f5c77a
Switch to output argument style
Steven-Roberts Sep 12, 2024
ac2e830
Clean up forcingstep
Steven-Roberts Sep 12, 2024
bfb298f
Add missing comments to execution policy
Steven-Roberts Sep 12, 2024
2d1558b
Add a parallel method to test
Steven-Roberts Sep 12, 2024
277cf11
Fix copy size
Steven-Roberts Sep 12, 2024
e471a2c
Remove todo
Steven-Roberts Sep 12, 2024
be43b2e
Remove todo
Steven-Roberts Sep 12, 2024
d332da3
Disable single precision for some tests
Steven-Roberts Sep 12, 2024
f30bf90
Fix interp degree
Steven-Roberts Sep 12, 2024
ce4adfa
Fix tests for non-double precision
Steven-Roberts Sep 12, 2024
1d589a8
Add comments to step direction functions
Steven-Roberts Sep 12, 2024
12da914
Correct comment times
Steven-Roberts Sep 12, 2024
1f2c7c5
Add ARKodeGetStepDirection docs
Steven-Roberts Sep 12, 2024
626318a
Add step dir functions to changelog
Steven-Roberts Sep 12, 2024
49d5bd6
Add SplittingStep_GetNumEvolves docs
Steven-Roberts Sep 12, 2024
486a91d
Add ForcingStep_GetNumEvolves docs
Steven-Roberts Sep 12, 2024
769552f
Code cleanup
Steven-Roberts Sep 12, 2024
1eb6166
Add forcingstep unit test
Steven-Roberts Sep 12, 2024
f2f80a3
Apply formatter
Steven-Roberts Sep 12, 2024
06354df
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Sep 13, 2024
59bf685
Add splittingstep test output file
Steven-Roberts Sep 13, 2024
4990a3b
Add splittingstep test output file
Steven-Roberts Sep 13, 2024
d5f3669
Add missing getter
Steven-Roberts Sep 13, 2024
dbf86d4
Improve skipping of evolves
Steven-Roberts Sep 13, 2024
5a5b5b2
Fix step direction for fixed step
Steven-Roberts Sep 13, 2024
00c518d
Add example output files
Steven-Roberts Sep 13, 2024
6051370
Apply formatter
Steven-Roberts Sep 13, 2024
e935dfa
Remove parallel exec policies for now
Steven-Roberts Sep 13, 2024
459297b
Rename splitting coefficients files
Steven-Roberts Sep 13, 2024
3f1a50d
Add new header files to docs
Steven-Roberts Sep 13, 2024
0e92844
Generate fortran interface
Steven-Roberts Sep 13, 2024
87e1e2e
Comment cleanup
Steven-Roberts Sep 13, 2024
0810067
Typo fixes
Steven-Roberts Sep 13, 2024
64614f8
Remove todos
Steven-Roberts Sep 13, 2024
ed889da
Fix copy paste error
Steven-Roberts Sep 13, 2024
6aefac9
Reword splittingstep method description
Steven-Roberts Sep 13, 2024
9a80256
Move partitions macro to header
Steven-Roberts Sep 13, 2024
6b33c4b
Replace with constant
Steven-Roberts Sep 13, 2024
45b7aee
Fix typo
Steven-Roberts Sep 13, 2024
8ac2486
Add missing newline
Steven-Roberts Sep 13, 2024
d7f0e7e
Add missing void argument for mac compilation
Steven-Roberts Sep 13, 2024
9e13ac7
Add missing void argument for mac compilation
Steven-Roberts Sep 13, 2024
79f737d
Add missing void argument for mac compilation
Steven-Roberts Sep 13, 2024
058dc2f
Format cmake files
Steven-Roberts Sep 13, 2024
3387de8
Fix conversion error
Steven-Roberts Sep 13, 2024
2a7cb93
Add missing file
Steven-Roberts Sep 13, 2024
e1771b5
SUNIpowerI docs cleanup
Steven-Roberts Sep 13, 2024
4d44c70
Apply suggestions from code review
Steven-Roberts Sep 17, 2024
24a6456
Add new modules to top of math considerations
Steven-Roberts Sep 18, 2024
cb770ed
Update changelog following @drreynolds suggestion
Steven-Roberts Sep 18, 2024
4c0d505
Clarify order in splittingstep description
Steven-Roberts Sep 18, 2024
512c600
Correct header file descriptions in docs
Steven-Roberts Sep 18, 2024
c5e8307
Merge branch 'feature/operator-splitting' of github.com:LLNL/sundials…
Steven-Roberts Sep 18, 2024
9257296
Typo fixes
Steven-Roberts Sep 18, 2024
5cbdab8
Switch ARKODE_SplittingCoefficientsID to enum in docs
Steven-Roberts Sep 18, 2024
1b7468d
Apply suggestions from code review
Steven-Roberts Sep 18, 2024
dc61278
Remove SplittingStepCreate todo
Steven-Roberts Sep 18, 2024
bc6b2af
Remove coefficient order todo
Steven-Roberts Sep 18, 2024
8fc99ed
Remove unnecessary includes
Steven-Roberts Sep 18, 2024
1b13066
Remove fixed step validation todo
Steven-Roberts Sep 18, 2024
8413ead
Merge branch 'feature/operator-splitting' of github.com:LLNL/sundials…
Steven-Roberts Sep 18, 2024
1629e58
Add inner stepper stats to partitioned analytic test problem
Steven-Roberts Sep 18, 2024
d61f268
Fix splitting step nvector check
Steven-Roberts Sep 18, 2024
eb3ad2a
Remove coefficients headed
Steven-Roberts Sep 18, 2024
2c615ab
Add reference for symmetric parallel method
Steven-Roberts Sep 18, 2024
b92266d
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Sep 18, 2024
808d20f
Update SUNStepper links
Steven-Roberts Sep 18, 2024
46693c5
Apply formatter
Steven-Roberts Sep 18, 2024
bee6565
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Sep 19, 2024
c83e15a
Make new ARKODE error for SUNStepper error
Steven-Roberts Sep 21, 2024
26ec38c
Update swig
Steven-Roberts Sep 21, 2024
5ba27fa
Fix typo
Steven-Roberts Sep 21, 2024
1d35b62
Remove execution policy following @drreynolds suggestion
Steven-Roberts Sep 21, 2024
75ee9d0
Fix ARK_SUNSTEPPER_ERR handling
Steven-Roberts Sep 26, 2024
a46c34f
Fix missing getstepdirection assignment in SUNStepper_Create
Steven-Roberts Sep 26, 2024
6712dd9
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Sep 28, 2024
cb975f4
Fix compilation errors after merge
Steven-Roberts Sep 28, 2024
47da090
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Sep 28, 2024
9d5d5f8
Fix remaining compilation errors
Steven-Roberts Sep 28, 2024
0984d3e
Apply formatter
Steven-Roberts Sep 28, 2024
2b43408
ERKStep works as a SUNStepper using in SplittingStep!
Steven-Roberts Sep 28, 2024
1d21f34
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Sep 28, 2024
32cc2af
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Sep 28, 2024
a192243
swig
Steven-Roberts Sep 28, 2024
aa1aff4
Reorder header for better diff
Steven-Roberts Sep 28, 2024
4fc99ad
Swig update
Steven-Roberts Sep 30, 2024
3daa9f5
Clear forcing after evolve
Steven-Roberts Oct 1, 2024
ce2a04e
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Oct 3, 2024
caeeaff
Post merge compilation fixes
Steven-Roberts Oct 3, 2024
831d884
Apply formatter
Steven-Roberts Oct 3, 2024
e2e0d31
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Oct 3, 2024
c52c645
Remove extra declaration in header
Steven-Roberts Oct 3, 2024
b970685
Remove old ARKStepCreateSUNStepper references
Steven-Roberts Oct 3, 2024
89b8334
Remove NV_Ith_S
Steven-Roberts Oct 3, 2024
7cd34e8
Switch to new :param: syntax
Steven-Roberts Oct 3, 2024
0c93424
Finish updates to new doc style
Steven-Roberts Oct 3, 2024
605266c
Switch to note and warning directive
Steven-Roberts Oct 3, 2024
c78a110
Remove return () syntax
Steven-Roberts Oct 8, 2024
b8af167
Simplify splittingStep_FullRHS
Steven-Roberts Oct 8, 2024
18ba8b2
Apply formatter
Steven-Roberts Oct 8, 2024
aaf5591
Fix error types in ARKodeGetStepDirection
Steven-Roberts Oct 8, 2024
377fe35
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Oct 8, 2024
de7334d
Use SUNAbortErrHandlerFn for unit tests
Steven-Roberts Oct 12, 2024
985ba5b
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Oct 22, 2024
76e9540
Reorder ARKODE modules alphabetically
Steven-Roberts Oct 22, 2024
2192cec
Document what SUNStepper operations are required
Steven-Roberts Oct 22, 2024
2837af2
Order ARKODE create functions alphabetically
Steven-Roberts Oct 22, 2024
8d6f6f9
SUNStepper docs on step direction
Steven-Roberts Oct 22, 2024
3e2e3bf
Order modules in math considerations section overview
Steven-Roberts Oct 22, 2024
55e6e24
Remove redundant step_supports_forcing flag
Steven-Roberts Oct 22, 2024
3c9e4b6
Fix whitespace in error output
Steven-Roberts Oct 23, 2024
5ab56b1
Remove unnecessary GetStepDirection functionality from SUNStepper
Steven-Roberts Oct 23, 2024
35f6f1d
Update swig
Steven-Roberts Oct 23, 2024
ec3e939
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Oct 28, 2024
121a8e6
Swig and formatter
Steven-Roberts Oct 28, 2024
838e681
Update custom stepper not to use evolve state as in-out argument
Steven-Roberts Oct 28, 2024
b34d3db
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Oct 28, 2024
dc433f3
Fix memory leak
Steven-Roberts Oct 29, 2024
7f6d183
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Oct 29, 2024
85e6275
Apply formatter
Steven-Roberts Oct 29, 2024
669daa0
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Oct 29, 2024
63043ee
Add setstepdirection back
Steven-Roberts Oct 29, 2024
b8a0055
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Oct 29, 2024
09bd9da
Add full RHS mode back
Steven-Roberts Oct 30, 2024
f09bce6
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Oct 31, 2024
9f02e89
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Nov 5, 2024
684a9ee
Fix error message for NULL stepper
Steven-Roberts Nov 5, 2024
8d1bf5f
Rename PARTITIONS to NUM_PARTITIONS
Steven-Roberts Nov 5, 2024
c509f7a
Add nodes on potential future optimizations
Steven-Roberts Nov 5, 2024
34b8e12
Apply formatter
Steven-Roberts Nov 5, 2024
f7978bd
Fix stage indexing in docs
Steven-Roberts Nov 12, 2024
1562d1b
Fix equation for parallel splitting
Steven-Roberts Nov 12, 2024
593df5e
Apply simple doc fixes from code review
Steven-Roberts Nov 12, 2024
2bac649
Merge branch 'feature/operator-splitting' of github.com:LLNL/sundials…
Steven-Roberts Nov 12, 2024
8ab2aa8
Apply simple src fixes
Steven-Roberts Nov 12, 2024
f2a73cd
Apply suggestions for PDE formulation comment
Steven-Roberts Nov 12, 2024
e61e6d2
Apply simple fixes for unit tests from code review
Steven-Roberts Nov 12, 2024
a410eaa
Merge branch 'feature/operator-splitting' of github.com:LLNL/sundials…
Steven-Roberts Nov 12, 2024
ab6c699
SplittingStepCoefficients_Free to SplittingStepCoefficients_Destroy
Steven-Roberts Nov 12, 2024
2b4a8e6
Move initialization of beta to avoid memory leak
Steven-Roberts Nov 12, 2024
b9d04ba
Make splittingstep skeleton not particular to ARKStep
Steven-Roberts Nov 12, 2024
7748696
Remove inner and outer terms
Steven-Roberts Nov 12, 2024
192cc48
Remove unnecessary headers
Steven-Roberts Nov 12, 2024
35dcc91
Merge branch 'feature/sunstepper' into feature/operator-splitting
Steven-Roberts Nov 13, 2024
4a93d50
Mention splitting and forcing method in SUNStepper docs
Steven-Roberts Nov 13, 2024
9ea4ef4
Update beta to be 1 indexed for stages
Steven-Roberts Nov 14, 2024
9848af8
Add Lie-Trotter and Strang examples to math considerations
Steven-Roberts Nov 14, 2024
1accd45
Remove inner and outer terms from docs
Steven-Roberts Nov 14, 2024
d05b9c2
Add missing subscripts to time step
Steven-Roberts Nov 14, 2024
d148f2e
Fix header level
Steven-Roberts Nov 14, 2024
0bc2b30
Move note for SplittingStepCoefficients_Write into param description
Steven-Roberts Nov 14, 2024
dab105a
Forward declare static functions in examples
Steven-Roberts Nov 14, 2024
fd75720
Remove const from examples
Steven-Roberts Nov 14, 2024
fea95c9
Clarify step sizes in analytic partitioned example
Steven-Roberts Nov 14, 2024
bba4fac
Use ERKStep for ark_analytic_partitioned example
Steven-Roberts Nov 14, 2024
7f862d3
Remove const from tests
Steven-Roberts Nov 14, 2024
85302fd
Remove const from forcingstep
Steven-Roberts Nov 14, 2024
f063740
Remove const from splittingstep
Steven-Roberts Nov 14, 2024
544f25a
Fix splittingstep failure after switching to ERKStep
Steven-Roberts Nov 14, 2024
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@

### Major Features

Added an operator splitting module, SplittingStep, and forcing method module,
ForcingStep, to ARKODE. These modules support a broad range of operator-split
time integration methods for multiphysics applications.

### New Features and Enhancements

Added the `ARKodeSetStepDirection` and `ARKodeGetStepDirection` functions to
change and query the direction of integration.

Added the `SUNStepper` base class to represent a generic solution procedure for
IVPs. This is used by the SplittingStep and ForcingStep modules of ARKODE. A
SUNStepper can be created from an ARKstep memory block with the new function
Expand Down
24 changes: 24 additions & 0 deletions doc/arkode/guide/source/Constants.rst
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,30 @@ contains the ARKODE output constants.
+-----------------------------------------------+------------------------------------------------------------+
| | |
+-----------------------------------------------+------------------------------------------------------------+
| **Splitting Coefficients specification** | |
+-----------------------------------------------+------------------------------------------------------------+
| :index:`ARKODE_SPLITTING_LIE_TROTTER_1_1_2` | 1st order Lie-Trotter splitting for problems with two |
| | partitions. |
+-----------------------------------------------+------------------------------------------------------------+
| :index:`ARKODE_SPLITTING_STRANG_2_2_2` | 2nd order Strang splitting for problems with two |
| | partitions. |
+-----------------------------------------------+------------------------------------------------------------+
| :index:`ARKODE_SPLITTING_BEST_2_2_2` | 2nd order splitting with optimal error for problems with |
| | two partitions. |
+-----------------------------------------------+------------------------------------------------------------+
| :index:`ARKODE_SPLITTING_SUZUKI_3_3_2` | 3rd order Suzuki splitting for problems with two |
| | partitions. |
+-----------------------------------------------+------------------------------------------------------------+
| :index:`ARKODE_SPLITTING_RUTH_3_3_2` | 3rd order Ruth splitting for problems with two partitions. |
+-----------------------------------------------+------------------------------------------------------------+
| :index:`ARKODE_SPLITTING_YOSHIDA_4_4_2` | 4th order Yoshida splitting for problems with two |
| | partitions. |
+-----------------------------------------------+------------------------------------------------------------+
| :index:`ARKODE_SPLITTING_YOSHIDA_8_6_2` | 6th order Yoshida splitting for problems with two |
gardner48 marked this conversation as resolved.
Show resolved Hide resolved
| | partitions. |
+-----------------------------------------------+------------------------------------------------------------+
| | |
+-----------------------------------------------+------------------------------------------------------------+
| **MRI method types** | |
+-----------------------------------------------+------------------------------------------------------------+
| :index:`MRISTEP_EXPLICIT` | Use an explicit (at the slow time scale) MRI method. |
Expand Down
120 changes: 113 additions & 7 deletions doc/arkode/guide/source/Mathematics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ for interpolated solution output. We then discuss the current suite
of time-stepping modules supplied with ARKODE, including the ARKStep
module for :ref:`additive Runge--Kutta methods <ARKODE.Mathematics.ARK>`,
the ERKStep module that is optimized for :ref:`explicit Runge--Kutta
methods <ARKODE.Mathematics.ERK>`, and the MRIStep module for :ref:`multirate
infinitesimal step (MIS), multirate infinitesimal GARK (MRI-GARK), and
implicit-explicit MRI-GARK (IMEX-MRI-GARK) methods <ARKODE.Mathematics.MRIStep>`.
We then discuss the :ref:`adaptive temporal error controllers
<ARKODE.Mathematics.Adaptivity>` shared by the time-stepping modules, including
discussion of our choice of norms for measuring errors within various components
of the solver.
methods <ARKODE.Mathematics.ERK>`, SplittingStep for :ref:`operator splitting
methods <ARKODE.Mathematics.SplittingStep>`, ForcingStep for :ref:`a forcing
method <ARKODE.Mathematics.ForcingStep>`, and the MRIStep module for
:ref:`multirate infinitesimal step (MIS), multirate infinitesimal GARK
(MRI-GARK), and implicit-explicit MRI-GARK (IMEX-MRI-GARK) methods
<ARKODE.Mathematics.MRIStep>`. We then discuss the :ref:`adaptive temporal error
controllers <ARKODE.Mathematics.Adaptivity>` shared by the time-stepping
modules, including discussion of our choice of norms for measuring errors within
various components of the solver.

We then discuss the nonlinear and linear solver strategies used by
ARKODE for solving implicit algebraic systems that arise in computing each
Expand Down Expand Up @@ -572,6 +574,110 @@ using a fixed time-step size.
.. The `ark_kepler.c` example demonstrates an implementation of such controller.


.. _ARKODE.Mathematics.SplittingStep:

SplittingStep -- Operator splitting methods
================================================

drreynolds marked this conversation as resolved.
Show resolved Hide resolved
The SplittingStep time-stepping module in ARKODE is designed for IVPs of the
form

.. math::
\dot{y} = f_1(t,y) + f_2(t,y) + \dots + f_P(t,y), \qquad y(t_0) = y_0,

with :math:`P > 1` additive partitions. Operator splitting methods, such as
those implemented in SplittingStep, allow each partition to be integrated
separately, possibly with different numerical integrators or exact solution
procedures. Coupling is only performed though initial conditions which are
passed from the flow of one partition to the next.

The following algorithmic procedure is used in the Splitting-Step module:

#. For :math:`i = 1, \dots, r` do:

#. Set :math:`y_{n, i} = y_{n - 1}`.

#. For :math:`j = 0, \dots, s` do:

#. For :math:`k = 1, \dots, P` do:

#. Let :math:`t_{\text{start}} = t_{n-1} + \beta_{i,j-1,k} h_n` and
:math:`t_{\text{end}} = t_{n-1} + \beta_{i,j,k} h_n`.

#. Let :math:`v(t_{\text{start}}) = y_{n,i}`.

#. For :math:`t \in [t_{\text{start}}, t_{\text{end}}]` solve
:math:`\dot{v} = f_{k}(t, v)`.

#. Set :math:`y_{n, i} = v(t_{\text{end}})`.

#. Set :math:`y_n = \sum_{i=1}^r \alpha_i y_{n,i}`

Here, :math:`s` denotes the number of stages, while :math:`r` denotes the number
of sequential methods within the overall operator splitting scheme. The
sequential methods have independent flows which are linearly combined to produce
the next step. The real coefficients :math:`\alpha_i` and :math:`\beta_{i,j,k}`
determine the particular scheme and properties such as the order of accuracy.

An alternative representation of the SplittingStep solution is

.. math::
y_n = \sum_{i=1}^P \alpha_i \left( \phi^P_{\gamma_{i,1,P} h} \circ
\phi^{P-1}_{\gamma_{i,1,P-1} h} \circ \dots \circ \phi^1_{\gamma_{i,1,1} h}
\circ \phi^P_{\gamma_{i,2,P} h} \circ \dots \circ \phi^P_{\gamma_{i,s,P} h}
\circ \dots \circ \phi^1_{\gamma_{i,s,1} h} \right),
(y_{n-1})

where :math:`\gamma_{i,j,k} = \beta_{i,j,k} - \beta_{i,j-1,k}` and
:math:`\phi^k_{h}` is the flow map for partition :math:`k`:

.. math::
\phi^k_{h}(y_{n_1}) = v(t_n),
\quad \begin{cases}
v(t_{n-1}) = y_{n-1}, \\ \dot{v} = f_k(t, v).
\end{cases}

SplittingStep provides standard operator splitting methods such as Lie-Trotter
and Strang splitting, as well as schemes of arbitrarily high order.
Alternatively, users may construct their own coefficients (see
:numref:`ARKODE.Usage.SplittingStep.SplittingStepCoefficients`). Generally,
methods of order three and higher with real coefficients require backward
integration, i.e., there exist negative :math:`\gamma_{i,j,k}` coefficients.
Currently, a fixed time step must be specified for the outer SplittingStep, but
inner integrators are free to use adaptive time steps.


.. _ARKODE.Mathematics.ForcingStep:

ForcingStep -- Forcing method
=============================

The ForcingStep time-stepping module in ARKODE is designed for IVPs of the form

.. math::
\dot{y} = f_1(t,y) + f_2(t,y), \qquad y(t_0) = y_0,

with two additive partitions. One step of the forcing method implemented in
ForcingStep is given by

.. math::
v_1(t_{n-1}) &= y_{n-1}, \\
\dot{v}_1 &= f_1(t, v_1), \\
f_1^* &= \frac{v_1(t_n) - y_{n-1}}{h_n}, \\
v_2(t_{n-1}) &= y_{n-1}, \\
\dot{v}_2 &= f_1^* + f_2(t, v_2), \\
y_n &= v_2(t_n).

Like a Lie-Trotter method from SplittingStep, the partitions are evolved through
a sequence of inner IVPs which can be solved with an arbitrary integrator or
exact solution procedure. However, the IVP for partition two includes a
"forcing" or "tendency" term :math:`f_1^*` to strengthen the coupling. This
coupling leads to a first order method provided :math:`v_1` and :math:`v_2` are
integrated to at least first order accuracy. Currently, a fixed time step must
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While Lie--Trotter and Strang splitting are well-known (so they don't really require citations), I am less familiar with these "forcing" methods (I'm guessing that you built this to support the "dribbling" approach from our climate collaborators?). It might be useful to provide a citation here for this type of method (and to support the claim that this is a first order method).

be specified for the outer ForcingStep, but inner integrators are free to use
adaptive time steps.


.. _ARKODE.Mathematics.MRIStep:

MRIStep -- Multirate infinitesimal step methods
Expand Down
114 changes: 114 additions & 0 deletions doc/arkode/guide/source/Usage/ForcingStep/User_callable.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
.. ----------------------------------------------------------------
Programmer(s): Steven B. Roberts @ LLNL
----------------------------------------------------------------
SUNDIALS Copyright Start
Copyright (c) 2002-2024, Lawrence Livermore National Security
and Southern Methodist University.
All rights reserved.

See the top-level LICENSE and NOTICE files for details.

SPDX-License-Identifier: BSD-3-Clause
SUNDIALS Copyright End
----------------------------------------------------------------

.. _ARKODE.Usage.ForcingStep.UserCallable:

ForcingStep User-callable functions
===================================

This section describes the ForcingStep-specific functions that may be called
by the user to setup and then solve an IVP using the ForcingStep time-stepping
module.

As discussed in the main :ref:`ARKODE user-callable function introduction
<ARKODE.Usage.UserCallable>`, each of ARKODE's time-stepping modules
clarifies the categories of user-callable functions that it supports.
ForcingStep does not support any of the categories beyond the functions that
apply for all time-stepping modules.


.. _ARKODE.Usage.ForcingStep.Initialization:

ForcingStep initialization functions
------------------------------------

.. c:function:: void* ForcingStepCreate(SUNStepper stepper1, SUNStepper stepper2, sunrealtype t0, N_Vector y0, SUNContext sunctx)

This function allocates and initializes memory for a problem to be solved
using the ForcingStep time-stepping module in ARKODE.

**Arguments:**
* *stepper1* -- a :c:type:`SUNStepper` to integrate partition one.
* *stepper2* -- a :c:type:`SUNStepper` to integrate partition two
including the forcing from partition one.
* *t0* -- the initial value of :math:`t`.
* *y0* -- the initial condition vector :math:`y(t_0)`.
* *sunctx* -- the :c:type:`SUNContext` object (see :numref:`SUNDIALS.SUNContext`)

**Return value:**
If successful, a pointer to initialized problem memory of type ``void*``,
to be passed to all user-facing ForcingStep routines listed below. If
unsuccessful, a ``NULL`` pointer will be returned, and an error message
will be printed to ``stderr``.

**Example usage:**

.. code-block:: C

/* inner ARKODE objects for integrating individual partitions */
void *partition_mem[] = {NULL, NULL};

/* SUNSteppers to wrap the inner ARKStep objects */
SUNStepper steppers[] = {NULL, NULL};

/* create ARKStep objects, setting right-hand side functions and the
initial condition */
partition_mem[0] = ARKStepCreate(fe1, fi1, t0, y0, sunctx);
partition_mem[1] = ARKStepCreate(fe2, fi2, t0, y0, sunctx);

/* setup ARKStep */
. . .

/* create SUNStepper wrappers for the ARKStep memory blocks */
flag = ARKStepCreateSUNStepper(partition_mem[0], &stepper[0]);
flag = ARKStepCreateSUNStepper(partition_mem[1], &stepper[1]);

/* create a ForcingStep object */
arkode_mem = ForcingStepCreate(steppers[0], steppers[1], t0, y0, sunctx);

**Example codes:**
* ``examples/arkode/C_serial/ark_analytic_partitioned.c``

.. versionadded:: x.y.z


.. _ARKODE.Usage.ForcingStep.OptionalOutputs:


Optional output functions
------------------------------

.. c:function:: int ForcingStep_GetNumEvolves(void* arkode_mem, int partition, long int *evolves)

Returns the number of times the :c:type:`SUNStepper` for the given partition
index has been evolved (so far).

**Arguments:**

* *arkode_mem* -- pointer to the ForcingStep memory block.

* *partition* -- index of the partition (0 or 1) or a negative number to
indicate the total number across both partitions.

* *evolves* -- number of :c:type:`SUNStepper` evolves.

**Return value:**

* *ARK_SUCCESS* if successful

* *ARK_MEM_NULL* if the ForcingStep memory was ``NULL``

* *ARK_ILL_INPUT* if *partition* was out of bounds

.. versionadded:: x.y.z
32 changes: 32 additions & 0 deletions doc/arkode/guide/source/Usage/ForcingStep/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.. ----------------------------------------------------------------
Programmer(s): Steven B. Roberts @ LLNL
----------------------------------------------------------------
SUNDIALS Copyright Start
Copyright (c) 2002-2024, Lawrence Livermore National Security
and Southern Methodist University.
All rights reserved.

See the top-level LICENSE and NOTICE files for details.

SPDX-License-Identifier: BSD-3-Clause
SUNDIALS Copyright End
----------------------------------------------------------------

.. _ARKODE.Usage.ForcingStep:

==========================================
Using the ForcingStep time-stepping module
==========================================

This section is concerned with the use of the ForcingStep time-stepping module
for the solution of initial value problems (IVPs) in a C or C++ language
setting. Usage of ForcingStep follows that of the rest of ARKODE, and so in
this section we primarily focus on those usage aspects that are specific to
ForcingStep. A skeleton of a program using ForcingStep follows essentially the
same structure as SplittingStep
(see :numref:`ARKODE.Usage.SplittingStep.Skeleton`).

.. toctree::
:maxdepth: 1

User_callable
12 changes: 7 additions & 5 deletions doc/arkode/guide/source/Usage/General.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ to the SUNDIALS core header file.

.. code:: c

#include <sundials/sundials_core.h> // Provides core SUNDIALS types
#include <arkode/arkode_erkstep.h> // ERKStep provides explicit RK methods.
#include <arkode/arkode_arkstep.h> // ARKStep provides explicit, implicit, IMEX additive RK methods.
#include <arkode/arkode_mristep.h> // MRIStep provides mutlirate RK methods.
#include <arkode/arkode_sprkstep.h> // SPRKStep provides symplectic partition RK methods.
#include <sundials/sundials_core.h> // Provides core SUNDIALS types
#include <arkode/arkode_arkstep.h> // ARKStep provides explicit, implicit, IMEX additive RK methods.
#include <arkode/arkode_erkstep.h> // ERKStep provides explicit RK methods.
#include <arkode/arkode_sprkstep.h> // SPRKStep provides symplectic partitioned RK methods.
#include <arkode/arkode_splittingstep.h> // SplittingStep provides operator splitting methods.
#include <arkode/arkode_forcingstep.h> // ForcingStep provides a forcing method.
#include <arkode/arkode_mristep.h> // MRIStep provides multirate RK methods.
drreynolds marked this conversation as resolved.
Show resolved Hide resolved

Each of these define several types and various constants, include function
prototypes, and include the shared ``arkode/arkode.h`` and
Expand Down
Loading
Loading