Linear solvers#
Warning
Some capabilities may require the installation of GEMSEO with all its features and some others may depend on plugins.
Warning
All the features of the wrapped libraries may not be exposed through GEMSEO.
Note
The algorithm settings can be passed to a function of the form
function(..., settings_model: AlgorithmSettings | None = None, **settings: Any)
either one by one:
function(..., setting_name_1=setting_name_1, setting_name_2=setting_name_2, ...)
or using the argument name "settings_model"
and the Pydantic model associated with the algorithm:
settings_model = AlgorithmSettings(setting_name_1=setting_name_1, setting_name_2=setting_name_2, ...)
function(..., settings_model=settings_model)
BICG#
Module: gemseo.algos.linear_solvers.scipy_linalg.scipy_linalg
BI-Conjugate Gradient
from gemseo.settings.linear_solvers import BICG_Settings
More details about the algorithm and its settings on https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.bicg.html.
- Optional settings
atol : <class 'float'>, optional
The absolute tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 0.0.
callback : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
The user-supplied function to call after each iteration.
It is called as callback(xk), where xk is the current solution vector. If
None
, no function is called.By default it is set to None.
M : scipy.sparse.linalg._interface.LinearOperator | numpy.ndarray | scipy.sparse._base.sparray | None, optional
The preconditioner approximating the inverse of A.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 1000.
rtol : <class 'float'>, optional
The relative tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-12.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
x0 : numpy.ndarray | None, optional
Starting guess for the solution.
If
None
, start from a matrix of zeros.By default it is set to None.
BICGSTAB#
Module: gemseo.algos.linear_solvers.scipy_linalg.scipy_linalg
Bi-Conjugate Gradient STABilized
from gemseo.settings.linear_solvers import BICGSTAB_Settings
More details about the algorithm and its settings on https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.bicgstab.html.
- Optional settings
atol : <class 'float'>, optional
The absolute tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 0.0.
callback : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
The user-supplied function to call after each iteration.
It is called as callback(xk), where xk is the current solution vector. If
None
, no function is called.By default it is set to None.
M : scipy.sparse.linalg._interface.LinearOperator | numpy.ndarray | scipy.sparse._base.sparray | None, optional
The preconditioner approximating the inverse of A.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 1000.
rtol : <class 'float'>, optional
The relative tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-12.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
x0 : numpy.ndarray | None, optional
Starting guess for the solution.
If
None
, start from a matrix of zeros.By default it is set to None.
CG#
Module: gemseo.algos.linear_solvers.scipy_linalg.scipy_linalg
Conjugate Gradient
from gemseo.settings.linear_solvers import CG_Settings
More details about the algorithm and its settings on https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.cg.html.
- Optional settings
atol : <class 'float'>, optional
The absolute tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 0.0.
callback : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
The user-supplied function to call after each iteration.
It is called as callback(xk), where xk is the current solution vector. If
None
, no function is called.By default it is set to None.
M : scipy.sparse.linalg._interface.LinearOperator | numpy.ndarray | scipy.sparse._base.sparray | None, optional
The preconditioner approximating the inverse of A.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 1000.
rtol : <class 'float'>, optional
The relative tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-12.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
x0 : numpy.ndarray | None, optional
Starting guess for the solution.
If
None
, start from a matrix of zeros.By default it is set to None.
CGS#
Module: gemseo.algos.linear_solvers.scipy_linalg.scipy_linalg
Conjugate Gradient Squared
from gemseo.settings.linear_solvers import CGS_Settings
More details about the algorithm and its settings on https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.cgs.html.
- Optional settings
atol : <class 'float'>, optional
The absolute tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 0.0.
callback : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
The user-supplied function to call after each iteration.
It is called as callback(xk), where xk is the current solution vector. If
None
, no function is called.By default it is set to None.
M : scipy.sparse.linalg._interface.LinearOperator | numpy.ndarray | scipy.sparse._base.sparray | None, optional
The preconditioner approximating the inverse of A.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 1000.
rtol : <class 'float'>, optional
The relative tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-12.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
x0 : numpy.ndarray | None, optional
Starting guess for the solution.
If
None
, start from a matrix of zeros.By default it is set to None.
DEFAULT#
Module: gemseo.algos.linear_solvers.scipy_linalg.scipy_linalg
Default solver (LGMRES)
from gemseo.settings.linear_solvers import LGMRES_Settings
More details about the algorithm and its settings on https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.lgmres.html.
- Optional settings
atol : <class 'float'>, optional
The absolute tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 0.0.
callback : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
The user-supplied function to call after each iteration.
It is called as callback(xk), where xk is the current solution vector. If
None
, no function is called.By default it is set to None.
inner_m : <class 'int'>, optional
Number of inner GMRES iterations per each outer iteration.
By default it is set to 30.
M : scipy.sparse.linalg._interface.LinearOperator | numpy.ndarray | scipy.sparse._base.sparray | None, optional
The preconditioner approximating the inverse of A.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 1000.
outer_k : <class 'int'>, optional
Number of vectors to carry between inner GMRES iterations.
By default it is set to 3.
outer_v : list[tuple[numpy.ndarray[typing.Any, numpy.dtype[numpy.number[typing.Any]]], numpy.ndarray[typing.Any, numpy.dtype[numpy.number[typing.Any]]]]], optional
List of tuples (v, Av) used to augment the Krylov subspace.
By default it is set to [].
prepend_outer_v : <class 'bool'>, optional
Whether to put outer_v augmentation vectors before Krylov iterates.
By default it is set to False.
rtol : <class 'float'>, optional
The relative tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-12.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
store_outer_Av : <class 'bool'>, optional
Whether A @ v should be additionnaly stored in outer_v list.
By default it is set to True.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
x0 : numpy.ndarray | None, optional
Starting guess for the solution.
If
None
, start from a matrix of zeros.By default it is set to None.
GCROT#
Module: gemseo.algos.linear_solvers.scipy_linalg.scipy_linalg
Generalized Conjugate Residual with Optimal Truncation
from gemseo.settings.linear_solvers import GCROT_Settings
More details about the algorithm and its settings on https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.gcrotmk.html.
- Optional settings
atol : <class 'float'>, optional
The absolute tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 0.0.
callback : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
The user-supplied function to call after each iteration.
It is called as callback(xk), where xk is the current solution vector. If
None
, no function is called.By default it is set to None.
CU : collections.abc.Iterable[tuple[numpy.ndarray[typing.Any, numpy.dtype[numpy.number[typing.Any]]], numpy.ndarray[typing.Any, numpy.dtype[numpy.number[typing.Any]]]]] | None, optional
List of tuples (c, u) required to form the matrices C and U.
If
None
start from empty matrices.By default it is set to None.
discard_C : <class 'bool'>, optional
Whether to discard the C-vectors at the end.
By default it is set to True.
k : <class 'int'>, optional
Number of vectors to carry between inner FGMRES iterations.
If
None
use the same value asm
.By default it is set to 30.
M : scipy.sparse.linalg._interface.LinearOperator | numpy.ndarray | scipy.sparse._base.sparray | None, optional
The preconditioner approximating the inverse of A.
By default it is set to None.
m : <class 'int'>, optional
Number of inner FGMRES iterations per each outer iteration.
By default it is set to 30.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 1000.
rtol : <class 'float'>, optional
The relative tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-12.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
truncate : typing.Literal['oldest', 'smallest'], optional
The vectors from the previous cycle to drop.
By default it is set to oldest.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
x0 : numpy.ndarray | None, optional
Starting guess for the solution.
If
None
, start from a matrix of zeros.By default it is set to None.
GMRES#
Module: gemseo.algos.linear_solvers.scipy_linalg.scipy_linalg
Generalized Minimum RESidual
from gemseo.settings.linear_solvers import GMRES_Settings
More details about the algorithm and its settings on https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.gmres.html.
- Optional settings
atol : <class 'float'>, optional
The absolute tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 0.0.
callback : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
The user-supplied function to call after each iteration.
It is called as callback(xk), where xk is the current solution vector. If
None
, no function is called.By default it is set to None.
M : scipy.sparse.linalg._interface.LinearOperator | numpy.ndarray | scipy.sparse._base.sparray | None, optional
The preconditioner approximating the inverse of A.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 1000.
restart : <class 'int'>, optional
Number of iterations between restarts.
By default it is set to 20.
rtol : <class 'float'>, optional
The relative tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-12.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
x0 : numpy.ndarray | None, optional
Starting guess for the solution.
If
None
, start from a matrix of zeros.By default it is set to None.
LGMRES#
Module: gemseo.algos.linear_solvers.scipy_linalg.scipy_linalg
Loose Generalized Minimum RESidual
from gemseo.settings.linear_solvers import LGMRES_Settings
More details about the algorithm and its settings on https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.lgmres.html.
- Optional settings
atol : <class 'float'>, optional
The absolute tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 0.0.
callback : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
The user-supplied function to call after each iteration.
It is called as callback(xk), where xk is the current solution vector. If
None
, no function is called.By default it is set to None.
inner_m : <class 'int'>, optional
Number of inner GMRES iterations per each outer iteration.
By default it is set to 30.
M : scipy.sparse.linalg._interface.LinearOperator | numpy.ndarray | scipy.sparse._base.sparray | None, optional
The preconditioner approximating the inverse of A.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 1000.
outer_k : <class 'int'>, optional
Number of vectors to carry between inner GMRES iterations.
By default it is set to 3.
outer_v : list[tuple[numpy.ndarray[typing.Any, numpy.dtype[numpy.number[typing.Any]]], numpy.ndarray[typing.Any, numpy.dtype[numpy.number[typing.Any]]]]], optional
List of tuples (v, Av) used to augment the Krylov subspace.
By default it is set to [].
prepend_outer_v : <class 'bool'>, optional
Whether to put outer_v augmentation vectors before Krylov iterates.
By default it is set to False.
rtol : <class 'float'>, optional
The relative tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-12.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
store_outer_Av : <class 'bool'>, optional
Whether A @ v should be additionnaly stored in outer_v list.
By default it is set to True.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
x0 : numpy.ndarray | None, optional
Starting guess for the solution.
If
None
, start from a matrix of zeros.By default it is set to None.
PETSC_BCGS#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_BCGS_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPBCGS/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_BCGSL#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_BCGSL_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPBCGSL/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_BICG#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_BICG_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPBICG/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_CG#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_CG_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPCG/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_CGLS#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_CGLS_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPCGLS/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_CGNE#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_CGNE_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPCGNE/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_CGS#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_CGS_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPCGS/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_CHEBYSHEV#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_CHEBYSHEV_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPCHEBYSHEV/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_CR#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_CR_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPCR/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_DGMRES#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_DGMRES_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPDGMRES/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_FBCGS#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_FBCGS_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPFBCGS/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_FBCGSR#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_FBCGSR_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPFBCGSR/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_FCG#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_FCG_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPFCG/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_FETIDP#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_FETIDP_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPFETIDP/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_FGMRES#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_FGMRES_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPFGMRES/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_GCR#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_GCR_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPGCR/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_GLTR#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_GLTR_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPGLTR/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_GMRES#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_GMRES_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPGMRES/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_GROPPCG#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_GROPPCG_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPGROPPCG/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_HPDDM#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_HPDDM_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPHPDDM/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_IBCGS#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_IBCGS_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPIBCGS/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_LCD#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_LCD_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPLCD/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_LGMRES#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_LGMRES_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPLGMRES/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_LSQR#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_LSQR_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPLSQR/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_MINRES#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_MINRES_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPMINRES/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_NASH#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_NASH_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPNASH/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_PGMRES#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_PGMRES_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPPGMRES/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_PIPEBCGS#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_PIPEBCGS_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPPIPEBCGS/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_PIPECG#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_PIPECG_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPPIPECG/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_PIPECG2#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_PIPECG2_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPPIPECG2/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_PIPECGRR#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_PIPECGRR_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPPIPECGRR/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_PIPECR#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_PIPECR_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPPIPECR/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_PIPEFCG#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_PIPEFCG_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPPIPEFCG/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_PIPEFGMRES#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_PIPEFGMRES_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPPIPEFGMRES/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_PIPEGCR#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_PIPEGCR_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPPIPEGCR/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_PIPELCG#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_PIPELCG_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPPIPELCG/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_PIPEPRCG#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_PIPEPRCG_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPPIPEPRCG/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_PREONLY#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_PREONLY_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPPREONLY/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_QCG#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_QCG_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPQCG/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_RICHARDSON#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_RICHARDSON_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPRICHARDSON/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_STCG#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_STCG_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPSTCG/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_SYMMLQ#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_SYMMLQ_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPSYMMLQ/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_TCQMR#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_TCQMR_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPTCQMR/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_TFQMR#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_TFQMR_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPTFQMR/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
PETSC_TSIRM#
Note
The plugin gemseo_petsc is required.
Module: gemseo_petsc.linear_solvers.petsc_ksp
from gemseo.settings.linear_solvers import PETSC_TSIRM_Settings
More details about the algorithm and its settings on https://petsc.org/release/manualpages/KSP/KSPTSIRM/.
- Optional settings
atol : <class 'float'>, optional
The absolute convergence tolerance.
Absolute tolerance of the (possibly preconditioned) residual norm. Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-50.
dtol : <class 'float'>, optional
The divergence tolerance.
The amount the (possibly preconditioned) residual norm can increase.
By default it is set to 100000.0.
ksp_pre_processor : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
A callback function that is called before calling ksp.solve().
The function is called with (KSP problem, options dict) as arguments. It allows the user to obtain an advanced configuration that is not supported by the current wrapper. If None, do not perform any call.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 100000.
monitor_residuals : <class 'bool'>, optional
Whether to store the residuals during convergence.
- WARNING: as said in Petsc documentation,
"the routine is slow and should be used only for testing or convergence studies, not for timing."
By default it is set to False.
options_cmd : collections.abc.Mapping[str, typing.Any] | None, optional
The options to pass to the PETSc KSP solver.
If None, use the default options.
By default it is set to None.
preconditioner_type : gemseo_petsc.linear_solvers.settings.petsc_ksp_settings.PreconditionerType | None, optional
The type of the precondtioner.
If None, no preconditioning is applied. See [https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.PC.Type-class.html]
By default it is set to ilu.
rtol : <class 'float'>, optional
The relative convergence tolerance.
Relative decrease in the (possibly preconditioned) residual norm.
By default it is set to 1e-05.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
set_from_options : <class 'bool'>, optional
Whether the options are set from sys.argv.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
view_config : <class 'bool'>, optional
Whether to view the configuration of the solver before run.
Configuration is viewed by calling ksp.view().
By default it is set to False.
TFQMR#
Module: gemseo.algos.linear_solvers.scipy_linalg.scipy_linalg
Transpose-Free Quasi-Minimal Residual
from gemseo.settings.linear_solvers import BaseSciPyLinalgSettingsBase
More details about the algorithm and its settings on https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.tfqmr.html.
- Optional settings
atol : <class 'float'>, optional
The absolute tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 0.0.
callback : typing.Optional[typing.Annotated[collections.abc.Callable, WithJsonSchema(json_schema={}, mode=None)]], optional
The user-supplied function to call after each iteration.
It is called as callback(xk), where xk is the current solution vector. If
None
, no function is called.By default it is set to None.
M : scipy.sparse.linalg._interface.LinearOperator | numpy.ndarray | scipy.sparse._base.sparray | None, optional
The preconditioner approximating the inverse of A.
By default it is set to None.
maxiter : <class 'int'>, optional
Maximum number of iterations.
By default it is set to 1000.
rtol : <class 'float'>, optional
The relative tolerance.
Algorithm stops if norm(b - A @ x) <= max(rtol*norm(b), atol).
By default it is set to 1e-12.
save_when_fail : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
store_residuals : <class 'bool'>, optional
Whether to store the residual norms at each iterations.
By default it is set to False.
use_ilu_precond : <class 'bool'>, optional
Whether to use an incomplete LU factorization as preconditioner.
By default it is set to False.
x0 : numpy.ndarray | None, optional
Starting guess for the solution.
If
None
, start from a matrix of zeros.By default it is set to None.