Module Sundials_LinearSolver.Iterative

module Iterative: sig .. end

Iterative Linear Solvers


Definitions in this module are more conveniently accessed through session-specific iterative linear solver modules like Cvode.Spils and Ida.Spils. For example, Cvode.Spils.spbcgs is an alias for Sundials_LinearSolver.Iterative.spbcgs.

Types

type gramschmidt_type = Iterative.gramschmidt_type = 
| ModifiedGS (*

Modified Gram-Schmidt orthogonalization (SUNLS_MODIFIED_GS)

*)
| ClassicalGS (*

Classical Gram Schmidt orthogonalization (SUNLS_CLASSICAL_GS)

*)

The type of Gram-Schmidt orthogonalization in iterative linear solvers.

Solvers

val spbcgs : ?context:Sundials.Context.t ->
?maxl:int ->
('d, 'k) Nvector.t ->
('m, 'd, 'k, [ `Iter | `Spbcgs ]) Sundials_LinearSolver.t

Krylov iterative solver using the scaled preconditioned biconjugate stabilized (Bi-CGStab) method. The maxl arguments gives the maximum dimension of the Krylov subspace (defaults to 5). The nvector argument is used as a template.

val spfgmr : ?context:Sundials.Context.t ->
?maxl:int ->
?max_restarts:int ->
?gs_type:gramschmidt_type ->
('d, 'k) Nvector.t ->
('m, 'd, 'k, [ `Iter | `Spfgmr ]) Sundials_LinearSolver.t

Krylov iterative solver using the scaled preconditioned flexible generalized minimum residual (GMRES) method. The maxl arguments gives the maximum dimension of the Krylov subspace (defaults to 5). The nvector argument is used as a template.

NB: max_restarts is ignored by CVODE, CVODES, and ARKODE for Config.sundials_version < 3.0.0.

val spgmr : ?context:Sundials.Context.t ->
?maxl:int ->
?max_restarts:int ->
?gs_type:gramschmidt_type ->
('d, 'k) Nvector.t ->
('m, 'd, 'k, [ `Iter | `Spgmr ]) Sundials_LinearSolver.t

Krylov iterative solver using the scaled preconditioned generalized minimum residual (GMRES) method. The maxl arguments gives the maximum dimension of the Krylov subspace (defaults to 5). The nvector argument is used as a template.

NB: max_restarts is ignored by CVODE, CVODES, and ARKODE for Config.sundials_version < 3.0.0.

val sptfqmr : ?context:Sundials.Context.t ->
?maxl:int ->
('d, 'k) Nvector.t ->
('m, 'd, 'k, [ `Iter | `Sptfqmr ]) Sundials_LinearSolver.t

Krylov iterative with the scaled preconditioned transpose-free quasi-minimal residual (SPTFQMR) method. The maxl arguments gives the maximum dimension of the Krylov subspace (defaults to 5). The nvector argument is used as a template.

val pcg : ?context:Sundials.Context.t ->
?maxl:int ->
('d, 'k) Nvector.t -> ('m, 'd, 'k, [ `Iter | `Pcg ]) Sundials_LinearSolver.t

Krylov iterative solver using the preconditioned conjugate gradient (PCG) method. The maxl arguments gives the maximum dimension of the Krylov subspace (defaults to 5). The nvector argument is used as a template.

module Algorithms: sig .. end

Low-level routines on arrays.

Solver parameters

val set_maxl : ('m, 'd, 'k, [< `Iter | `Pcg | `Spbcgs | `Sptfqmr ]) Sundials_LinearSolver.t ->
int -> unit

Updates the number of linear solver iterations to allow.

val set_gs_type : ('m, 'd, 'k, [< `Iter | `Spfgmr | `Spgmr ]) Sundials_LinearSolver.t ->
gramschmidt_type -> unit

Sets the Gram-Schmidt orthogonalization to use.

val set_max_restarts : ('m, 'd, 'k, [< `Iter | `Spfgmr | `Spgmr ]) Sundials_LinearSolver.t ->
int -> unit

Sets the number of GMRES restarts to allow.

NB: This feature is not supported by CVODE, CVODES, and ARKODE for Config.sundials_version < 3.0.0.

type preconditioning_type = Iterative.preconditioning_type = 
| PrecNone (*

No preconditioning

*)
| PrecLeft (*

$(P^{-1}A)x = P^{-1}b$

*)
| PrecRight (*

$(AP^{-1})Px = b$

*)
| PrecBoth (*

$(P_L^{-1}AP_R^{-1})P_Rx = P_L^{-1}b$

*)

The type of preconditioning in Krylov solvers.

val set_prec_type : ('m, 'd, 'k, [> `Iter ]) Sundials_LinearSolver.t ->
preconditioning_type -> unit

Change the preconditioning direction without modifying callback functions.

Raises Sundials_LinearSolver.IllegalPrecType if the current preconditioner is PrecNone and the given argument is not (since no callback functions are specified in this case. May raise Sundials_LinearSolver.IllegalPrecType if the given type is not allowed by the underlying solver.

val set_info_file : ('m, 'd, 'k, [> `Iter ]) Sundials_LinearSolver.t ->
?print_level:bool -> Sundials.Logfile.t -> unit

Sets the output file for informative (non-error) messages. The default is to send such messages to stdout. The optional argument is a convenience for invoking Sundials_LinearSolver.Iterative.set_print_level.

Sundials must be built with (SUNDIALS_BUILD_WITH_MONITORING) to use this function.

val set_print_level : ('m, 'd, 'k, [> `Iter ]) Sundials_LinearSolver.t -> bool -> unit

Sets the level of output verbosity. When false (the default) no information is printed, when true the residual norm is printed for each linear iteration.

Sundials must be built with (SUNDIALS_BUILD_WITH_MONITORING) to use this function.