deal.II version GIT relicensing-7155-g69b6eb7651 2026-11-23 20:20:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
SUNDIALS::IDA< VectorType >::AdditionalData Class Reference

#include <deal.II/sundials/ida.h>

Detailed Description

template<typename VectorType = Vector<double>>
class SUNDIALS::IDA< VectorType >::AdditionalData

Additional parameters that can be passed to the IDA class. Parameters are available independently of the SUNDIALS version. Options requiring a newer version are ignored when it is unavailable.

Definition at line 499 of file ida.h.

Public Types

enum  InitialConditionCorrection { none = 0 , use_y_diff = 1 , use_y_dot = 2 }
 

Public Member Functions

 AdditionalData (const double initial_time=0.0, const double final_time=1.0, const double initial_step_size=1e-2, const double output_period=1e-1, const double minimum_step_size=1e-15, const unsigned int maximum_order=5, const unsigned int maximum_non_linear_iterations=10, const double ls_norm_factor=0, const double absolute_tolerance=1e-6, const double relative_tolerance=1e-5, const bool ignore_algebraic_terms_for_errors=true, const InitialConditionCorrection &ic_type=use_y_diff, const InitialConditionCorrection &reset_type=use_y_diff, const unsigned int maximum_non_linear_iterations_ic=5, const double maximum_step_size=0.0, const long int maximum_number_of_steps=500, const unsigned int maximum_error_test_failures=10, const unsigned int maximum_convergence_failures=10, const double nonlinear_convergence_coefficient=0.33, const unsigned int maximum_number_of_steps_ic=5, const unsigned int maximum_number_of_jacobians_ic=4, const unsigned int maximum_number_of_backtracks_ic=100, const bool line_search_enabled_ic=true, const double step_tolerance_ic=std::pow(std::numeric_limits< double >::epsilon(), 2.0/3.0), const double nonlinear_convergence_coefficient_ic=0.0033, const double linear_tolerance_factor=0.05, const double increment_factor=1.0, const bool linear_solution_scaling=true, const double delta_cj_lsetup=0.25, const double eta_min=0.5, const double eta_max=2.0, const double eta_low=0.9, const double eta_min_err_fail=0.25, const double eta_conv_fail=0.25, const double eta_min_fixed=1.0, const double eta_max_fixed=2.0, const unsigned int maximum_constraint_failures=10)
 
void add_parameters (ParameterHandler &prm)
 

Public Attributes

double initial_time
 
double final_time
 
double initial_step_size
 
double minimum_step_size
 
double maximum_step_size = 0.0
 
long int maximum_number_of_steps = 500
 
unsigned int maximum_error_test_failures = 10
 
unsigned int maximum_convergence_failures = 10
 
double nonlinear_convergence_coefficient = 0.33
 
unsigned int maximum_number_of_steps_ic = 5
 
unsigned int maximum_number_of_jacobians_ic = 4
 
unsigned int maximum_number_of_backtracks_ic = 100
 
bool line_search_enabled_ic = true
 
double step_tolerance_ic
 
double nonlinear_convergence_coefficient_ic = 0.0033
 
double linear_tolerance_factor = 0.05
 
double increment_factor = 1.0
 
bool linear_solution_scaling = true
 
double delta_cj_lsetup = 0.25
 
double eta_min = 0.5
 
double eta_max = 2.0
 
double eta_low = 0.9
 
double eta_min_err_fail = 0.25
 
double eta_conv_fail = 0.25
 
double eta_min_fixed = 1.0
 
double eta_max_fixed = 2.0
 
unsigned int maximum_constraint_failures = 10
 
double absolute_tolerance
 
double relative_tolerance
 
unsigned int maximum_order
 
double output_period
 
bool ignore_algebraic_terms_for_errors
 
InitialConditionCorrection ic_type
 
InitialConditionCorrection reset_type
 
unsigned maximum_non_linear_iterations_ic
 
unsigned int maximum_non_linear_iterations
 
double ls_norm_factor
 

Member Enumeration Documentation

◆ InitialConditionCorrection

template<typename VectorType = Vector<double>>
enum SUNDIALS::IDA::AdditionalData::InitialConditionCorrection

