Skip to content

Commit

Permalink
Merge ../develop into feature/oo-adaptivity2
Browse files Browse the repository at this point in the history
  • Loading branch information
drreynolds committed Oct 26, 2023
2 parents 4ac5928 + 6ae281e commit 6866662
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Fixed scaling bug in `SUNMatScaleAddI_Sparse` for non-square matrices.
Fixed missing soversions in some `SUNLinearSolver` and `SUNNonlinearSolver`
CMake targets.

Added the fourth order ERK method `ARKODE_SOFRONIOU_SPALETTA_5_3_4`.

## Changes to SUNDIALS in release 6.6.1

Updated the Tpetra NVector interface to support Trilinos 14.
Expand Down
37 changes: 37 additions & 0 deletions 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`.
(from :cite:p:`Sof:04`).

.. math::
\renewcommand{\arraystretch}{1.5}
\begin{array}{r|ccccc}
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 Down
2 changes: 2 additions & 0 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
2 changes: 2 additions & 0 deletions doc/arkode/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices.
Fixed missing soversions in some ``SUNLinearSolver`` and ``SUNNonlinearSolver``
CMake targets.

Added the fourth order ERK method ``ARKODE_SOFRONIOU_SPALETTA_5_3_4``.

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

Expand Down
2 changes: 1 addition & 1 deletion doc/cvodes/guide/source/Usage/ADJ.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ several supporting user-callable functions. For this reason, in the following
sections we refer to the *backward problem* and not to the *adjoint problem*
when discussing details relevant to the ODEs that are integrated backward in
time. The backward problem can be the adjoint problem :eq:`CVODES_adj_eqns` or
:eq:`CVODES_adj_eqns`, and can be augmented with some quadrature differential
:eq:`CVODES_adj1_eqns`, and can be augmented with some quadrature differential
equations.

CVODES uses various constants for both input and output. These are defined as
Expand Down
22 changes: 19 additions & 3 deletions doc/cvodes/guide/source/Usage/SIM.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4122,13 +4122,13 @@ If the quadrature variables are part of the step size control mechanism,
one of the following functions must be called to specify the
integration tolerances for quadrature variables.
.. c:function:: int CVodeQuadSVtolerances(void * cvode_mem, realtype reltolQ, N_Vector abstolQ)
.. c:function:: int CVodeQuadSStolerances(void *cvode_mem, realtype reltolQ, realtype abstolQ)
The function ``CVodeQuadSStolerances`` specifies scalar relative and absolute tolerances.
The function ``CVodeQuadSStolerances`` specifies scalar relative and absolute tolerances.
**Arguments:**
* ``cvode_mem`` -- pointer to the CVODES memory block.
* ``reltolQ`` -- tolerances is the scalar relative error tolerance.
* ``reltolQ`` -- is the scalar relative error tolerance.
* ``abstolQ`` -- is the scalar absolute error tolerance.
**Return value:**
Expand All @@ -4138,6 +4138,22 @@ integration tolerances for quadrature variables.
* ``CV_ILL_INPUT`` -- One of the input tolerances was negative.
.. c:function:: int CVodeQuadSVtolerances(void * cvode_mem, realtype reltolQ, N_Vector abstolQ)
The function ``CVodeQuadSVtolerances`` specifies scalar relative and vector absolute tolerances.
**Arguments:**
* ``cvode_mem`` -- pointer to the CVODES memory block.
* ``reltolQ`` -- is the scalar relative error tolerance.
* ``abstolQ`` -- the vector of absolute error tolerances.
**Return value:**
* ``CV_SUCCESS`` -- The optional value has been successfully set.
* ``CV_NO_QUAD`` -- Quadrature integration was not initialized.
* ``CV_MEM_NULL`` -- The ``cvode_mem`` pointer is ``NULL``.
* ``CV_ILL_INPUT`` -- One of the input tolerances was negative.
.. _CVODES.Usage.purequad.optional_output:
Optional outputs for quadrature integration
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions doc/shared/sundials.bib
Original file line number Diff line number Diff line change
Expand Up @@ -2053,6 +2053,18 @@ @article{Sof:02
pages = {506--515}
}

@article{Sof:04,
author = {M. Sofroniou and G. Spaletta},
title = {Construction of explicit {Runge-Kutta} pairs with stiffness detection},
journal = {Mathematical and Computer Modelling},
volume = {40},
number = {11},
pages = {1157-1169},
year = {2004},
issn = {0895-7177},
doi = {10.1016/j.mcm.2005.01.010}
}

@article{Ver:78,
author = {Verner, J.H},
title = {Explicit Runge-Kutta methods with estimates of the local truncation error},
Expand Down
3 changes: 2 additions & 1 deletion include/arkode/arkode_butcher_erk.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ typedef enum {
ARKODE_ARK437L2SA_ERK_7_3_4,
ARKODE_ARK548L2SAb_ERK_8_4_5,
ARKODE_ARK2_ERK_3_1_2,
ARKODE_MAX_ERK_NUM = ARKODE_ARK2_ERK_3_1_2
ARKODE_SOFRONIOU_SPALETTA_5_3_4,
ARKODE_MAX_ERK_NUM = ARKODE_SOFRONIOU_SPALETTA_5_3_4
} ARKODE_ERKTableID;

/* Accessor routine to load built-in ERK table */
Expand Down
34 changes: 34 additions & 0 deletions src/arkode/arkode_butcher_erk.def
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
ARKODE_HEUN_EULER_2_1_2 Y
ARKODE_BOGACKI_SHAMPINE_4_2_3 Y
ARKODE_ARK324L2SA_ERK_4_2_3* N
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
Expand Down Expand Up @@ -165,6 +166,39 @@ ARK_BUTCHER_TABLE(ARKODE_ARK324L2SA_ERK_4_2_3, { /* ARK3(2)4L[2]SA-ERK */
return B;
})

ARK_BUTCHER_TABLE(ARKODE_SOFRONIOU_SPALETTA_5_3_4, { /* Sofroniou-Spaletta-ERK */
ARKodeButcherTable B = ARKodeButcherTable_Alloc(5, SUNTRUE);
B->q = 4;
B->p = 3;
B->A[1][0] = RCONST(2.0) / RCONST(5.0);
B->A[2][0] = RCONST(-3.0) / RCONST(20.0);
B->A[2][1] = RCONST(3.0) / RCONST(4.0);
B->A[3][0] = RCONST(19.0)/RCONST(44.0);
B->A[3][1] = RCONST(-15.0)/RCONST(44.0);
B->A[3][2] = RCONST(10.0)/RCONST(11.0);
B->A[4][0] = RCONST(11.0)/RCONST(72.0);
B->A[4][1] = RCONST(25.0)/RCONST(72.0);
B->A[4][2] = RCONST(25.0)/RCONST(72.0);
B->A[4][3] = RCONST(11.0)/RCONST(72.0);

B->b[0] = RCONST(11.0)/RCONST(72.0);
B->b[1] = RCONST(25.0)/RCONST(72.0);
B->b[2] = RCONST(25.0)/RCONST(72.0);
B->b[3] = RCONST(11.0)/RCONST(72.0);

B->d[0] = RCONST(1251515.0)/RCONST(8970912.0);
B->d[1] = RCONST(3710105.0)/RCONST(8970912.0);
B->d[2] = RCONST(2519695.0)/RCONST(8970912.0);
B->d[3] = RCONST(61105.0)/RCONST(8970912.0);
B->d[4] = RCONST(119041.0)/RCONST(747576.0);

B->c[1] = RCONST(2.0) / RCONST(5.0);
B->c[2] = RCONST(3.0) / RCONST(5.0);
B->c[3] = RCONST(1.0);
B->c[4] = RCONST(1.0);
return B;
})

ARK_BUTCHER_TABLE(ARKODE_ZONNEVELD_5_3_4, { /* Zonneveld */
ARKodeButcherTable B = ARKodeButcherTable_Alloc(5, SUNTRUE);
B->q = 4;
Expand Down

0 comments on commit 6866662

Please sign in to comment.