Skip to content

Commit 7215b89

Browse files
drreynoldsSteven-Robertsgardner48
committed
Command-line control over scalar-valued set routines (#662)
Add functions to set options from command line args --------- Co-authored-by: Steven Roberts <roberts115@llnl.gov> Co-authored-by: David J. Gardner <gardner48@llnl.gov>
1 parent 7df148d commit 7215b89

File tree

193 files changed

+9810
-118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+9810
-118
lines changed

doc/arkode/guide/source/Usage/ARKStep/User_callable.rst

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,8 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int
12551255
pointers *fe* or *fi* passed to :c:func:`ARKStepCreate` are
12561256
``NULL``, but may be set directly by the user if desired.
12571257
1258+
This routine will be called by :c:func:`ARKodeSetOptions`
1259+
when using the key "arkid.imex".
12581260
12591261
12601262
.. c:function:: int ARKStepSetExplicit(void* arkode_mem)
@@ -1279,6 +1281,8 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int
12791281
f(t,y)`, then we recommend that the ERKStep time-stepper module be
12801282
used instead.
12811283
1284+
This routine will be called by :c:func:`ARKodeSetOptions`
1285+
when using the key "arkid.explicit".
12821286
12831287
.. c:function:: int ARKStepSetImplicit(void* arkode_mem)
12841288
@@ -1298,6 +1302,9 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int
12981302
passed to :c:func:`ARKStepCreate` is ``NULL``, but may be set
12991303
directly by the user if desired.
13001304
1305+
This routine will be called by :c:func:`ARKodeSetOptions`
1306+
when using the key "arkid.implicit".
1307+
13011308
13021309
13031310
.. c:function:: int ARKStepSetTables(void* arkode_mem, int q, int p, ARKodeButcherTable Bi, ARKodeButcherTable Be)
@@ -1437,6 +1444,10 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int
14371444
In all cases, error-checking is performed to ensure that the tables
14381445
exist.
14391446
1447+
This routine will be called by :c:func:`ARKodeSetOptions`
1448+
when using the key "arkid.table_names".
1449+
1450+
14401451
**Warning:**
14411452
This should not be used with :c:func:`ARKodeSetOrder`.
14421453
@@ -1623,7 +1634,7 @@ Optional inputs for time step adaptivity
16231634
.. deprecated:: 5.7.0
16241635
16251636
Use the SUNAdaptController infrastructure instead (see :numref:`SUNAdaptController.Description`).
1626-
1637+
16271638
.. versionchanged:: 6.3.0
16281639
16291640
The default value was changed from 1.5 to 1.0
@@ -1649,7 +1660,7 @@ Optional inputs for time step adaptivity
16491660
.. deprecated:: 6.1.0
16501661
16511662
Use :c:func:`ARKodeSetFixedStepBounds` instead.
1652-
1663+
16531664
.. versionchanged:: 6.3.0
16541665
16551666
The default upper bound was changed from 1.5 to 1.0
@@ -1793,7 +1804,7 @@ Optional inputs for time step adaptivity
17931804
.. deprecated:: 6.1.0
17941805
17951806
Use :c:func:`ARKodeSetSafetyFactor` instead.
1796-
1807+
17971808
.. versionchanged:: 6.3.0
17981809
17991810
The default default was changed from 0.96 to 0.9. The maximum value is now

doc/arkode/guide/source/Usage/ERKStep/User_callable.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,10 @@ Optional inputs for IVP method selection
934934
**Warning:**
935935
This should not be used with :c:func:`ARKodeSetOrder`.
936936
937+
.. note::
937938
939+
This routine will be called by :c:func:`ARKodeSetOptions`
940+
when using the key "arkid.table_name".
938941
939942
940943
.. _ARKODE.Usage.ERKStep.ERKStepAdaptivityInput:
@@ -1122,7 +1125,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`.
11221125
.. deprecated:: 5.7.0
11231126
11241127
Use the SUNAdaptController infrastructure instead (see :numref:`SUNAdaptController.Description`).
1125-
1128+
11261129
.. versionchanged:: 6.3.0
11271130
11281131
The default value was changed from 1.5 to 1.0
@@ -1149,7 +1152,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`.
11491152
.. deprecated:: 6.1.0
11501153
11511154
Use :c:func:`ARKodeSetFixedStepBounds` instead.
1152-
1155+
11531156
.. versionchanged:: 6.3.0
11541157
11551158
The default upper bound was changed from 1.5 to 1.0
@@ -1274,7 +1277,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`.
12741277
.. deprecated:: 6.1.0
12751278
12761279
Use :c:func:`ARKodeSetSafetyFactor` instead.
1277-
1280+
12781281
.. versionchanged:: 6.3.0
12791282
12801283
The default default was changed from 0.96 to 0.9. The maximum value is now

doc/arkode/guide/source/Usage/LSRKStep/User_callable.rst

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ Allowable Method Families
156156
* *ARK_SUCCESS* if successful
157157
* *ARK_ILL_INPUT* if an argument had an illegal value (e.g. typo in the method name).
158158

159+
.. note::
160+
161+
This routine will be called by :c:func:`ARKodeSetOptions`
162+
when using the key "arkid.sts_method_name".
159163

160164
.. c:function:: int LSRKStepSetSSPMethodByName(void* arkode_mem, const char* emethod);
161165
@@ -171,6 +175,10 @@ Allowable Method Families
171175
* *ARK_SUCCESS* if successful
172176
* *ARK_ILL_INPUT* if an argument had an illegal value (e.g. typo in the method name).
173177

178+
.. note::
179+
180+
This routine will be called by :c:func:`ARKodeSetOptions`
181+
when using the key "arkid.ssp_method_name".
174182

175183
.. c:function:: int LSRKStepSetDomEigFn(void* arkode_mem, ARKDomEigFn dom_eig);
176184
@@ -187,7 +195,9 @@ Allowable Method Families
187195
* *ARKLS_MEM_NULL* if ``arkode_mem`` was ``NULL``.
188196
* *ARK_ILL_INPUT* ``dom_eig = NULL`` and LSRKStep does not currently estimate this internally.
189197

190-
.. note:: This function is currently required when either the RKC or RKL methods are used.
198+
.. note::
199+
200+
This function is currently required when either the RKC or RKL methods are used.
191201

192202

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

206-
.. note:: If LSRKStepSetDomEigFrequency routine is not called, then the default ``nsteps`` is set to :math:`25` as recommended in :cite:p:`VSH:04`.
207-
Calling this function with ``nsteps < 0`` resets the default value while ``nsteps = 0`` refers to constant dominant eigenvalue.
216+
.. note::
217+
218+
If LSRKStepSetDomEigFrequency routine is not called, then the default ``nsteps``
219+
is set to :math:`25` as recommended in :cite:p:`VSH:04`.
220+
221+
Calling this function with ``nsteps < 0`` resets the default value while
222+
``nsteps = 0`` refers to constant dominant eigenvalue.
208223

224+
This routine will be called by :c:func:`ARKodeSetOptions`
225+
when using the key "arkid.dom_eig_frequency".
209226

210227
.. c:function:: int LSRKStepSetMaxNumStages(void* arkode_mem, int stage_max_limit);
211228
@@ -220,10 +237,18 @@ Allowable Method Families
220237
* *ARK_SUCCESS* if successful
221238
* *ARKLS_MEM_NULL* if ``arkode_mem`` was ``NULL``.
222239

223-
.. note:: If LSRKStepSetMaxNumStages routine is not called, then the default ``stage_max_limit`` is
224-
set to :math:`200`. Calling this function with ``stage_max_limit < 2`` resets the default value.
225-
This limit should be chosen with consideration of the following proportionality: :math:`s^2 \sim - h\lambda`,
226-
where :math:`s` is the number of stages used, :math:`h` is the current step size and :math:`\lambda` is the dominant eigenvalue.
240+
.. note::
241+
242+
If LSRKStepSetMaxNumStages routine is not called, then the default ``stage_max_limit``
243+
is set to :math:`200`. Calling this function with ``stage_max_limit < 2`` resets the
244+
default value.
245+
246+
This limit should be chosen with consideration of the following proportionality:
247+
:math:`s^2 \sim - h\lambda`, where :math:`s` is the number of stages used, :math:`h`
248+
is the current step size and :math:`\lambda` is the dominant eigenvalue.
249+
250+
This routine will be called by :c:func:`ARKodeSetOptions`
251+
when using the key "arkid.max_num_stages".
227252

228253

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

244-
.. note:: If LSRKStepSetDomEigSafetyFactor routine is not called, then the default ``dom_eig_safety`` is
245-
set to :math:`1.01`. Calling this function with ``dom_eig_safety < 1`` resets the default value.
269+
.. note::
270+
271+
If LSRKStepSetDomEigSafetyFactor routine is not called, then the default
272+
``dom_eig_safety`` is set to :math:`1.01`. Calling this function with
273+
``dom_eig_safety < 1`` resets the default value.
274+
275+
This routine will be called by :c:func:`ARKodeSetOptions`
276+
when using the key "arkid.dom_eig_safety_factor".
246277

247278

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

265-
.. note:: If LSRKStepSetNumSSPStages routine is not called, then the default ``num_of_stages`` is
266-
set. Calling this function with ``num_of_stages <= 0`` resets the default values:
296+
.. note::
297+
298+
If LSRKStepSetNumSSPStages routine is not called, then the default ``num_of_stages``
299+
is set. Calling this function with ``num_of_stages <= 0`` resets the default values:
300+
301+
* ``num_of_stages = 10`` for :c:enumerator:`ARKODE_LSRK_SSP_S_2`
302+
* ``num_of_stages = 9`` for :c:enumerator:`ARKODE_LSRK_SSP_S_3`
303+
* ``num_of_stages = 10`` for :c:enumerator:`ARKODE_LSRK_SSP_10_4`
267304

268-
* ``num_of_stages = 10`` for :c:enumerator:`ARKODE_LSRK_SSP_S_2`
269-
* ``num_of_stages = 9`` for :c:enumerator:`ARKODE_LSRK_SSP_S_3`
270-
* ``num_of_stages = 10`` for :c:enumerator:`ARKODE_LSRK_SSP_10_4`
305+
This routine will be called by :c:func:`ARKodeSetOptions`
306+
when using the key "arkid.num_ssp_stages".
271307

272308
.. _ARKODE.Usage.LSRKStep.OptionalOutputs:
273309

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

361397
.. note::
398+
362399
All previously set options are retained but may be updated by calling
363400
the appropriate "Set" functions.
364401

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

388425
.. note::
426+
389427
All previously set options are retained but may be updated by calling
390428
the appropriate "Set" functions.
391429

doc/arkode/guide/source/Usage/MRIStep/User_callable.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,11 @@ Optional inputs for IVP method selection
800800
For a description of the :c:type:`MRIStepCoupling` type and related
801801
functions for creating Butcher tables see :numref:`ARKODE.Usage.MRIStep.MRIStepCoupling`.
802802
803+
This routine will be called by :c:func:`ARKodeSetOptions`
804+
when using the key "arkid.coupling_table_name", where ``C``
805+
is itself constructed by passing the command-line option to
806+
:c:func:`MRIStepCoupling_LoadTableByName`.
807+
803808
.. warning::
804809
805810
This should not be used with :c:func:`ARKodeSetOrder`.

doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,11 @@ Optional inputs for IVP method selection
479479
:retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL``
480480
:retval ARK_ILL_INPUT: if an argument had an illegal value
481481
482+
.. note::
483+
484+
This routine will be called by :c:func:`ARKodeSetOptions`
485+
when using the key "arkid.method_name".
486+
482487
.. warning::
483488
484489
This should not be used with :c:func:`ARKodeSetOrder`.
@@ -506,7 +511,6 @@ Optional inputs for IVP method selection
506511
Use :c:func:`ARKodeSetUseCompensatedSums` instead.
507512
508513
509-
510514
.. _ARKODE.Usage.SPRKStep.SPRKStepRootfindingInput:
511515
512516

doc/arkode/guide/source/Usage/SplittingStep/User_callable.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ SplittingStep initialization functions
8282
**Example codes:**
8383
* ``examples/arkode/C_serial/ark_advection_diffusion_reaction_splitting.c``
8484
* ``examples/arkode/C_serial/ark_analytic_partitioned.c``
85-
85+
8686
.. versionadded:: 6.2.0
8787

8888

@@ -106,10 +106,15 @@ Optional inputs for IVP method selection
106106
related functions for creating splitting coefficients see
107107
:numref:`ARKODE.Usage.SplittingStep.SplittingStepCoefficients`.
108108
109+
This routine will be called by :c:func:`ARKodeSetOptions`
110+
when using the key "arkid.coefficients_name", where ``coefficients``
111+
is itself constructed by passing the command-line option to
112+
:c:func:`SplittingStepCoefficients_LoadCoefficientsByName`.
113+
109114
.. warning::
110115
111116
This should not be used with :c:func:`ARKodeSetOrder`.
112-
117+
113118
.. versionadded:: 6.2.0
114119
115120
@@ -133,7 +138,7 @@ Optional output functions
133138
:retval ARK_SUCCESS: if successful
134139
:retval ARK_MEM_NULL: if the SplittingStep memory was ``NULL``
135140
:retval ARK_ILL_INPUT: if *partition* was out of bounds
136-
141+
137142
.. versionadded:: 6.2.0
138143
139144
@@ -208,5 +213,5 @@ the ODE and the :c:type:`SUNStepper` objects used to evolve each partition.
208213
will be reset since they are no longer compatible. Otherwise, all
209214
previously set options are retained but may be updated by calling the
210215
appropriate "Set" functions.
211-
216+
212217
.. versionadded:: 6.2.0

0 commit comments

Comments
 (0)