Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
6f54295
add constraints unit test
gardner48 Jul 12, 2025
be4103f
cmake testing fixes
gardner48 Jul 12, 2025
715a228
add CVODE constraint test
gardner48 Jul 12, 2025
37c8fe6
add IDS constraint test
gardner48 Jul 12, 2025
65f34b3
remove constraints malloc and set flags
gardner48 Oct 18, 2025
4441e0b
testing output
gardner48 Oct 18, 2025
6821c6d
fix error message
gardner48 Oct 18, 2025
fa6f19f
separate out constraint check
gardner48 Oct 18, 2025
30e2aef
update copyright
gardner48 Oct 18, 2025
96239ba
clean up constraint handling
gardner48 Oct 18, 2025
6cd03b6
fix comment
gardner48 Oct 18, 2025
3bfd2f2
update docs
gardner48 Oct 18, 2025
ce19943
update change log
gardner48 Oct 18, 2025
4d5ec81
sync CVODE and CVODES
gardner48 Oct 18, 2025
91f0809
sync docs
gardner48 Oct 18, 2025
45d1837
add constraint fails to print all stats
gardner48 Oct 18, 2025
5921290
note change to StepSolveFails values
gardner48 Oct 18, 2025
8932230
note changes to step solve fails and version added
gardner48 Oct 18, 2025
7facb14
fix typo
gardner48 Oct 18, 2025
b12de66
match nflag check style
gardner48 Oct 18, 2025
17f0259
match names in header
gardner48 Oct 18, 2025
4028f5b
initialize constraint fails count
gardner48 Oct 18, 2025
66dd93e
note fix to GetReturnFlagName
gardner48 Oct 18, 2025
e16194b
fix typo
gardner48 Oct 18, 2025
f49b0d5
separate constraints fails from correction fails
gardner48 Oct 19, 2025
87bb46e
sync IDA and IDAS
gardner48 Oct 19, 2025
16020c9
update IDAS
gardner48 Oct 19, 2025
9de52f6
update change log
gardner48 Oct 19, 2025
872897e
add IDA(S) docs, fix CVODE(S) docs
gardner48 Oct 19, 2025
98ebab7
re-enable CVODES test
gardner48 Oct 19, 2025
4bee5a3
update fortran interfaces
gardner48 Oct 19, 2025
d85b10d
apply formatting
gardner48 Oct 19, 2025
6d59d21
update output files
gardner48 Oct 19, 2025
83b292f
update fortran outputs
gardner48 Oct 20, 2025
0bc9be9
update logging output files
gardner48 Oct 20, 2025
bf1a94c
update answer submodule
gardner48 Oct 20, 2025
d5a16e5
fix output
gardner48 Oct 20, 2025
788bbd7
update answer submodule
gardner48 Oct 20, 2025
9ff781f
update answers submodule
gardner48 Oct 20, 2025
7d0547f
reinitialize constraint fail counter
gardner48 Oct 20, 2025
256bb2c
add end-step-attempt log message
gardner48 Oct 20, 2025
7411ab2
set ida_phase
gardner48 Oct 20, 2025
e424a04
update h after IDARestore
gardner48 Oct 20, 2025
10cc224
update IDA output
gardner48 Oct 20, 2025
e68194d
sync IDAS with IDA
gardner48 Oct 20, 2025
240aff8
combine nflag checks
gardner48 Oct 20, 2025
37e7a4b
update answers submodule
gardner48 Oct 20, 2025
524916b
update some debug logging
gardner48 Oct 21, 2025
3d9cafe
add constraint logging
gardner48 Oct 25, 2025
0e9c948
Update region labels
gardner48 Oct 25, 2025
a17869a
apply formatting
gardner48 Oct 25, 2025
3942e23
breakup constraint correction update, count corrections
gardner48 Oct 26, 2025
b62af62
sync CVODES
gardner48 Oct 26, 2025
684e2bb
IDA breakup constraint correction update, count corrections
gardner48 Oct 26, 2025
f47b4c6
sync IDAS
gardner48 Oct 26, 2025
7ab72c8
update logging output
gardner48 Oct 26, 2025
1000fe2
update answers submodule
gardner48 Oct 26, 2025
8b2a804
apply formatting
gardner48 Oct 26, 2025
88b246c
update fortran interface
gardner48 Oct 26, 2025
14ace03
update outputs with printallstats
gardner48 Oct 26, 2025
fb1ef93
update answers submodule
gardner48 Oct 26, 2025
09c4d3b
fix find and replace
gardner48 Oct 26, 2025
f5de3db
update logging output level 4 and 5
gardner48 Oct 26, 2025
ed75e16
update ida(s) outputs
gardner48 Oct 26, 2025
7c5a2c6
update cvode output
gardner48 Oct 26, 2025
30632d9
CVODES to CVODE in cvode docs
gardner48 Oct 26, 2025
e8953ee
IDA to IDAS
gardner48 Oct 26, 2025
652fa77
IDASLS to IDALS
gardner48 Oct 26, 2025
3405778
add cli options for max constraint fails
gardner48 Oct 26, 2025
4c7c0c7
sync arkode constraints
gardner48 Oct 26, 2025
f2c4fa2
update fused kernels
gardner48 Oct 26, 2025
3fbb153
fix constraint changes in AdjointStepper
gardner48 Oct 27, 2025
8bf0f6b
fix fused prototype
gardner48 Oct 27, 2025
ad8c127
apply formatting
gardner48 Oct 27, 2025
8282b6a
fix typo
gardner48 Oct 27, 2025
602a679
Merge branch 'develop' into bugfix/constraints
gardner48 Oct 30, 2025
a450c90
Merge branch 'develop' into bugfix/constraints
gardner48 Nov 3, 2025
9f17793
Merge branch 'develop' into bugfix/constraints
gardner48 Nov 12, 2025
92ab760
add docs for GetNumConstraintCorrections
gardner48 Nov 12, 2025
fed68cd
Merge branch 'develop' into bugfix/constraints
gardner48 Nov 13, 2025
ea8da9f
Merge branch 'develop' into bugfix/constraints
gardner48 Nov 15, 2025
adb6d1c
update answers submodule
gardner48 Nov 18, 2025
14c6970
Merge branch 'develop' into bugfix/constraints
gardner48 Nov 18, 2025
119f694
Merge branch 'develop' into bugfix/constraints
gardner48 Nov 21, 2025
7984b22
Merge branch 'develop' into bugfix/constraints
gardner48 Nov 21, 2025
3486143
Merge branch 'develop' into bugfix/constraints
gardner48 Nov 23, 2025
e91d119
Merge branch 'develop' into bugfix/constraints
gardner48 Nov 24, 2025
cfcc4c6
Merge branch 'develop' into bugfix/constraints
gardner48 Nov 24, 2025
bafeff1
update recent changes
gardner48 Dec 8, 2025
bd041aa
fix typo
gardner48 Dec 8, 2025
ad46e4d
Merge branch 'develop' into bugfix/constraints
gardner48 Dec 18, 2025
34d6017
Merge branch 'develop' into bugfix/constraints
gardner48 Dec 19, 2025
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
42 changes: 32 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,31 @@

