Skip to content
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
17c89c2
pick changes to sundials C/C++ interface or other core sundials
balos1 Sep 19, 2025
683cb92
document API changes
balos1 Sep 19, 2025
431905b
pick gitignore
balos1 Sep 19, 2025
5213a1e
doc update
balos1 Sep 19, 2025
1c40de4
move SetOwnUserData functions to impl
balos1 Sep 20, 2025
0352562
doc some types
balos1 Sep 20, 2025
ae7adee
use macro defines for constants instead of const int to enable intege…
balos1 Sep 22, 2025
915394e
use SUN_DATAIOMODE_
balos1 Sep 22, 2025
112b638
use SUN_MEMTYPE
balos1 Sep 22, 2025
7e6669b
newline
balos1 Sep 22, 2025
56711a6
remove duplicate typedef from merge conflict
balos1 Sep 22, 2025
9df8b5a
regen swig
balos1 Sep 22, 2025
b5d8c19
no anonymous enums
balos1 Sep 22, 2025
4e0d03e
move SPRKStepSetUseCompensatedSums
balos1 Sep 22, 2025
3fd9b27
undo SUN_MEMTYPE / SUN_DATAIOMODE switch
balos1 Sep 22, 2025
73fe771
find/replace double underscore SUNMEMTYPE__
balos1 Sep 22, 2025
f1de1af
regen fortran
balos1 Sep 22, 2025
67a1dcc
missed Convert to get
balos1 Sep 22, 2025
eba70ba
merge error
balos1 Sep 22, 2025
778359f
typo
balos1 Sep 22, 2025
dc49482
add python pointers for linearsolver and nonlinear
balos1 Sep 23, 2025
5d94366
regen swig after typo
balos1 Sep 23, 2025
abbecce
remove enum trailing underscores
balos1 Sep 23, 2025
c6b2b8b
add _deprecated headers to cmake
balos1 Sep 23, 2025
12a66ee
format
balos1 Sep 23, 2025
8d373a7
merge fixes
balos1 Sep 23, 2025
022324c
use parameter name suffixes instead of typedef for arrays
balos1 Sep 29, 2025
039c1b9
Merge remote-tracking branch 'origin/develop' into feature/python-part1
balos1 Sep 29, 2025
0aa53b4
Merge remote-tracking branch 'origin/develop' into feature/python-part1
balos1 Sep 29, 2025
fce667a
update copyrights
balos1 Sep 29, 2025
b386d06
make SUNContextView, SUNLoggerView, and SUNProfilerView inherit from …
balos1 Sep 29, 2025
76fc0e0
find/replace error
balos1 Sep 29, 2025
4ade51f
remove unnecessary checks for null
balos1 Sep 29, 2025
de470d6
fix find/replace error
balos1 Sep 30, 2025
10e15fc
typo
balos1 Sep 30, 2025
86d17f0
add note about suffixes to naming conventions
balos1 Sep 30, 2025
7cb6050
explain combination of ptr and dimensions suffixes
balos1 Sep 30, 2025
6b43e53
regen swig
balos1 Sep 30, 2025
6835f6f
use std::forward
balos1 Sep 30, 2025
099554d
combine definition and declaration of static Create methods
balos1 Sep 30, 2025
97f685c
Convert to get
balos1 Sep 30, 2025
960fdb5
add rule on anonymous enums
balos1 Sep 30, 2025
29d4c03
Update doc/superbuild/source/developers/source_code/Naming.rst
balos1 Oct 1, 2025
a8bbe92
remove comment that is not needed
balos1 Oct 1, 2025
0086cbb
address multiple PR comments
balos1 Oct 2, 2025
919bf88
fix enum min/max values and comment about why
balos1 Oct 2, 2025
31bd0d3
format
balos1 Oct 2, 2025
3f17bba
Apply suggestions from code review
balos1 Oct 2, 2025
2438419
deprecate N_Vector_S
balos1 Oct 2, 2025
5e96c22
Merge branch 'feature/python-interfaces' into feature/python-part1
balos1 Oct 2, 2025
e9b387b
add change notes
balos1 Oct 2, 2025
f745359
more change notes
balos1 Oct 2, 2025
4d8ff80
add enum naming rule
balos1 Oct 2, 2025
390f589
apply formatting
gardner48 Oct 2, 2025
c64ac24
run swig
gardner48 Oct 2, 2025
840e10e
minor doc fix
gardner48 Oct 2, 2025
2c9d808
namespace CSC_MAT and CSR_MAT macros
balos1 Oct 3, 2025
0389c21
add deprecation notice
balos1 Oct 3, 2025
b7cd8f7
Merge remote-tracking branch 'origin/feature/python-part1' into featu…
balos1 Oct 3, 2025
d511b2d
change all uses of CSC_MAT and CSR_ MATH
balos1 Oct 3, 2025
59e9d55
markdown format fix
gardner48 Oct 3, 2025
37343e3
fix table links
gardner48 Oct 3, 2025
5d2dd65
wrap long line
gardner48 Oct 3, 2025
932fdc1
fix SPRKMethodID ordering
gardner48 Oct 3, 2025
b4d0685
add back newlines
gardner48 Oct 3, 2025
e87ce82
add new line
gardner48 Oct 3, 2025
4f21564
add _1d prefix in more places
balos1 Oct 3, 2025
18a3700
Merge remote-tracking branch 'origin/feature/python-part1' into featu…
balos1 Oct 3, 2025
5d14eb4
add N_Vector_S deprecation note
balos1 Oct 6, 2025
e6e6c0f
add hpp files for each arkode stepper module
balos1 Oct 6, 2025
9e83bb3
add hpp files to cmake
balos1 Oct 6, 2025
32e1665
fix enum names
balos1 Oct 6, 2025
506b3c7
use proper naming convention for internal functions
balos1 Oct 6, 2025
e81340f
add missing header to cmake
balos1 Oct 6, 2025
5a06a74
free cv_user_data in CVAbckpbDelete if owned
balos1 Oct 6, 2025
91194bb
add idaSetOwnUserDataB
balos1 Oct 6, 2025
7f1bb3e
format and regen swig
balos1 Oct 6, 2025
035e8a0
Merge remote-tracking branch 'origin/develop' into feature/python-part1
balos1 Oct 6, 2025
609af2f
initialize ida_own_user_data in BMem
balos1 Oct 6, 2025
aec1b92
Merge branch 'feature/python-interfaces' into feature/python-part1
balos1 Oct 6, 2025
be1e7da
apply formatting
gardner48 Oct 7, 2025
6a2718f
header file updates
gardner48 Oct 7, 2025
3258f62
Merge branch 'develop' into feature/python-part1
gardner48 Oct 7, 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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
/.pydevproject
.vscode
compile_commands.json
.venv
.clangd

