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

Command-line control over scalar-valued set routines #662

Open
wants to merge 54 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2e4a100
Initial implementation of command-line control over ARKODE inputs
drreynolds Feb 6, 2025
4ee0ced
Added const qualifier
drreynolds Feb 6, 2025
7fe32c7
Apply suggestions from code review
drreynolds Feb 25, 2025
567d885
Additional updates based on PR feedback
drreynolds Feb 25, 2025
834be77
Added const for char* argv[] to subsidiary functions
drreynolds Feb 25, 2025
843b240
Converted separate arrays to arrays of structs
drreynolds Feb 26, 2025
81da918
Removed const decorator from argv inputs to ARKodeSetFromCommandLine,…
drreynolds Feb 26, 2025
ccb3a0d
Updated swig interfaces
drreynolds Feb 26, 2025
3ff1574
Updated handling of errors when setting command-line arguments
drreynolds Feb 26, 2025
5697de0
Updated ARKodeSetFromCommandLine to include an input 'arkid' that sho…
drreynolds Feb 26, 2025
229c013
Updated swig interfaces
drreynolds Feb 26, 2025
6d55e2d
Updated comment
drreynolds Feb 26, 2025
f88f66b
Updated formatting
drreynolds Feb 26, 2025
9a552b9
Updated type for 'offset' to size_t to avoid conversion warnings/errors
drreynolds Feb 26, 2025
62fecac
Apply suggestions from code review to automatically determine the num…
drreynolds Feb 27, 2025
3eece32
Moved command-line input control to a separate file
drreynolds Feb 27, 2025
17000e9
Updated handling of arkid input according to Steven's suggestion
drreynolds Feb 27, 2025
cbdaf2d
Updated includes now that cli interface is separated into a new file
drreynolds Feb 27, 2025
44abb69
Added support for a new writeparameters command-line option, that wil…
drreynolds Feb 27, 2025
d65c219
Added function pointer for stepper-specific setfromcommandline functi…
drreynolds Feb 27, 2025
60e3287
Added placeholder for ARKStep command-line processing (needs to be fi…
drreynolds Feb 27, 2025
20e3232
Moved typedefs and general CLI utility routines up to SUNDIALS level,…
drreynolds Mar 2, 2025
00991b5
Added command-line support to ARKStep
drreynolds Mar 2, 2025
a451341
Added command-line support to ERKStep
drreynolds Mar 2, 2025
4880960
Added command-line support to SPRKStep and LSRKStep
drreynolds Mar 2, 2025
961ed95
Added command-line support to MRIStep
drreynolds Mar 3, 2025
dd29861
Added command-line support to ark_kpr_mri.c for manual testing (passes)
drreynolds Mar 3, 2025
c175f56
Formatting
drreynolds Mar 3, 2025
b1fd734
Update src/arkode/arkode_cli.c
drreynolds Mar 12, 2025
d24a61a
Moved sundials_cli.h to src/sundials
drreynolds Mar 12, 2025
a0e5a17
Added ARKODE command-line control for linear solver set routines
drreynolds Mar 12, 2025
459c58b
Added command-line control for CVODE
drreynolds Mar 12, 2025
d35479e
Added command-line control for CVODE
drreynolds Mar 12, 2025
3a9a4ff
Added command-line control to CVODES
drreynolds Mar 13, 2025
0c525e0
Added command-line control to IDA
drreynolds Mar 13, 2025
8cc31f8
Added command-line control to IDAS
drreynolds Mar 13, 2025
d67bd22
Added command-line control to KINSOL
drreynolds Mar 13, 2025
7db9133
Regenerated SWIG interfaces
drreynolds Mar 13, 2025
f747539
Formatting
drreynolds Mar 13, 2025
1e6f96f
Applied spelling 'patch', that forced me to rename the long-int varia…
drreynolds Mar 13, 2025
cefc028
Added command-line control over SUNAdaptControllers
drreynolds Mar 14, 2025
b276550
Updated Swig interfaces
drreynolds Mar 14, 2025
f0cc756
Added command-line control over SUNLinearSolvers
drreynolds Mar 16, 2025
1aced24
Fixed unused variable warning/error
drreynolds Mar 16, 2025
29dfdce
Fixed unused variable warning/error
drreynolds Mar 16, 2025
7fc20d1
formatting
drreynolds Mar 16, 2025
63466df
Minor updates to hopeflly fix build on Windows/MSVC
drreynolds Mar 16, 2025
16dfb96
Fixed missing include
drreynolds Mar 16, 2025
e35b1bf
Fixed missing include
drreynolds Mar 16, 2025
575a86f
formatting
drreynolds Mar 16, 2025
4ab74ca
Added missing SUNDIALS_EXPORT
drreynolds Mar 16, 2025
e4c57e0
Removed explicit cast that I introduced when trying to resolve Window…
drreynolds Mar 16, 2025
bb35002
formatting
drreynolds Mar 16, 2025
ef344c6
Added documentation for command-line control
drreynolds Mar 23, 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
11 changes: 11 additions & 0 deletions doc/arkode/guide/source/Usage/ARKStep/User_callable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,8 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int
pointers *fe* or *fi* passed to :c:func:`ARKStepCreate` are
``NULL``, but may be set directly by the user if desired.

This routine will be called by :c:func:`ARKodeSetFromCommandLine`
when using the command-line option "arkid.set_imex".


.. c:function:: int ARKStepSetExplicit(void* arkode_mem)
Expand All @@ -1279,6 +1281,8 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int
f(t,y)`, then we recommend that the ERKStep time-stepper module be
used instead.

This routine will be called by :c:func:`ARKodeSetFromCommandLine`
when using the command-line option "arkid.set_explicit".

.. c:function:: int ARKStepSetImplicit(void* arkode_mem)

Expand All @@ -1298,6 +1302,9 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int
passed to :c:func:`ARKStepCreate` is ``NULL``, but may be set
directly by the user if desired.

This routine will be called by :c:func:`ARKodeSetFromCommandLine`
when using the command-line option "arkid.set_implicit".



.. c:function:: int ARKStepSetTables(void* arkode_mem, int q, int p, ARKodeButcherTable Bi, ARKodeButcherTable Be)
Expand Down Expand Up @@ -1437,6 +1444,10 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int
In all cases, error-checking is performed to ensure that the tables
exist.

This routine will be called by :c:func:`ARKodeSetFromCommandLine`
when using the command-line option "arkid.table_names".


**Warning:**
This should not be used with :c:func:`ARKodeSetOrder`.

Expand Down
3 changes: 3 additions & 0 deletions doc/arkode/guide/source/Usage/ERKStep/User_callable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,10 @@ Optional inputs for IVP method selection
**Warning:**
This should not be used with :c:func:`ARKodeSetOrder`.

.. note::

This routine will be called by :c:func:`ARKodeSetFromCommandLine`
when using the command-line option "arkid.table_name".


.. _ARKODE.Usage.ERKStep.ERKStepAdaptivityInput:
Expand Down
66 changes: 52 additions & 14 deletions doc/arkode/guide/source/Usage/LSRKStep/User_callable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ Allowable Method Families
* *ARK_SUCCESS* if successful
* *ARK_ILL_INPUT* if an argument had an illegal value (e.g. typo in the method name).

.. note::

This routine will be called by :c:func:`ARKodeSetFromCommandLine`
when using the command-line option "arkid.sts_method".

.. c:function:: int LSRKStepSetSSPMethodByName(void* arkode_mem, const char* emethod);

Expand All @@ -171,6 +175,10 @@ Allowable Method Families
* *ARK_SUCCESS* if successful
* *ARK_ILL_INPUT* if an argument had an illegal value (e.g. typo in the method name).

.. note::

This routine will be called by :c:func:`ARKodeSetFromCommandLine`
when using the command-line option "arkid.ssp_method".

.. c:function:: int LSRKStepSetDomEigFn(void* arkode_mem, ARKDomEigFn dom_eig);

Expand All @@ -187,7 +195,9 @@ Allowable Method Families
* *ARKLS_MEM_NULL* if ``arkode_mem`` was ``NULL``.
* *ARK_ILL_INPUT* ``dom_eig = NULL`` and LSRKStep does not currently estimate this internally.

.. note:: This function is currently required when either the RKC or RKL methods are used.
.. note::

This function is currently required when either the RKC or RKL methods are used.


.. c:function:: int LSRKStepSetDomEigFrequency(void* arkode_mem, long int nsteps);
Expand All @@ -203,9 +213,16 @@ Allowable Method Families
* *ARK_SUCCESS* if successful
* *ARKLS_MEM_NULL* if ``arkode_mem`` was ``NULL``.

.. note:: If LSRKStepSetDomEigFrequency routine is not called, then the default ``nsteps`` is set to :math:`25` as recommended in :cite:p:`VSH:04`.
Calling this function with ``nsteps < 0`` resets the default value while ``nsteps = 0`` refers to constant dominant eigenvalue.
.. note::

If LSRKStepSetDomEigFrequency routine is not called, then the default ``nsteps``
is set to :math:`25` as recommended in :cite:p:`VSH:04`.

Calling this function with ``nsteps < 0`` resets the default value while
``nsteps = 0`` refers to constant dominant eigenvalue.

This routine will be called by :c:func:`ARKodeSetFromCommandLine`
when using the command-line option "arkid.dom_eig_frequency".

.. c:function:: int LSRKStepSetMaxNumStages(void* arkode_mem, int stage_max_limit);

Expand All @@ -220,10 +237,18 @@ Allowable Method Families
* *ARK_SUCCESS* if successful
* *ARKLS_MEM_NULL* if ``arkode_mem`` was ``NULL``.

.. note:: If LSRKStepSetMaxNumStages routine is not called, then the default ``stage_max_limit`` is
set to :math:`200`. Calling this function with ``stage_max_limit < 2`` resets the default value.
This limit should be chosen with consideration of the following proportionality: :math:`s^2 \sim - h\lambda`,
where :math:`s` is the number of stages used, :math:`h` is the current step size and :math:`\lambda` is the dominant eigenvalue.
.. note::

If LSRKStepSetMaxNumStages routine is not called, then the default ``stage_max_limit``
is set to :math:`200`. Calling this function with ``stage_max_limit < 2`` resets the
default value.

This limit should be chosen with consideration of the following proportionality:
:math:`s^2 \sim - h\lambda`, where :math:`s` is the number of stages used, :math:`h`
is the current step size and :math:`\lambda` is the dominant eigenvalue.

This routine will be called by :c:func:`ARKodeSetFromCommandLine`
when using the command-line option "arkid.max_num_stages".


.. c:function:: int LSRKStepSetDomEigSafetyFactor(void* arkode_mem, sunrealtype dom_eig_safety);
Expand All @@ -241,8 +266,14 @@ Allowable Method Families
* *ARK_SUCCESS* if successful
* *ARKLS_MEM_NULL* if ``arkode_mem`` was ``NULL``.

.. note:: If LSRKStepSetDomEigSafetyFactor routine is not called, then the default ``dom_eig_safety`` is
set to :math:`1.01`. Calling this function with ``dom_eig_safety < 1`` resets the default value.
.. note::

If LSRKStepSetDomEigSafetyFactor routine is not called, then the default
``dom_eig_safety`` is set to :math:`1.01`. Calling this function with
``dom_eig_safety < 1`` resets the default value.

This routine will be called by :c:func:`ARKodeSetFromCommandLine`
when using the command-line option "arkid.dom_eig_safety_factor".


.. c:function:: int LSRKStepSetNumSSPStages(void* arkode_mem, int num_of_stages);
Expand All @@ -262,12 +293,17 @@ Allowable Method Families
* *ARKLS_MEM_NULL* if ``arkode_mem`` was ``NULL``.
* *ARK_ILL_INPUT* if an argument had an illegal value (e.g. SSP method is not declared)

.. note:: If LSRKStepSetNumSSPStages routine is not called, then the default ``num_of_stages`` is
set. Calling this function with ``num_of_stages <= 0`` resets the default values:
.. note::

If LSRKStepSetNumSSPStages routine is not called, then the default ``num_of_stages``
is set. Calling this function with ``num_of_stages <= 0`` resets the default values:

* ``num_of_stages = 10`` for :c:enumerator:`ARKODE_LSRK_SSP_S_2`
* ``num_of_stages = 9`` for :c:enumerator:`ARKODE_LSRK_SSP_S_3`
* ``num_of_stages = 10`` for :c:enumerator:`ARKODE_LSRK_SSP_10_4`

* ``num_of_stages = 10`` for :c:enumerator:`ARKODE_LSRK_SSP_S_2`
* ``num_of_stages = 9`` for :c:enumerator:`ARKODE_LSRK_SSP_S_3`
* ``num_of_stages = 10`` for :c:enumerator:`ARKODE_LSRK_SSP_10_4`
This routine will be called by :c:func:`ARKodeSetFromCommandLine`
when using the command-line option "arkid.num_ssp_stages".

.. _ARKODE.Usage.LSRKStep.OptionalOutputs:

Expand Down Expand Up @@ -359,6 +395,7 @@ dependent variable vector.
* *ARK_ILL_INPUT* if an argument had an illegal value.

.. note::

All previously set options are retained but may be updated by calling
the appropriate "Set" functions.

Expand Down Expand Up @@ -386,6 +423,7 @@ dependent variable vector.
* *ARK_ILL_INPUT* if an argument had an illegal value.

.. note::

All previously set options are retained but may be updated by calling
the appropriate "Set" functions.

Expand Down
5 changes: 5 additions & 0 deletions doc/arkode/guide/source/Usage/MRIStep/User_callable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,11 @@ Optional inputs for IVP method selection
For a description of the :c:type:`MRIStepCoupling` type and related
functions for creating Butcher tables see :numref:`ARKODE.Usage.MRIStep.MRIStepCoupling`.

This routine will be called by :c:func:`ARKodeSetFromCommandLine`
when using the command-line option "arkid.coupling_table", where *C*
is itself constructed by passing the command-line option to
:c:func:`MRIStepCoupling_LoadTableByName`.

.. warning::

This should not be used with :c:func:`ARKodeSetOrder`.
Expand Down
10 changes: 10 additions & 0 deletions doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,11 @@ Optional inputs for IVP method selection
:retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL``
:retval ARK_ILL_INPUT: if an argument had an illegal value

.. note::

This routine will be called by :c:func:`ARKodeSetFromCommandLine`
when using the command-line option "arkid.method_name".

.. warning::

This should not be used with :c:func:`ARKodeSetOrder`.
Expand All @@ -501,6 +506,11 @@ Optional inputs for IVP method selection
:retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL``
:retval ARK_ILL_INPUT: if an argument had an illegal value

.. note::

This routine will be called by :c:func:`ARKodeSetFromCommandLine`
when using the command-line option "arkid.use_compensated_sums".



.. _ARKODE.Usage.SPRKStep.SPRKStepRootfindingInput:
Expand Down
Loading