### New Features and Enhancements

Added functions to CVODE(S) and IDA(S) to set the maximum number of inequality
constraint failures in a step attempt (`CVodeSetMaxNumConstraintFails` and
`IDASetMaxNumConstraintFails`) and to retrieve the total number of failed step
attempts due to an inequality constraint violation (`CVodeGetNumConstraintFails`
and `IDAGetNumConstraintFails`). As a result, constraint failures are no longer
included in the number of step failures due to a solver failure (i.e., the
values returned by `CVodeGetNumStepSolveFails` and `IDAGetNumStepSolveFails`).
The functions `CVodeGetNumConstraintCorrections` and
`IDAGetNumConstraintCorrections` were also added to retrieve the number of steps
where the corrector was modified to satisfy an inequality constraint without
failing the step.

The functions `CVodeGetUserDataB` and `IDAGetUserDataB` were added to CVODES
and IDAS, respectively.

### Bug Fixes

Fixed a bug in the CVODE(S) inequality constraint handling where the predicted
state was used to compute the step size reduction factor which could lead to an
insufficient reduction in the step size or, when the prediction violates the
constraints, an infinitely large step size in the next step attempt.

In CVODES and IDA, added missing return flag names to `CVodeGetReturnFlagName`
and `IDAGetReturnFlagName`, respectively.