# custom test environment setup script
Expand Down Expand Up @@ -82,3 +83,7 @@ uberenv_libs

# tools
/tools/suntools/__pycache__

# python
.pytest_cache
__pycache__
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,22 @@

### New Features and Enhancements

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

### Bug Fixes

### Deprecation Notices

`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.

## Changes to SUNDIALS in release 7.5.0

### Major Features
Expand Down
12 changes: 12 additions & 0 deletions doc/shared/RecentChanges.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@

**New Features and Enhancements**

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

**Bug Fixes**

**Deprecation Notices**

:c:func:`SUNDIALSFileOpen` and :c:func:`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.
18 changes: 13 additions & 5 deletions doc/shared/nvectors/NVector_Kokkos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ To use the NVECTOR_KOKKOS module, we construct an instance of the ``Vector`` cla
Instances of the ``Vector`` class are implicitly or explicitly (using the
:cpp:func:`~Vector::Convert` method) convertible to a :c:type:`N_Vector`
:cpp:func:`~Vector::get` method) convertible to a :c:type:`N_Vector`
e.g.,

.. code-block:: cpp
sundials::kokkos::Vector<> x{length, sunctx};
N_Vector x2 = x; // implicit conversion to N_Vector
N_Vector x3 = x.Convert(); // explicit conversion to N_Vector
N_Vector x2 = x; // implicit conversion to N_Vector
N_Vector x3 = x.get(); // explicit conversion to N_Vector
No further interaction with a ``Vector`` is required from this point, and
it is possible to use the :c:type:`N_Vector` API to operate on ``x2`` or ``x3``.
Expand Down Expand Up @@ -187,13 +187,21 @@ class.

Implicit conversion to a :c:type:`N_Vector`.