IDA is a Differential Algebraic solver. As such, it requires initial conditions also for the first order derivatives. If you do not provide consistent initial conditions, (i.e., conditions for which \(F(\dot y(0), y(0), 0) = 0)\), you can ask SUNDIALS to compute initial conditions for you by specifying InitialConditionCorrection for the initial conditions both at the initial_time (ic_type) and after a reset has occurred (reset_type).

Enumerator
none 

Do not try to make initial conditions consistent.

use_y_diff 

Compute the algebraic components of \(y\) and differential components of \(\dot y\), given the differential components of \(y\). This option requires that the user specifies differential and algebraic components in the function IDA::differential_components().

use_y_dot 

Compute all components of \(y\), given \(\dot y\).

Definition at line 511 of file ida.h.

Constructor & Destructor Documentation

◆ AdditionalData()

template<typename VectorType = Vector<double>>
SUNDIALS::IDA< VectorType >::AdditionalData::AdditionalData ( const double  initial_time = 0.0,
const double  final_time = 1.0,
const double  initial_step_size = 1e-2,
const double  output_period = 1e-1,
const double  minimum_step_size = 1e-15,
const unsigned int  maximum_order = 5,
const unsigned int  maximum_non_linear_iterations = 10,
const double  ls_norm_factor = 0,
const double  absolute_tolerance = 1e-6,
const double  relative_tolerance = 1e-5,
const bool  ignore_algebraic_terms_for_errors = true,
const InitialConditionCorrection &  ic_type = use_y_diff,
const InitialConditionCorrection &  reset_type = use_y_diff,
const unsigned int  maximum_non_linear_iterations_ic = 5,
const double  maximum_step_size = 0.0,
const long int  maximum_number_of_steps = 500,
const unsigned int  maximum_error_test_failures = 10,
const unsigned int  maximum_convergence_failures = 10,
const double  nonlinear_convergence_coefficient = 0.33,
const unsigned int  maximum_number_of_steps_ic = 5,
const unsigned int  maximum_number_of_jacobians_ic = 4,
const unsigned int  maximum_number_of_backtracks_ic = 100,
const bool  line_search_enabled_ic = true,
const double  step_tolerance_ic = std::pow(std::numeric_limits<double>::epsilon(), 2.0 / 3.0),
const double  nonlinear_convergence_coefficient_ic = 0.0033,
const double  linear_tolerance_factor = 0.05,
const double  increment_factor = 1.0,
const bool  linear_solution_scaling = true,
const double  delta_cj_lsetup = 0.25,
const double  eta_min = 0.5,
const double  eta_max = 2.0,
const double  eta_low = 0.9,
const double  eta_min_err_fail = 0.25,
const double  eta_conv_fail = 0.25,
const double  eta_min_fixed = 1.0,
const double  eta_max_fixed = 2.0,
const unsigned int  maximum_constraint_failures = 10 
)
inline

Initialization parameters for IDA. Parameters requiring a newer SUNDIALS version are ignored when that version is unavailable.

Global parameters:

Parameters
initial_timeInitial time
final_timeFinal time
initial_step_sizeInitial step size
output_periodTime interval between each output

Running parameters:

Parameters
minimum_step_sizeMinimum step size
maximum_orderMaximum BDF order
maximum_non_linear_iterationsMaximum number of nonlinear iterations
ls_norm_factorConverting factor from the integrator tolerance to the linear solver tolerance
maximum_step_sizeLargest allowed integration step
maximum_number_of_stepsMaximum internal steps between outputs
maximum_error_test_failuresMaximum local error test failures
maximum_convergence_failuresMaximum nonlinear convergence failures
nonlinear_convergence_coefficientNonlinear convergence test coefficient
linear_tolerance_factorLinear solver tolerance scale
increment_factorDifference-quotient increment factor
linear_solution_scalingWhether to scale linear solutions
delta_cj_lsetupJacobian setup threshold for Cj changes (SUNDIALS 6.2+)

Error parameters:

Parameters
absolute_toleranceAbsolute error tolerance
relative_toleranceRelative error tolerance
ignore_algebraic_terms_for_errorsIgnore algebraic terms for error computations

Initial condition correction parameters:

