Skip to content

Commit d4ee01f

Browse files
committed
finish
1 parent 1a81667 commit d4ee01f

File tree

1 file changed

+66
-23
lines changed

1 file changed

+66
-23
lines changed

sphinx_docs/source/ode_integrators.rst

Lines changed: 66 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
.. _ch:networks:integrators:
22

3-
*********************
4-
Available Integrators
5-
*********************
3+
***************
4+
ODE Integrators
5+
***************
66

7+
Available integrators
8+
=====================
79

810
We use a high-order implicit ODE solver for integrating the reaction
911
system. A few alternatives, including first order implicit and explicit integrators are also
@@ -62,12 +64,6 @@ robust.
6264

6365
.. index:: integrator.scale_system
6466

65-
.. important::
66-
67-
The integrator will not abort if it encounters trouble. Instead it will
68-
set ``burn_t burn_state.success = false`` on exit. It is up to the
69-
application code to handle the failure.
70-
7167
.. note::
7268

7369
The runtime parameter ``integrator.scale_system``
@@ -83,6 +79,67 @@ robust.
8379

8480
This option currently does not work with the ForwardEuler or QSS integrators.
8581

82+
Timestep selection
83+
==================
84+
85+
All of the integrators will select the timestep internally to meet the
86+
tolerances. There are 2 controls that affect timestepping:
87+
88+
* ``integrator.ode_max_dt`` : sets the maximum allowed timestep
89+
90+
* ``integrator.ode_max_steps`` : sets the maximum number of steps
91+
the integrator is allowed to take. If it exceeds this, then
92+
it will return an error.
93+
94+
95+
Linear algebra
96+
==============
97+
98+
All implicit integrators use the LINPACK LU decomposition routines.
99+
100+
For the templated networks (``aprox13``, ``aprox19``, ...) the implementation
101+
is done using ``consexpr`` loops over the equations and no pivoting is allowed.
102+
103+
.. index:: integrator.linalg_do_pivoting
104+
105+
For the other networks (usually pynucastro networks), the implementation is
106+
provided in ``Microphysics/util/linpack.H`` and is templated on the number
107+
of equations. Pivoting can be disabled by setting ``integrator.linalg_do_pivoting=0``.
108+
109+
Integration errors
110+
==================
111+
112+
.. important::
113+
114+
The integrator will not abort if it encounters trouble. Instead it will
115+
set ``burn_t burn_state.success = false`` on exit. It is up to the
116+
application code to handle the failure.
117+
118+
The ``burn_t`` ``error_code`` field will provide an error code that can be
119+
used to interpret the failure. The current codes are:
120+
121+
+-------+----------------------------------------------------------+
122+
| code | meaning |
123+
+=======+==========================================================+
124+
| 1 | success |
125+
+-------+----------------------------------------------------------+
126+
| -1 | invalid inputs |
127+
+-------+----------------------------------------------------------+
128+
| -2 | underflow in computing $\Delta t$ |
129+
+-------+----------------------------------------------------------+
130+
| -3 | spectral radius estimation did not converge |
131+
+-------+----------------------------------------------------------+
132+
| -4 | too many steps needed |
133+
+-------+----------------------------------------------------------+
134+
| -5 | unable to meet the accuracy demanded by the tolerances |
135+
+-------+----------------------------------------------------------+
136+
| -6 | non-convergence in the corrector iteration |
137+
+-------+----------------------------------------------------------+
138+
| -7 | LU decomposition failed |
139+
+-------+----------------------------------------------------------+
140+
| -100 | entered NSE |
141+
+-------+----------------------------------------------------------+
142+
86143
Tolerances
87144
==========
88145

@@ -238,17 +295,3 @@ The runtime parameters that come into play when doing the retry are:
238295
``integrator.ode_max_steps`` to a small value (like ``10000``) and
239296
start with the analytic Jacobian (``integrator.jacobian = 1``) and
240297
then use the retry mechanism to swap the Jacobian on any zones that fail.
241-
242-
243-
Overriding Parameter Defaults on a Network-by-Network Basis
244-
===========================================================
245-
246-
Any network can override or add to any of the existing runtime
247-
parameters by creating a ``_parameters`` file in the network directory
248-
(e.g., ``networks/triple_alpha_plus_cago/_parameters``). As noted in
249-
:doc:`rp_intro`, the fourth column in the ``_parameter``
250-
file definition is the *priority*. When a duplicate parameter is
251-
encountered by the scripts writing the runtime parameter header files, the value
252-
of the parameter with the highest priority is used. So picking a large
253-
integer value for the priority in a network’s ``_parameter`` file will
254-
ensure that it takes precedence.

0 commit comments

Comments
 (0)