On the initial time step with a user-supplied initial step size, ARKODE and
CVODE(S) will now return `ARK_TOO_CLOSE` or `CV_TOO_CLOSE`, respectively,
when the requested output time is the same as the initial time (or within
Expand Down Expand Up @@ -44,19 +64,21 @@ called even when informational logging was disabled.

### Deprecation Notices

`SUNDIALSFileOpen` and `SUNDIALSFileClose` will be removed in the next major release.
Use `SUNFileOpen` and `SUNFileClose` instead.
`SUNDIALSFileOpen` and `SUNDIALSFileClose` will be removed in the next major
release. Use `SUNFileOpen` and `SUNFileClose` instead.

The `Convert` methods on the `sundials::kokkos:Vector`, `sundials::kokkos::DenseMatrix`,
`sundials::ginkgo::Matrix`, `sundials::ginkgo::BatchMatrix`, `sundials::kokkos::DenseLinearSolver`,
`sundials::ginkgo::LinearSolver`, and `sundials::ginkgo::BatchLinearSolver` classes have
been deprecated and will be removed in the next major release. The method `get`, should
be used instead.
The `Convert` methods on the `sundials::kokkos:Vector`,
`sundials::kokkos::DenseMatrix`, `sundials::ginkgo::Matrix`,
`sundials::ginkgo::BatchMatrix`, `sundials::kokkos::DenseLinearSolver`,
`sundials::ginkgo::LinearSolver`, and `sundials::ginkgo::BatchLinearSolver`
classes have been deprecated and will be removed in the next major release. The
method `get`, should be used instead.

The `CSC_MAT` and `CSR_MAT` macros defined in `sunmatrix_sparse.h` will be removed in
the next major release. Use `SUN_CSC_MAT` and `SUN_CSR_MAT` instead.
The `CSC_MAT` and `CSR_MAT` macros defined in `sunmatrix_sparse.h` will be
removed in the next major release. Use `SUN_CSC_MAT` and `SUN_CSR_MAT` instead.

The `N_Vector_S` typedef to `N_Vector*` is deprecated and will be removed in the next major release.
The `N_Vector_S` typedef to `N_Vector*` is deprecated and will be removed in the
next major release.

## Changes to SUNDIALS in release 7.5.0

Expand Down
297 changes: 183 additions & 114 deletions doc/cvode/guide/source/Usage/index.rst

Large diffs are not rendered by default.

415 changes: 244 additions & 171 deletions doc/cvodes/guide/source/Usage/SIM.rst

Large diffs are not rendered by default.

333 changes: 200 additions & 133 deletions doc/ida/guide/source/Usage/index.rst

Large diffs are not rendered by default.

362 changes: 206 additions & 156 deletions doc/idas/guide/source/Usage/SIM.rst

Large diffs are not rendered by default.

46 changes: 36 additions & 10 deletions doc/shared/RecentChanges.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,34 @@

**New Features and Enhancements**

Added functions to CVODE(S) and IDA(S) to set the maximum number of inequality
constraint failures in a step attempt (:c:func:`CVodeSetMaxNumConstraintFails`
and :c:func:`IDASetMaxNumConstraintFails`) and to retrieve the total number of
failed step attempts due to an inequality constraint violation
(:c:func:`CVodeGetNumConstraintFails` and
:c:func:`IDAGetNumConstraintFails`). As a result, constraint failures are no
longer included in the number of step failures due to a solver failure (i.e.,
the values returned by :c:func:`CVodeGetNumStepSolveFails` and
:c:func:`IDAGetNumStepSolveFails`). The functions
:c:func:`CVodeGetNumConstraintCorrections` and
:c:func:`IDAGetNumConstraintCorrections` were also added to retrieve the number
of steps where the corrector was modified to satisfy an inequality constraint
without failing the step.

The functions ``CVodeGetUserDataB`` and ``IDAGetUserDataB`` were added to CVODES
and IDAS, respectively.

**Bug Fixes**

Fixed a bug in the CVODE(S) inequality constraint handling where the predicted
state was used to compute the step size reduction factor which could lead to an
insufficient reduction in the step size or, when the prediction violates the
constraints, an infinitely large step size in the next step attempt.

In CVODES and IDA, added missing return flag names to
:c:func:`CVodeGetReturnFlagName` and :c:func:`IDAGetReturnFlagName`,
respectively.

On the initial time step with a user-supplied initial step size, ARKODE and
CVODE(S) will now return ``ARK_TOO_CLOSE`` or ``CV_TOO_CLOSE``, respectively,
when the requested output time is the same as the initial time (or within
Expand Down Expand Up @@ -43,16 +66,19 @@ called even when informational logging was disabled.

**Deprecation Notices**

``SUNDIALSFileOpen`` and ``SUNDIALSFileClose`` will be removed in the next major release.
Use :c:func:`SUNFileOpen` and :c:func:`SUNFileClose` instead.
``SUNDIALSFileOpen`` and ``SUNDIALSFileClose`` will be removed in the next major
release. Use :c:func:`SUNFileOpen` and :c:func:`SUNFileClose` instead.

The ``Convert`` methods on the ``sundials::kokkos:Vector``, ``sundials::kokkos::DenseMatrix``,
``sundials::ginkgo::Matrix``, ``sundials::ginkgo::BatchMatrix``, ``sundials::kokkos::DenseLinearSolver``,
``sundials::ginkgo::LinearSolver``, and ``sundials::ginkgo::BatchLinearSolver`` classes have
been deprecated and will be removed in the next major release. The method ``get``, should
be used instead.
The ``Convert`` methods on the ``sundials::kokkos:Vector``,
``sundials::kokkos::DenseMatrix``, ``sundials::ginkgo::Matrix``,
``sundials::ginkgo::BatchMatrix``, ``sundials::kokkos::DenseLinearSolver``,
``sundials::ginkgo::LinearSolver``, and ``sundials::ginkgo::BatchLinearSolver``
classes have been deprecated and will be removed in the next major release. The
method ``get``, should be used instead.

The ``CSC_MAT`` and ``CSR_MAT`` macros defined in ``sunmatrix_sparse.h`` will be removed in
the next major release. Use ``SUN_CSC_MAT`` and ``SUN_CSR_MAT`` instead.
The ``CSC_MAT`` and ``CSR_MAT`` macros defined in ``sunmatrix_sparse.h`` will be
removed in the next major release. Use ``SUN_CSC_MAT`` and ``SUN_CSR_MAT``
instead.

The ``N_Vector_S`` typedef to ``N_Vector*`` is deprecated and will be removed in the next major release.
The ``N_Vector_S`` typedef to ``N_Vector*`` is deprecated and will be removed in
the next major release.
56 changes: 29 additions & 27 deletions examples/cvode/CXX_serial/cv_kpr.out
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,32 @@
9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05
1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06
------------------------------------------------------------------------------------------------------------------------------
Current time = 10.0013681010296
Steps = 1577
Error test fails = 147
NLS step fails = 0
Initial step size = 0.000102986025609508
Last step size = 0.00638360784190842
Current step size = 0.00638360784190842
Last method order = 4
Current method order = 4
Stab. lim. order reductions = 0
RHS fn evals = 2197
NLS iters = 2194
NLS fails = 0
NLS iters per step = 1.39124920735574
LS setups = 272
Jac fn evals = 29
LS RHS fn evals = 0
Prec setup evals = 0
Prec solves = 0
LS iters = 0
LS fails = 0
Jac-times setups = 0
Jac-times evals = 0
LS iters per NLS iter = 0
Jac evals per NLS iter = 0.0132178669097539
Prec evals per NLS iter = 0
Root fn evals = 0
Current time = 10.0013681010296
Steps = 1577
Error test fails = 147
NLS step fails = 0
Constraint fails = 0
Constraint corrections = 0
Initial step size = 0.000102986025609508
Last step size = 0.00638360784190842
Current step size = 0.00638360784190842
Last method order = 4
Current method order = 4
Stab. lim. order reductions = 0
RHS fn evals = 2197
NLS iters = 2194
NLS fails = 0
NLS iters per step = 1.39124920735574
LS setups = 272
Jac fn evals = 29
LS RHS fn evals = 0
Prec setup evals = 0
Prec solves = 0
LS iters = 0
LS fails = 0
Jac-times setups = 0
Jac-times evals = 0
LS iters per NLS iter = 0
Jac evals per NLS iter = 0.0132178669097539
Prec evals per NLS iter = 0
Root fn evals = 0
2 changes: 2 additions & 0 deletions examples/cvode/CXX_serial/cv_kpr_cvode.init_step_0.01.out
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Current time = 10.0020756826936
Steps = 1572
Error test fails = 144
NLS step fails = 0
Constraint fails = 0
Constraint corrections = 0
Initial step size = 0.01
Last step size = 0.00671233385398068
Current step size = 0.00671233385398068
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ Constraints cval = ( 1.00 1.00 1.00 )
4.0000E+07 5.1479E-05 2.0593E-10 9.9995E-01
4.0000E+08 6.0238E-06 2.4095E-11 9.9999E-01
4.0000E+09 4.6711E-07 1.8685E-12 1.0000E+00
4.0000E+10 3.4054E-09 1.3622E-14 1.0000E+00
4.0000E+10 0.0000E+00 0.0000E+00 1.0000E+00

---------------------------------------------------
Final y1' y2' y3'
---------------------------------------------------
7.4513E-20 2.9805E-25 -7.4513E-20
0.0000E+00 0.0000E+00 6.4667E-20

General Solver Stats:
Total internal steps taken = 387
Total rhs function calls = 561
Total Jacobian function calls = 12
Total root function calls = 425
Total LU function calls = 95
Total LU function calls = 96
Num error test failures = 15
Num nonlinear solver iters = 558
Num nonlinear solver fails = 6
Expand Down
2 changes: 2 additions & 0 deletions examples/cvode/ginkgo/cv_bruss_batched_ginkgo.CUDA.out
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ Current time = 10.077845282577
Steps = 264
Error test fails = 18
NLS step fails = 0
Constraint fails = 0
Constraint corrections = 0
Initial step size = 2.84247208242895e-08
Last step size = 0.0810924147203236
Current step size = 0.0810924147203236
Expand Down
2 changes: 2 additions & 0 deletions examples/cvode/ginkgo/cv_bruss_batched_ginkgo.OMP.out
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ Current time = 10.0672363540683
Steps = 270
Error test fails = 22
NLS step fails = 0
Constraint fails = 0
Constraint corrections = 0
Initial step size = 2.84247208242898e-08
Last step size = 0.0891171802985761
Current step size = 0.0891171802985761
Expand Down
2 changes: 2 additions & 0 deletions examples/cvode/ginkgo/cv_bruss_batched_ginkgo.REF.out
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ Current time = 10.0672363540683
Steps = 270
Error test fails = 22
NLS step fails = 0
Constraint fails = 0
Constraint corrections = 0
Initial step size = 2.84247208242898e-08
Last step size = 0.0891171802985761
Current step size = 0.0891171802985761
Expand Down
84 changes: 43 additions & 41 deletions examples/cvode/ginkgo/cv_heat2D_ginkgo.CUDA.out
Original file line number Diff line number Diff line change
Expand Up @@ -29,49 +29,51 @@
2.000000000000000e-01 1.173149607363054e+00 1.048511182224932e-03
2.500000000000000e-01 1.129971118809724e+00 7.777031646749588e-04
3.000000000000000e-01 1.088068652479702e+00 3.867786296469777e-04
3.500000000000000e-01 1.051569453796381e+00 2.291655197173004e-04
4.000000000000000e-01 1.023519691519509e+00 1.152507676536185e-04
4.500000000000000e-01 1.005966466128100e+00 3.464712602863074e-05
4.999999999999999e-01 9.999941074735683e-01 6.549023902890916e-05
5.499999999999999e-01 1.005920139252285e+00 1.085862394125670e-04
3.500000000000000e-01 1.051569453796381e+00 2.291655197177445e-04
4.000000000000000e-01 1.023519691519510e+00 1.152507676551728e-04
4.500000000000000e-01 1.005966466128100e+00 3.464712602885278e-05
4.999999999999999e-01 9.999941074735680e-01 6.549023903024143e-05
5.499999999999999e-01 1.005920139252284e+00 1.085862394110126e-04
6.000000000000000e-01 1.023440066617863e+00 1.253667245226797e-04
6.500000000000000e-01 1.051474489311814e+00 4.368064039983466e-05
7.000000000000001e-01 1.087966430721224e+00 8.251704806849780e-05
7.500000000000001e-01 1.129793211633907e+00 2.403035068856418e-04
8.000000000000002e-01 1.172918720617323e+00 4.322501964297842e-04
8.500000000000002e-01 1.212839862652567e+00 6.883283219258907e-04
9.000000000000002e-01 1.245175128903723e+00 9.857170108882318e-04
9.500000000000003e-01 1.266235911062742e+00 1.301833676780495e-03
1.000000000000000e+00 1.273469281873646e+00 1.183015268845011e-03
6.500000000000000e-01 1.051474489311814e+00 4.368064040116693e-05
7.000000000000001e-01 1.087966430721224e+00 8.251704807071825e-05
7.500000000000001e-01 1.129793211633907e+00 2.403035068845316e-04
8.000000000000002e-01 1.172918720617321e+00 4.322501964284520e-04
8.500000000000002e-01 1.212839862652565e+00 6.883283219212277e-04
9.000000000000002e-01 1.245175128903723e+00 9.857170108886759e-04
9.500000000000003e-01 1.266235911062742e+00 1.301833676790709e-03
1.000000000000000e+00 1.273469281873640e+00 1.183015268851229e-03
-----------------------------------------------------------------------

Final integrator statistics:
Current time = 1
Steps = 41
Error test fails = 0
NLS step fails = 0
Initial step size = 0.002110117764420172
Last step size = 0.02782878040979117
Current step size = 0.02782878040979117
Last method order = 3
Current method order = 3
Stab. lim. order reductions = 0
RHS fn evals = 52
NLS iters = 49
NLS fails = 0
NLS iters per step = 1.195121951219512
LS setups = 7
Jac fn evals = 1
LS RHS fn evals = 0
Prec setup evals = 0
Prec solves = 0
LS iters = 875
LS fails = 0
Jac-times setups = 0
Jac-times evals = 0
LS iters per NLS iter = 17.85714285714286
Jac evals per NLS iter = 0.02040816326530612
Prec evals per NLS iter = 0
Root fn evals = 0
Current time = 1
Steps = 41
Error test fails = 0
NLS step fails = 0
Constraint fails = 0
Constraint corrections = 0
Initial step size = 0.00211011776442017
Last step size = 0.0278287804080046
Current step size = 0.0278287804080046
Last method order = 3
Current method order = 3
Stab. lim. order reductions = 0
RHS fn evals = 52
NLS iters = 49
NLS fails = 0
NLS iters per step = 1.19512195121951
LS setups = 7
Jac fn evals = 1
LS RHS fn evals = 0
Prec setup evals = 0
Prec solves = 0
LS iters = 875
LS fails = 0
Jac-times setups = 0
Jac-times evals = 0
LS iters per NLS iter = 17.8571428571429
Jac evals per NLS iter = 0.0204081632653061
Prec evals per NLS iter = 0
Root fn evals = 0

Max error = 1.183015268845011e-03
Max error = 1.183015268851229e-03
Loading
Loading