Parameters
ic_typeInitial condition correction type
reset_typeInitial condition correction type after restart
maximum_non_linear_iterations_icInitial condition Newton max iterations
maximum_number_of_steps_icMaximum IC correction steps
maximum_number_of_jacobians_icMaximum IC Jacobian evaluations
maximum_number_of_backtracks_icMaximum IC line-search backtracks
line_search_enabled_icWhether to use the IC line search
step_tolerance_icMinimum Newton correction for IC convergence
nonlinear_convergence_coefficient_icIC convergence coefficient
eta_minMinimum adaptive step reduction factor (SUNDIALS 6.2+)
eta_maxMaximum adaptive step growth factor (SUNDIALS 6.2+)
eta_lowLow-order step reduction factor (SUNDIALS 6.2+)
eta_min_err_failMinimum factor after error failure (SUNDIALS 6.2+)
eta_conv_failFactor after convergence failure (SUNDIALS 6.2+)
eta_min_fixedMinimum fixed-step growth factor (SUNDIALS 6.2+)
eta_max_fixedMaximum fixed-step growth factor (SUNDIALS 6.2+)
maximum_constraint_failuresConstraint failures per step (SUNDIALS 7.6+)

Definition at line 591 of file ida.h.

Member Function Documentation

◆ add_parameters()

template<typename VectorType = Vector<double>>
void SUNDIALS::IDA< VectorType >::AdditionalData::add_parameters ( ParameterHandler &  prm)
inline

Add all AdditionalData() parameters to the given ParameterHandler object. When the parameters are parsed from a file, the internal parameters are automatically updated.

The following parameters are declared:

set Final time = 1.000000
set Initial time = 0.000000
set Time interval between each output = 0.2
subsection Error control
set Absolute error tolerance = 0.000001
set Ignore algebraic terms for error computations = true
set Relative error tolerance = 0.00001
set Use local tolerances = false
subsection Initial condition correction parameters
set Correction type at initial time = none
set Correction type after restart = none
set Maximum number of nonlinear iterations = 5
subsection Running parameters
set Initial step size = 0.1
set Maximum number of nonlinear iterations = 10
set Maximum order of BDF = 5
set Minimum step size = 0.000001
*  iterator end()
*  x_component_mask set(0, true)
std::size_t size
Definition mpi.cc:733

These are one-to-one with the options you can pass at construction time.

The options you pass at construction time are set as default values in the ParameterHandler object prm. You can later modify them by parsing a parameter file using prm. The values of the parameter will be updated whenever the content of prm is updated.

Make sure that this class lives longer than prm. Undefined behavior will occur if you destroy this class, and then parse a parameter file using prm.

Definition at line 720 of file ida.h.

Member Data Documentation

◆ initial_time

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::initial_time

Initial time for the DAE.

Definition at line 914 of file ida.h.

◆ final_time

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::final_time

Final time.

Definition at line 919 of file ida.h.

◆ initial_step_size

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::initial_step_size

Initial step size.

Definition at line 924 of file ida.h.

◆ minimum_step_size

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::minimum_step_size

Minimum step size. Ignored with SUNDIALS versions older than 6.2.

Definition at line 929 of file ida.h.

◆ maximum_step_size

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::maximum_step_size = 0.0

Maximum integration step size. A value of zero means unlimited.

Definition at line 934 of file ida.h.

◆ maximum_number_of_steps

template<typename VectorType = Vector<double>>
long int SUNDIALS::IDA< VectorType >::AdditionalData::maximum_number_of_steps = 500

Maximum internal steps per IDASolve call (SUNDIALS default: 500). The counter is reset whenever an output step is accepted. If your simulation needs to take small time steps, but you only need output at very large time steps, you may want to increase this value.

Definition at line 942 of file ida.h.

◆ maximum_error_test_failures

template<typename VectorType = Vector<double>>
unsigned int SUNDIALS::IDA< VectorType >::AdditionalData::maximum_error_test_failures = 10

Maximum local error test failures (SUNDIALS default: 10).

Definition at line 947 of file ida.h.

◆ maximum_convergence_failures

template<typename VectorType = Vector<double>>
unsigned int SUNDIALS::IDA< VectorType >::AdditionalData::maximum_convergence_failures = 10