.. cpp:function:: N_Vector Convert() override
.. cpp:function:: N_Vector get() override

Explicit conversion to a :c:type:`N_Vector`.

.. versionadded:: x.y.z

Replaces the ``Convert`` method which was deprecated and moved to the ``ConvertibleTo`` class.

.. cpp:function:: N_Vector Convert() const override
.. cpp:function:: N_Vector get() const override

Explicit conversion to a :c:type:`N_Vector`.

.. versionadded:: x.y.z

Replaces the ``Convert`` method which was deprecated and moved to the ``ConvertibleTo`` class.


.. cpp:function:: template<class VectorType> inline VectorType* GetVec(N_Vector v)
Expand Down
32 changes: 23 additions & 9 deletions doc/shared/sundials/Fortran.rst
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,13 @@ a C file pointer, SUNDIALS provides two utility functions for creating a

.. c:function:: SUNErrCode SUNDIALSFileOpen(const char* filename, const char* mode, FILE** fp)
.. deprecated:: x.y.z
See :c:func:`SUNFileOpen`.
.. c:function:: SUNErrCode SUNFileOpen(const char* filename, const char* mode, FILE** fp)
The function allocates a ``FILE*`` by calling the C function ``fopen`` with
the provided filename and I/O mode.
Expand Down Expand Up @@ -525,33 +532,40 @@ a C file pointer, SUNDIALS provides two utility functions for creating a
type(c_ptr) :: fp
! Open up the file output.log for writing
ierr = FSUNDIALSFileOpen("output.log", "w+", fp)
ierr = FSUNFileOpen("output.log", "w+", fp)
! The C function ARKStepPrintMem takes void* arkode_mem and FILE* fp as arguments
call FARKStepPrintMem(arkode_mem, fp)
! Close the file
ierr = FSUNDIALSFileClose(fp)
.. versionchanged:: 7.0.0
.. versionadded:: X.Y.Z
Replaces ``SUNDIALSFileOpen``
The function signature was updated to return a `SUNErrCode` and take a `FILE**` as the last input parameter rather then return a `FILE*`.
.. c:function:: SUNErrCode SUNDIALSFileClose(FILE** fp)
.. deprecated:: X.Y.Z
See :c:func:`SUNFileClose`
.. c:function:: SUNErrCode SUNFileClose(FILE** fp)
The function deallocates a C ``FILE*`` by calling the C function ``fclose``
with the provided pointer.
:param fp: the C ``FILE*`` that was previously obtained from ``fopen``.
This should have the Fortran type ``type(c_ptr)``. Note that if either
``stdout`` or ``stderr`` were opened using :c:func:`SUNDIALSFileOpen()`
``stdout`` or ``stderr`` were opened using :c:func:`SUNFileOpen()`
:return: A :c:type:`SUNErrCode`
.. versionchanged:: 7.0.0
The function signature was updated to return a `SUNErrCode` and the `fp` parameter was changed from `FILE*` to `FILE**`.
.. versionadded:: X.Y.Z
Replaces ``SUNDIALSFileClose``
.. _SUNDIALS.Fortran.Portability:
Expand Down
4 changes: 2 additions & 2 deletions doc/shared/sundials/SUNContext.rst
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,11 @@ For C++ users a RAII safe class, ``sundials::Context``, is provided:
Context& operator=(const Context&) = delete;
Context& operator=(Context&&) = default;
SUNContext Convert() override
SUNContext get() override
{
return *sunctx_.get();
}
SUNContext Convert() const override
SUNContext get() const override
{
return *sunctx_.get();
}
Expand Down
14 changes: 11 additions & 3 deletions doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ expecting a ``SUNLinearSolver`` object through the implicit conversion operator
// Alternatively with explicit conversion of LS to a SUNLinearSolver
// and A to a SUNMatrix:
CVodeSetLinearSolver(cvode_mem, LS->Convert(), A->Convert());
CVodeSetLinearSolver(cvode_mem, LS->get(), A->get());
.. warning::
Expand Down Expand Up @@ -142,14 +142,22 @@ In this section we list the public API of the :cpp:type:`sundials::ginkgo::Linea

Implicit conversion to a :c:type:`SUNLinearSolver`.

.. cpp:function:: SUNLinearSolver Convert() override
.. cpp:function:: SUNLinearSolver get() override

Explicit conversion to a :c:type:`SUNLinearSolver`.

.. cpp:function:: SUNLinearSolver Convert() const override
.. versionadded:: x.y.z

Replaces the ``Convert`` method which was deprecated and moved to the ``ConvertibleTo`` class.

.. cpp:function:: SUNLinearSolver get() const override

Explicit conversion to a :c:type:`SUNLinearSolver`.

.. versionadded:: x.y.z

Replaces the ``Convert`` method which was deprecated and moved to the ``ConvertibleTo`` class.

.. cpp:function:: std::shared_ptr<const gko::Executor> GkoExec() const

Get the ``gko::Executor`` associated with the Ginkgo solver.
Expand Down
14 changes: 11 additions & 3 deletions doc/shared/sunlinsol/SUNLinSol_GinkgoBatch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ For example,
// Alternatively with explicit conversion of LS to a SUNLinearSolver
// and A to a SUNMatrix:
CVodeSetLinearSolver(cvode_mem, LS.Convert(), A.Convert());
CVodeSetLinearSolver(cvode_mem, LS.get(), A.get());
After attaching the linear solver to the SUNDIALS integrator, one must change the norm factor the integrator uses
since the Ginkgo linear solver will take norms over individual batches, not the entire system.
Expand Down Expand Up @@ -222,14 +222,22 @@ The public API of the :cpp:type:`sundials::ginkgo::BatchLinearSolver` class is a
Implicit conversion to a :c:type:`SUNLinearSolver`.
.. cpp:function:: SUNLinearSolver Convert() override
.. cpp:function:: SUNLinearSolver get() override
Explicit conversion to a :c:type:`SUNLinearSolver`.
.. cpp:function:: SUNLinearSolver Convert() const override
.. versionadded:: x.y.z
Replaces the ``Convert`` method which was deprecated and moved to the ``ConvertibleTo`` class.
.. cpp:function:: SUNLinearSolver get() const override
Explicit conversion to a :c:type:`SUNLinearSolver`.
.. versionadded:: x.y.z
Replaces the ``Convert`` method which was deprecated and moved to the ``ConvertibleTo`` class.
.. cpp:function:: std::shared_ptr<const gko::Executor> GkoExec() const
Get the ``gko::Executor`` associated with the Ginkgo solver.
Expand Down
16 changes: 12 additions & 4 deletions doc/shared/sunlinsol/SUNLinSol_KokkosDense.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ instance of a dense linear solver e.g.,
sundials::kokkos::DenseLinearSolver<> LS{sunctx};
Instances of the ``DenseLinearSolver`` class are implicitly or explicitly (using
the :cpp:func:`~DenseLinearSolver::Convert` method) convertible to a
the :cpp:func:`~DenseLinearSolver::get` method) convertible to a
:c:type:`SUNLinearSolver` e.g.,

.. code-block:: cpp
sundials::kokkos::DenseLinearSolver<> LS{sunctx};
SUNLinearSolver LSA = LS; // implicit conversion to SUNLinearSolver
SUNLinearSolver LSB = LS.Convert(); // explicit conversion to SUNLinearSolver
SUNLinearSolver LSB = LS.get(); // explicit conversion to SUNLinearSolver
.. warning::

Expand Down Expand Up @@ -121,10 +121,18 @@ In this section we list the public API of the

Implicit conversion to a :c:type:`SUNLinearSolver`.

.. cpp:function:: SUNLinearSolver Convert() override
.. cpp:function:: SUNLinearSolver get() override

Explicit conversion to a :c:type:`SUNLinearSolver`.

.. cpp:function:: SUNLinearSolver Convert() const override
.. versionadded:: x.y.z

Replaces the ``Convert`` method which was deprecated and moved to the ``ConvertibleTo`` class.

.. cpp:function:: SUNLinearSolver get() const override

Explicit conversion to a :c:type:`SUNLinearSolver`.

.. versionadded:: x.y.z

Replaces the ``Convert`` method which was deprecated and moved to the ``ConvertibleTo`` class.
16 changes: 12 additions & 4 deletions doc/shared/sunmatrix/SUNMatrix_Ginkgo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ and then fill the diagonal of the matrix with ones to make an identity matrix:
After we have a Ginkgo matrix object, we wrap it in an instance of the ``sundials::ginkgo::Matrix``
class. This object can be provided to other SUNDIALS functions that expect a ``SUNMatrix`` object
via implicit conversion, or the ``Convert()`` method:
via implicit conversion, or the ``get()`` method:

.. code-block:: cpp
sundials::ginkgo::Matrix<gko::matrix::Csr> matrix{gko_matrix, sunctx};
SUNMatrix I1 = matrix.Convert(); // explicit conversion to SUNMatrix
SUNMatrix I1 = matrix.get(); // explicit conversion to SUNMatrix
SUNMatrix I2 = matrix; // implicit conversion to SUNMatrix
No further interaction with ``matrix`` is required from this point, and it is possible to
Expand Down Expand Up @@ -159,10 +159,18 @@ In this section we list the public API of the ``sundials::ginkgo::Matrix`` class

Implicit conversion to a :c:type:`SUNMatrix`.

.. cpp:function:: SUNMatrix Convert() override
.. cpp:function:: SUNMatrix get() override

Explicit conversion to a :c:type:`SUNMatrix`.

.. cpp:function:: SUNMatrix Convert() const override
.. versionadded:: x.y.z

Replaces the ``Convert`` method which was deprecated and moved to the ``ConvertibleTo`` class.

.. cpp:function:: SUNMatrix get() const override

Explicit conversion to a :c:type:`SUNMatrix`.

.. versionadded:: x.y.z

Replaces the ``Convert`` method which was deprecated and moved to the ``ConvertibleTo`` class.
12 changes: 10 additions & 2 deletions doc/shared/sunmatrix/SUNMatrix_GinkgoBatch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,18 @@ In this section we list the public API of the

Implicit conversion to a :c:type:`SUNMatrix`.

.. cpp:function:: SUNMatrix Convert() override
.. cpp:function:: SUNMatrix get() override

Explicit conversion to a :c:type:`SUNMatrix`.

.. cpp:function:: SUNMatrix Convert() const override
.. versionadded:: x.y.z

Replaces the ``Convert`` method which was deprecated and moved to the ``ConvertibleTo`` class.

.. cpp:function:: SUNMatrix get() const override

Explicit conversion to a :c:type:`SUNMatrix`.

.. versionadded:: x.y.z

Replaces the ``Convert`` method which was deprecated and moved to the ``ConvertibleTo`` class.
16 changes: 12 additions & 4 deletions doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ the Kokkos dense matrix e.g.,
sunctx};
Instances of the ``DenseMatrix`` class are implicitly or explicitly (using the
:cpp:func:`~DenseMatrix::Convert` method) convertible to a :c:type:`SUNMatrix`
:cpp:func:`~DenseMatrix::get` method) convertible to a :c:type:`SUNMatrix`
e.g.,

.. code-block:: cpp
sundials::kokkos::DenseMatrix<> A{rows, cols, sunctx};
SUNMatrix B = A; // implicit conversion to SUNMatrix
SUNMatrix C = A.Convert(); // explicit conversion to SUNMatrix
SUNMatrix C = A.get(); // explicit conversion to SUNMatrix
No further interaction with a ``DenseMatrix`` is required from this point, and
it is possible to use the :c:type:`SUNMatrix` API to operate on ``B`` or ``C``.
Expand Down Expand Up @@ -235,14 +235,22 @@ class.

Implicit conversion to a :c:type:`SUNMatrix`.

.. cpp:function:: SUNMatrix Convert() override
.. cpp:function:: SUNMatrix get() override

Explicit conversion to a :c:type:`SUNMatrix`.

.. cpp:function:: SUNMatrix Convert() const override
.. versionadded:: x.y.z

Replaces the ``Convert`` method which was deprecated and moved to the ``ConvertibleTo`` class.

.. cpp:function:: SUNMatrix get() const override

Explicit conversion to a :c:type:`SUNMatrix`.

.. versionadded:: x.y.z

Replaces the ``Convert`` method which was deprecated and moved to the ``ConvertibleTo`` class.

.. cpp:function:: template<class ExecutionSpace = Kokkos::DefaultExecutionSpace, \
class MemorySpace = typename ExecutionSpace::memory_space> \
inline DenseMatrix<MatrixType>* GetDenseMat(SUNMatrix A)
Expand Down
Loading