TimeStepperSUNDIALS_IDA_impl< VectorType, SparseMatrixType, dim, LinearSolver > Class Template Reference#
|
DiFfRG
Discretization Framework for functional Renormalization Group flows
|
Implicit, adaptive time stepping with SUNDIALS IDA (variable-order BDF, order 1 to 5). More...
#include <sundials_ida.hh>
Public Types | |
| using | NumberType = typename Base::NumberType |
| using | BlockVectorType = typename Base::BlockVectorType |
| using | IDAErrorDofCallback = std::function<void(const IDAErrorDofDiagnostics &)> |
Public Member Functions | |
| TimeStepperSUNDIALS_IDA_impl (const ConfigTree &config, AbstractAssembler< VectorType, SparseMatrixType, dim > &assembler, OutputSession_impl< dim, VectorType > &data_out) | |
| Construct without mesh adaptation; see AbstractTimestepper. | |
| TimeStepperSUNDIALS_IDA_impl (const ConfigTree &config, AbstractAssembler< VectorType, SparseMatrixType, dim > &assembler, OutputSession_impl< dim, VectorType > &data_out, AbstractAdaptor< VectorType > &adaptor) | |
| Construct with a mesh adaptor; see AbstractTimestepper. | |
| virtual void | run_segment (AbstractFlowingVariables< NumberType, VectorType > &initial_condition, const double t_start, const double t_stop) override |
| Any derived class must implement this method to run the timestepping algorithm. | |
| void | set_ida_error_dof_callback (IDAErrorDofCallback callback) |
| Called with every report of /timestepping/implicit/ida_error_dof_diagnostics, in addition to the log. | |
Public Member Functions inherited from AbstractTimestepper< VectorType, SparseMatrixType, dim > | |
| AbstractTimestepper (const ConfigTree &config, AbstractAssembler< VectorType, SparseMatrixType, dim > &assembler, OutputSession_impl< dim, VectorType > &data_out, const bool implicit_stepper, const bool explicit_stepper) | |
| Construct without mesh adaptation. | |
| AbstractTimestepper (const ConfigTree &config, AbstractAssembler< VectorType, SparseMatrixType, dim > &assembler, OutputSession_impl< dim, VectorType > &data_out, AbstractAdaptor< VectorType > &adaptor, const bool implicit_stepper, const bool explicit_stepper) | |
| Construct with a mesh adaptor, which is called between steps (where the stepper supports it, see abstract_timestepper.hh). | |
| void | run (AbstractFlowingVariables< NumberType, VectorType > &initial_condition, double t_start, const double t_stop) |
Evolve initial_condition from t_start to t_stop. | |
| bool | is_implicit () const |
| Whether this stepper reads /timestepping/implicit. | |
| bool | is_explicit () const |
| Whether this stepper reads /timestepping/explicit. | |
Detailed Description
class DiFfRG::TimeStepperSUNDIALS_IDA_impl< VectorType, SparseMatrixType, dim, LinearSolver >
Implicit, adaptive time stepping with SUNDIALS IDA (variable-order BDF, order 1 to 5).
IDA solves the system in residual form, \(F(t, y, \dot y) = 0\), with \(y = (u, v)\) and
\[ F_u = m(u, \dot u) + R(u, v)\,, \qquad F_v = \dot v + D(v, u)\,, \]
see abstract_timestepper.hh for the notation. Each step solves \(F = 0\) by Newton's method with the matrix \(\partial F/\partial y + \alpha\, \partial F/\partial \dot y\), where \(\alpha\) is set by IDA from the step size and the BDF order. The \(u\)- and \(v\)-blocks of this matrix are built separately, i.e. the couplings \(\partial F_u/\partial v\) and \(\partial F_v/\partial u\) are left out; they slow Newton's convergence but do not change the solution.
Components of \(u\) whose mass term does not depend on \(\dot u\) are algebraic constraints; they are excluded from the error test. At the start and after every restart (e.g. after mesh adaptation), IDA computes the algebraic components and the \(\dot u\) of the others from \(F = 0\). Output is written at exactly \(t_\text{start} + n\, \mathrm{output\_dt}\), interpolated by IDA.
Handles FE problems with or without variables, and pure-variables systems (dim == 0). Distributed linear algebra is supported. A callback that fails (non-finite state or residual, an exception from the model, a failed factorization or linear solve) makes IDA retry with a smaller step; the run aborts after 200 consecutive failures or if the time stops advancing.
Reads /timestepping/implicit, see abstract_timestepper.hh.
- Template Parameters
-
VectorType vector type of the assembler. SparseMatrixType sparse matrix type of the assembler. dim spatial dimension, 0 for a pure-variables system. LinearSolver solver for the Newton systems; see DefaultLinearSolver.
Member Typedef Documentation
◆ BlockVectorType
| using BlockVectorType = typename Base::BlockVectorType |
◆ IDAErrorDofCallback
| using IDAErrorDofCallback = std::function<void(const IDAErrorDofDiagnostics &)> |
◆ NumberType
| using NumberType = typename Base::NumberType |
Constructor & Destructor Documentation
◆ TimeStepperSUNDIALS_IDA_impl() [1/2]
|
inline |
Construct without mesh adaptation; see AbstractTimestepper.
◆ TimeStepperSUNDIALS_IDA_impl() [2/2]
|
inline |
Construct with a mesh adaptor; see AbstractTimestepper.
Member Function Documentation
◆ run_segment()
|
overridevirtual |
Any derived class must implement this method to run the timestepping algorithm.
It must return the state at t_stop in initial_condition, because run() writes snapshots from it. Called once per segment, i.e. possibly several times per run() with consecutive intervals.
- Parameters
-
initial_condition The flowing variables object that contains the initial condition. t_start The start time of the segment. t_stop The end time of the segment.
Implements AbstractTimestepper< VectorType, SparseMatrixType, dim >.
◆ set_ida_error_dof_callback()
|
inline |
Called with every report of /timestepping/implicit/ida_error_dof_diagnostics, in addition to the log.
The documentation for this class was generated from the following file:
- /home/runner/work/DiFfRG/DiFfRG/DiFfRG/include/DiFfRG/timestepping/sundials_ida.hh
Generated by
Public Member Functions inherited from