Maximum nonlinear convergence failures (SUNDIALS default: 10).

Definition at line 952 of file ida.h.

◆ nonlinear_convergence_coefficient

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::nonlinear_convergence_coefficient = 0.33

Nonlinear convergence coefficient (SUNDIALS default: 0.33).

Definition at line 957 of file ida.h.

◆ maximum_number_of_steps_ic

template<typename VectorType = Vector<double>>
unsigned int SUNDIALS::IDA< VectorType >::AdditionalData::maximum_number_of_steps_ic = 5

Maximum number of IC solve steps (SUNDIALS default: 5).

Definition at line 962 of file ida.h.

◆ maximum_number_of_jacobians_ic

template<typename VectorType = Vector<double>>
unsigned int SUNDIALS::IDA< VectorType >::AdditionalData::maximum_number_of_jacobians_ic = 4

Maximum number of IC Jacobian evaluations (SUNDIALS default: 4).

Definition at line 967 of file ida.h.

◆ maximum_number_of_backtracks_ic

template<typename VectorType = Vector<double>>
unsigned int SUNDIALS::IDA< VectorType >::AdditionalData::maximum_number_of_backtracks_ic = 100

Maximum number of IC line-search backtracks (SUNDIALS default: 100).

Definition at line 972 of file ida.h.

◆ line_search_enabled_ic

template<typename VectorType = Vector<double>>
bool SUNDIALS::IDA< VectorType >::AdditionalData::line_search_enabled_ic = true

Whether to use the IC line search (SUNDIALS default: true).

Definition at line 977 of file ida.h.

◆ step_tolerance_ic

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::step_tolerance_ic
Initial value:
=
std::pow(std::numeric_limits<double>::epsilon(), 2.0 / 3.0)
::VectorizedArray< Number, width > pow(const ::VectorizedArray< Number, width > &, const Number p)

IC step tolerance (SUNDIALS default: unit roundoff^(2/3)).

Definition at line 982 of file ida.h.

◆ nonlinear_convergence_coefficient_ic

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::nonlinear_convergence_coefficient_ic = 0.0033

IC nonlinear convergence coefficient (SUNDIALS default: 0.0033).

Definition at line 988 of file ida.h.

◆ linear_tolerance_factor

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::linear_tolerance_factor = 0.05

Linear solver tolerance factor (SUNDIALS default: 0.05; zero selects this default).

Definition at line 994 of file ida.h.

◆ increment_factor

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::increment_factor = 1.0

Difference quotient increment factor (SUNDIALS default: 1.0).

Definition at line 999 of file ida.h.

◆ linear_solution_scaling

template<typename VectorType = Vector<double>>
bool SUNDIALS::IDA< VectorType >::AdditionalData::linear_solution_scaling = true

Whether to apply linear solution scaling. The deal.II IDA wrapper uses a matrix-iterative SUNLinearSolver, whose SUNDIALS default is true.

Definition at line 1005 of file ida.h.

◆ delta_cj_lsetup

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::delta_cj_lsetup = 0.25

Cj setup difference factor (SUNDIALS default: 0.25). Ignored with SUNDIALS versions older than 6.2.

Definition at line 1011 of file ida.h.

◆ eta_min

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::eta_min = 0.5

Minimum adaptivity step reduction factor (SUNDIALS default: 0.5). Ignored with SUNDIALS versions older than 6.2.

Definition at line 1017 of file ida.h.

◆ eta_max

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::eta_max = 2.0

Maximum adaptivity step growth factor (SUNDIALS default: 2.0). Ignored with SUNDIALS versions older than 6.2.

Definition at line 1023 of file ida.h.

◆ eta_low

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::eta_low = 0.9

Adaptivity step reduction factor (SUNDIALS default: 0.9). Ignored with SUNDIALS versions older than 6.2.

Definition at line 1029 of file ida.h.

◆ eta_min_err_fail

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::eta_min_err_fail = 0.25

Minimum adaptivity factor after an error failure (default: 0.25). Ignored with SUNDIALS versions older than 6.2.

Definition at line 1035 of file ida.h.

◆ eta_conv_fail

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::eta_conv_fail = 0.25

Adaptivity factor after a convergence failure (default: 0.25). Ignored with SUNDIALS versions older than 6.2.

Definition at line 1041 of file ida.h.

◆ eta_min_fixed

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::eta_min_fixed = 1.0

Lower bound of the step-size ratio interval in which IDA keeps the current step size (SUNDIALS default: 1.0). This does not enable fixed time stepping. Ignored with SUNDIALS versions older than 6.2.

Definition at line 1049 of file ida.h.

◆ eta_max_fixed

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::eta_max_fixed = 2.0

Upper bound of the step-size ratio interval in which IDA keeps the current step size (SUNDIALS default: 2.0). This does not enable fixed time stepping. Ignored with SUNDIALS versions older than 6.2.

Definition at line 1057 of file ida.h.

◆ maximum_constraint_failures

template<typename VectorType = Vector<double>>
unsigned int SUNDIALS::IDA< VectorType >::AdditionalData::maximum_constraint_failures = 10

Maximum inequality constraint failures per step (default: 10). Ignored with SUNDIALS versions older than 7.6.

Definition at line 1063 of file ida.h.

◆ absolute_tolerance

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::absolute_tolerance

Absolute error tolerance for adaptive time stepping.

Definition at line 1068 of file ida.h.

◆ relative_tolerance

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::relative_tolerance

Relative error tolerance for adaptive time stepping.

Definition at line 1073 of file ida.h.

◆ maximum_order

template<typename VectorType = Vector<double>>
unsigned int SUNDIALS::IDA< VectorType >::AdditionalData::maximum_order

Maximum order of BDF.

Definition at line 1078 of file ida.h.

◆ output_period

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::output_period

Time period between each output.

Definition at line 1083 of file ida.h.

◆ ignore_algebraic_terms_for_errors

template<typename VectorType = Vector<double>>
bool SUNDIALS::IDA< VectorType >::AdditionalData::ignore_algebraic_terms_for_errors

Ignore algebraic terms for errors.

Definition at line 1088 of file ida.h.

◆ ic_type

template<typename VectorType = Vector<double>>
InitialConditionCorrection SUNDIALS::IDA< VectorType >::AdditionalData::ic_type

Type of correction for initial conditions.

If you do not provide consistent initial conditions, (i.e., conditions for which \(F(y_dot(0), y(0), 0) = 0\)), you can ask SUNDIALS to compute initial conditions for you by using the ic_type parameter at construction time.

Notice that you could in principle use this capabilities to solve for steady state problems by setting y_dot to zero, and asking to compute \(y(0)\) that satisfies \(F(0, y(0), 0) = 0\), however the nonlinear solver used inside IDA may not be robust enough for complex problems with several millions unknowns.

Definition at line 1104 of file ida.h.

◆ reset_type

template<typename VectorType = Vector<double>>
InitialConditionCorrection SUNDIALS::IDA< VectorType >::AdditionalData::reset_type

Type of correction for initial conditions to be used after a solver restart.

If you do not have consistent initial conditions after a restart, (i.e., conditions for which F(y_dot(t_restart), y(t_restart), t_restart) = 0), you can ask SUNDIALS to compute the new initial conditions for you by using the reset_type parameter at construction time.

Definition at line 1116 of file ida.h.

◆ maximum_non_linear_iterations_ic

template<typename VectorType = Vector<double>>
unsigned SUNDIALS::IDA< VectorType >::AdditionalData::maximum_non_linear_iterations_ic

Maximum number of iterations for Newton method in IC calculation.

Definition at line 1121 of file ida.h.

◆ maximum_non_linear_iterations

template<typename VectorType = Vector<double>>
unsigned int SUNDIALS::IDA< VectorType >::AdditionalData::maximum_non_linear_iterations

Maximum number of iterations for Newton method during time advancement.

Definition at line 1126 of file ida.h.

◆ ls_norm_factor

template<typename VectorType = Vector<double>>
double SUNDIALS::IDA< VectorType >::AdditionalData::ls_norm_factor

Factor to use when converting from the integrator tolerance to the linear solver tolerance

Definition at line 1132 of file ida.h.


The documentation for this class was generated from the following file: