.. Copyright 2021 IRT Saint-Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. .. _gen_mda_algos: MDA algorithms ============== .. warning:: Some capabilities may require the :ref:`installation ` of |g| with :ref:`all its features ` and some others may depend on :ref:`plugins `. .. warning:: All the features of the wrapped libraries may not be exposed through |g|. .. note:: The algorithm settings can be passed to a function of the form .. code-block:: python function(..., settings_model: AlgorithmSettings | None = None, **settings: Any) either one by one: .. code-block:: python 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: .. code-block:: python settings_model = AlgorithmSettings(setting_name_1=setting_name_1, setting_name_2=setting_name_2, ...) function(..., settings_model=settings_model) .. _MDAChain_options: MDAChain -------- Module: :class:`gemseo.mda.mda_chain` .. code-block:: python :caption: Pydantic model of the settings for MDAChain from gemseo.settings.mda import MDAChain_Settings .. raw:: html
Optional settings
  • **acceleration_method** : *, optional* The acceleration method used within the fixed point iterations. By default it is set to NoTransformation. .. raw:: html
  • **chain_linearize** : *, optional* Whether to linearize the chain of execution. Otherwise, linearize the overall MDA with base class method. This last option is preferred to minimize computations in adjoint mode, while in direct mode, linearizing the chain may be cheaper. By default it is set to False. .. raw:: html
  • **coupling_structure** : *gemseo.core.coupling_structure.CouplingStructure | None, optional* The coupling structure to be used by the MDA. If ``None``, the coupling structure is created from the disciplines. By default it is set to None. .. raw:: html
  • **execute_before_linearizing** : *, optional* Whether to start by executing the disciplines before linearizing. This ensures that the discipline are executed and linearized with the same input data. It can be almost free if the corresponding output data have been stored in the :attr:`.BaseMDA.cache`. By default it is set to True. .. raw:: html
  • **initialize_defaults** : *, optional* Whether to create a :class:`.MDOInitializationChain` to compute the eventually missing :attr:`.default_inputs` at the first execution. By default it is set to False. .. raw:: html
  • **inner_mda_name** : *, optional* The class name of the inner-MDA. By default it is set to MDAJacobi. .. raw:: html
  • **inner_mda_settings** : *collections.abc.Mapping[str, typing.Any] | gemseo.mda.base_mda_settings.BaseMDASettings, optional* The settings for the inner MDAs. By default it is set to {}. .. raw:: html
  • **linear_solver** : *, optional* The name of the linear solver. By default it is set to DEFAULT. .. raw:: html
  • **linear_solver_settings** : *collections.abc.Mapping[str, typing.Any] | gemseo.algos.linear_solvers.base_linear_solver_settings.BaseLinearSolverSettings, optional* The settings passed to the linear solver factory. By default it is set to {}. .. raw:: html
  • **linear_solver_tolerance** : *, optional* The linear solver tolerance. Linear solvers are used to compute the total derivatives. By default it is set to 1e-12. .. raw:: html
  • **log_convergence** : *, optional* Whether to log the MDA convergence. The log displays the normalized residual norm. By default it is set to False. .. raw:: html
  • **max_mda_iter** : *, optional* The maximum number of iterations for the MDA algorithm. If 0, evaluate the coupling variables without trying to solve the coupling equations. By default it is set to 20. .. raw:: html
  • **mdachain_parallel_settings** : *collections.abc.Mapping[str, typing.Any], optional* The settings of the MDOParallelChain instances, if any. By default it is set to {}. .. raw:: html
  • **mdachain_parallelize_tasks** : *, optional* Whether to parallelize tasks, if relevant. By default it is set to False. .. raw:: html
  • **n_processes** : *, optional* The number of threads/processes. Threads if ``use_threading``, processes otherwise. By default it is set to 2. .. raw:: html
  • **name** : ** The name to be given to the MDA. If empty, use the name of the class. By default it is set to . .. raw:: html
  • **over_relaxation_factor** : *, optional* The over-relaxation factor. By default it is set to 1.0. .. raw:: html
  • **sub_coupling_structures** : *collections.abc.Sequence[gemseo.core.coupling_structure.CouplingStructure], optional* The coupling structures to be used by the inner MDAs. If empty, they are created from ``disciplines``. By default it is set to (). .. raw:: html
  • **tolerance** : *, optional* The tolerance for the MDA algorithm residual. The available normalization strategies for the residual are described in :attr:`.BaseMDA.ResidualScaling`. By default it is set to 1e-06. .. raw:: html
  • **use_lu_fact** : *, optional* Whether to perform an LU factorization. The factorization is used to solve the linear systems arising in the computation of the total derivatives. Since there are possibly several right-hand side, if affordable, such a factorization may improve the solution time. By default it is set to False. .. raw:: html
  • **use_threading** : *, optional* Whether to use threads instead of processes to parallelize the execution. Processes will copy (serialize) the disciplines, while threads will share the memory. If one wants to execute the same discipline multiple times, then multiprocessing should be preferred. By default it is set to True. .. raw:: html
  • **warm_start** : *, optional* Whether to warm start the execution of the MDA algorithm. The warm start strategy consists in using the last cached values for the coupling variables as an initial guess. This is expected to reduce the number of iteration of the MDA algorithm required to reach convergence. By default it is set to False. .. raw:: html
.. _MDAGSNewton_options: MDAGSNewton ----------- Module: :class:`gemseo.mda.gs_newton` .. code-block:: python :caption: Pydantic model of the settings for MDAGSNewton from gemseo.settings.mda import MDAGSNewton_Settings .. raw:: html
Optional settings
  • **coupling_structure** : *gemseo.core.coupling_structure.CouplingStructure | None, optional* The coupling structure to be used by the MDA. If ``None``, the coupling structure is created from the disciplines. By default it is set to None. .. raw:: html
  • **gauss_seidel_settings** : *collections.abc.Mapping[str, typing.Any] | gemseo.mda.gauss_seidel_settings.MDAGaussSeidel_Settings, optional* The settings for the Gauss-Seidel MDA. By default it is set to {}. .. raw:: html
  • **linear_solver** : *, optional* The name of the linear solver. By default it is set to DEFAULT. .. raw:: html
  • **linear_solver_settings** : *collections.abc.Mapping[str, typing.Any] | gemseo.algos.linear_solvers.base_linear_solver_settings.BaseLinearSolverSettings, optional* The settings passed to the linear solver factory. By default it is set to {}. .. raw:: html
  • **linear_solver_tolerance** : *, optional* The linear solver tolerance. Linear solvers are used to compute the total derivatives. By default it is set to 1e-12. .. raw:: html
  • **log_convergence** : *, optional* Whether to log the MDA convergence. The log displays the normalized residual norm. By default it is set to False. .. raw:: html
  • **max_mda_iter** : *, optional* The maximum number of iterations for the MDA algorithm. If 0, evaluate the coupling variables without trying to solve the coupling equations. By default it is set to 20. .. raw:: html
  • **name** : ** The name to be given to the MDA. If empty, use the name of the class. By default it is set to . .. raw:: html
  • **newton_settings** : *collections.abc.Mapping[str, typing.Any] | gemseo.mda.newton_raphson_settings.MDANewtonRaphson_Settings, optional* The settings for the Newton-Raphson MDA. By default it is set to {}. .. raw:: html
  • **tolerance** : *, optional* The tolerance for the MDA algorithm residual. The available normalization strategies for the residual are described in :attr:`.BaseMDA.ResidualScaling`. By default it is set to 1e-06. .. raw:: html
  • **use_lu_fact** : *, optional* Whether to perform an LU factorization. The factorization is used to solve the linear systems arising in the computation of the total derivatives. Since there are possibly several right-hand side, if affordable, such a factorization may improve the solution time. By default it is set to False. .. raw:: html
  • **warm_start** : *, optional* Whether to warm start the execution of the MDA algorithm. The warm start strategy consists in using the last cached values for the coupling variables as an initial guess. This is expected to reduce the number of iteration of the MDA algorithm required to reach convergence. By default it is set to False. .. raw:: html
.. _MDAGaussSeidel_options: MDAGaussSeidel -------------- Module: :class:`gemseo.mda.gauss_seidel` .. code-block:: python :caption: Pydantic model of the settings for MDAGaussSeidel from gemseo.settings.mda import MDAGaussSeidel_Settings .. raw:: html
Optional settings
  • **acceleration_method** : *, optional* The acceleration method used within the fixed point iterations. By default it is set to NoTransformation. .. raw:: html
  • **coupling_structure** : *gemseo.core.coupling_structure.CouplingStructure | None, optional* The coupling structure to be used by the MDA. If ``None``, the coupling structure is created from the disciplines. By default it is set to None. .. raw:: html
  • **linear_solver** : *, optional* The name of the linear solver. By default it is set to DEFAULT. .. raw:: html
  • **linear_solver_settings** : *collections.abc.Mapping[str, typing.Any] | gemseo.algos.linear_solvers.base_linear_solver_settings.BaseLinearSolverSettings, optional* The settings passed to the linear solver factory. By default it is set to {}. .. raw:: html
  • **linear_solver_tolerance** : *, optional* The linear solver tolerance. Linear solvers are used to compute the total derivatives. By default it is set to 1e-12. .. raw:: html
  • **log_convergence** : *, optional* Whether to log the MDA convergence. The log displays the normalized residual norm. By default it is set to False. .. raw:: html
  • **max_mda_iter** : *, optional* The maximum number of iterations for the MDA algorithm. If 0, evaluate the coupling variables without trying to solve the coupling equations. By default it is set to 20. .. raw:: html
  • **name** : ** The name to be given to the MDA. If empty, use the name of the class. By default it is set to . .. raw:: html
  • **over_relaxation_factor** : *, optional* The over-relaxation factor. By default it is set to 1.0. .. raw:: html
  • **tolerance** : *, optional* The tolerance for the MDA algorithm residual. The available normalization strategies for the residual are described in :attr:`.BaseMDA.ResidualScaling`. By default it is set to 1e-06. .. raw:: html
  • **use_lu_fact** : *, optional* Whether to perform an LU factorization. The factorization is used to solve the linear systems arising in the computation of the total derivatives. Since there are possibly several right-hand side, if affordable, such a factorization may improve the solution time. By default it is set to False. .. raw:: html
  • **warm_start** : *, optional* Whether to warm start the execution of the MDA algorithm. The warm start strategy consists in using the last cached values for the coupling variables as an initial guess. This is expected to reduce the number of iteration of the MDA algorithm required to reach convergence. By default it is set to False. .. raw:: html
.. _MDAJacobi_options: MDAJacobi --------- Module: :class:`gemseo.mda.jacobi` .. code-block:: python :caption: Pydantic model of the settings for MDAJacobi from gemseo.settings.mda import MDAJacobi_Settings .. raw:: html
Optional settings
  • **acceleration_method** : *, optional* The acceleration method used within the fixed point iterations. By default it is set to Alternate2Delta. .. raw:: html
  • **coupling_structure** : *gemseo.core.coupling_structure.CouplingStructure | None, optional* The coupling structure to be used by the MDA. If ``None``, the coupling structure is created from the disciplines. By default it is set to None. .. raw:: html
  • **execute_before_linearizing** : *, optional* Whether to start by executing the disciplines before linearizing. This ensures that the discipline are executed and linearized with the same input data. It can be almost free if the corresponding output data have been stored in the :attr:`.BaseMDA.cache`. By default it is set to True. .. raw:: html
  • **linear_solver** : *, optional* The name of the linear solver. By default it is set to DEFAULT. .. raw:: html
  • **linear_solver_settings** : *collections.abc.Mapping[str, typing.Any] | gemseo.algos.linear_solvers.base_linear_solver_settings.BaseLinearSolverSettings, optional* The settings passed to the linear solver factory. By default it is set to {}. .. raw:: html
  • **linear_solver_tolerance** : *, optional* The linear solver tolerance. Linear solvers are used to compute the total derivatives. By default it is set to 1e-12. .. raw:: html
  • **log_convergence** : *, optional* Whether to log the MDA convergence. The log displays the normalized residual norm. By default it is set to False. .. raw:: html
  • **max_mda_iter** : *, optional* The maximum number of iterations for the MDA algorithm. If 0, evaluate the coupling variables without trying to solve the coupling equations. By default it is set to 20. .. raw:: html
  • **n_processes** : *, optional* The number of threads/processes. Threads if ``use_threading``, processes otherwise. By default it is set to 2. .. raw:: html
  • **name** : ** The name to be given to the MDA. If empty, use the name of the class. By default it is set to . .. raw:: html
  • **over_relaxation_factor** : *, optional* The over-relaxation factor. By default it is set to 1.0. .. raw:: html
  • **tolerance** : *, optional* The tolerance for the MDA algorithm residual. The available normalization strategies for the residual are described in :attr:`.BaseMDA.ResidualScaling`. By default it is set to 1e-06. .. raw:: html
  • **use_lu_fact** : *, optional* Whether to perform an LU factorization. The factorization is used to solve the linear systems arising in the computation of the total derivatives. Since there are possibly several right-hand side, if affordable, such a factorization may improve the solution time. By default it is set to False. .. raw:: html
  • **use_threading** : *, optional* Whether to use threads instead of processes to parallelize the execution. Processes will copy (serialize) the disciplines, while threads will share the memory. If one wants to execute the same discipline multiple times, then multiprocessing should be preferred. By default it is set to True. .. raw:: html
  • **warm_start** : *, optional* Whether to warm start the execution of the MDA algorithm. The warm start strategy consists in using the last cached values for the coupling variables as an initial guess. This is expected to reduce the number of iteration of the MDA algorithm required to reach convergence. By default it is set to False. .. raw:: html
.. _MDANewtonRaphson_options: MDANewtonRaphson ---------------- Module: :class:`gemseo.mda.newton_raphson` .. code-block:: python :caption: Pydantic model of the settings for MDANewtonRaphson from gemseo.settings.mda import MDANewtonRaphson_Settings .. raw:: html
Optional settings
  • **acceleration_method** : *, optional* The acceleration method used within the fixed point iterations. By default it is set to NoTransformation. .. raw:: html
  • **coupling_structure** : *gemseo.core.coupling_structure.CouplingStructure | None, optional* The coupling structure to be used by the MDA. If ``None``, the coupling structure is created from the disciplines. By default it is set to None. .. raw:: html
  • **execute_before_linearizing** : *, optional* Whether to start by executing the disciplines before linearizing. This ensures that the discipline are executed and linearized with the same input data. It can be almost free if the corresponding output data have been stored in the :attr:`.BaseMDA.cache`. By default it is set to False. .. raw:: html
  • **linear_solver** : *, optional* The name of the linear solver. By default it is set to DEFAULT. .. raw:: html
  • **linear_solver_settings** : *collections.abc.Mapping[str, typing.Any] | gemseo.algos.linear_solvers.base_linear_solver_settings.BaseLinearSolverSettings, optional* The settings passed to the linear solver factory. By default it is set to {}. .. raw:: html
  • **linear_solver_tolerance** : *, optional* The linear solver tolerance. Linear solvers are used to compute the total derivatives. By default it is set to 1e-12. .. raw:: html
  • **log_convergence** : *, optional* Whether to log the MDA convergence. The log displays the normalized residual norm. By default it is set to False. .. raw:: html
  • **max_mda_iter** : *, optional* The maximum number of iterations for the MDA algorithm. If 0, evaluate the coupling variables without trying to solve the coupling equations. By default it is set to 20. .. raw:: html
  • **n_processes** : *, optional* The number of threads/processes. Threads if ``use_threading``, processes otherwise. By default it is set to 2. .. raw:: html
  • **name** : ** The name to be given to the MDA. If empty, use the name of the class. By default it is set to . .. raw:: html
  • **newton_linear_solver_name** : *, optional* The name of the linear solver for the Newton method. By default it is set to DEFAULT. .. raw:: html
  • **newton_linear_solver_settings** : *collections.abc.Mapping[str, typing.Any] | gemseo.algos.linear_solvers.base_linear_solver_settings.BaseLinearSolverSettings, optional* The settings for the Newton linear solver. By default it is set to {}. .. raw:: html
  • **over_relaxation_factor** : *, optional* The over-relaxation factor. By default it is set to 1.0. .. raw:: html
  • **tolerance** : *, optional* The tolerance for the MDA algorithm residual. The available normalization strategies for the residual are described in :attr:`.BaseMDA.ResidualScaling`. By default it is set to 1e-06. .. raw:: html
  • **use_lu_fact** : *, optional* Whether to perform an LU factorization. The factorization is used to solve the linear systems arising in the computation of the total derivatives. Since there are possibly several right-hand side, if affordable, such a factorization may improve the solution time. By default it is set to False. .. raw:: html
  • **use_threading** : *, optional* Whether to use threads instead of processes to parallelize the execution. Processes will copy (serialize) the disciplines, while threads will share the memory. If one wants to execute the same discipline multiple times, then multiprocessing should be preferred. By default it is set to True. .. raw:: html
  • **warm_start** : *, optional* Whether to warm start the execution of the MDA algorithm. The warm start strategy consists in using the last cached values for the coupling variables as an initial guess. This is expected to reduce the number of iteration of the MDA algorithm required to reach convergence. By default it is set to False. .. raw:: html
.. _MDAQuasiNewton_options: MDAQuasiNewton -------------- Module: :class:`gemseo.mda.quasi_newton` .. code-block:: python :caption: Pydantic model of the settings for MDAQuasiNewton from gemseo.settings.mda import MDAQuasiNewton_Settings .. raw:: html
Optional settings
  • **acceleration_method** : *, optional* The acceleration method used within the fixed point iterations. By default it is set to NoTransformation. .. raw:: html
  • **coupling_structure** : *gemseo.core.coupling_structure.CouplingStructure | None, optional* The coupling structure to be used by the MDA. If ``None``, the coupling structure is created from the disciplines. By default it is set to None. .. raw:: html
  • **execute_before_linearizing** : *, optional* Whether to start by executing the disciplines before linearizing. This ensures that the discipline are executed and linearized with the same input data. It can be almost free if the corresponding output data have been stored in the :attr:`.BaseMDA.cache`. By default it is set to True. .. raw:: html
  • **linear_solver** : *, optional* The name of the linear solver. By default it is set to DEFAULT. .. raw:: html
  • **linear_solver_settings** : *collections.abc.Mapping[str, typing.Any] | gemseo.algos.linear_solvers.base_linear_solver_settings.BaseLinearSolverSettings, optional* The settings passed to the linear solver factory. By default it is set to {}. .. raw:: html
  • **linear_solver_tolerance** : *, optional* The linear solver tolerance. Linear solvers are used to compute the total derivatives. By default it is set to 1e-12. .. raw:: html
  • **log_convergence** : *, optional* Whether to log the MDA convergence. The log displays the normalized residual norm. By default it is set to False. .. raw:: html
  • **max_mda_iter** : *, optional* The maximum number of iterations for the MDA algorithm. If 0, evaluate the coupling variables without trying to solve the coupling equations. By default it is set to 20. .. raw:: html
  • **method** : *, optional* The name of the quasi-Newton method. By default it is set to hybr. .. raw:: html
  • **n_processes** : *, optional* The number of threads/processes. Threads if ``use_threading``, processes otherwise. By default it is set to 2. .. raw:: html
  • **name** : ** The name to be given to the MDA. If empty, use the name of the class. By default it is set to . .. raw:: html
  • **over_relaxation_factor** : *, optional* The over-relaxation factor. By default it is set to 1.0. .. raw:: html
  • **tolerance** : *, optional* The tolerance for the MDA algorithm residual. The available normalization strategies for the residual are described in :attr:`.BaseMDA.ResidualScaling`. By default it is set to 1e-06. .. raw:: html
  • **use_gradient** : *, optional* Whether to use the analytic gradient of the discipline. By default it is set to False. .. raw:: html
  • **use_lu_fact** : *, optional* Whether to perform an LU factorization. The factorization is used to solve the linear systems arising in the computation of the total derivatives. Since there are possibly several right-hand side, if affordable, such a factorization may improve the solution time. By default it is set to False. .. raw:: html
  • **use_threading** : *, optional* Whether to use threads instead of processes to parallelize the execution. Processes will copy (serialize) the disciplines, while threads will share the memory. If one wants to execute the same discipline multiple times, then multiprocessing should be preferred. By default it is set to True. .. raw:: html
  • **warm_start** : *, optional* Whether to warm start the execution of the MDA algorithm. The warm start strategy consists in using the last cached values for the coupling variables as an initial guess. This is expected to reduce the number of iteration of the MDA algorithm required to reach convergence. By default it is set to False. .. raw:: html
.. _MDASequential_options: MDASequential ------------- Module: :class:`gemseo.mda.sequential_mda` .. code-block:: python :caption: Pydantic model of the settings for MDASequential from gemseo.settings.mda import MDASequential_Settings .. raw:: html
Optional settings
  • **coupling_structure** : *gemseo.core.coupling_structure.CouplingStructure | None, optional* The coupling structure to be used by the MDA. If ``None``, the coupling structure is created from the disciplines. By default it is set to None. .. raw:: html
  • **linear_solver** : *, optional* The name of the linear solver. By default it is set to DEFAULT. .. raw:: html
  • **linear_solver_settings** : *collections.abc.Mapping[str, typing.Any] | gemseo.algos.linear_solvers.base_linear_solver_settings.BaseLinearSolverSettings, optional* The settings passed to the linear solver factory. By default it is set to {}. .. raw:: html
  • **linear_solver_tolerance** : *, optional* The linear solver tolerance. Linear solvers are used to compute the total derivatives. By default it is set to 1e-12. .. raw:: html
  • **log_convergence** : *, optional* Whether to log the MDA convergence. The log displays the normalized residual norm. By default it is set to False. .. raw:: html
  • **max_mda_iter** : *, optional* The maximum number of iterations for the MDA algorithm. If 0, evaluate the coupling variables without trying to solve the coupling equations. By default it is set to 20. .. raw:: html
  • **name** : ** The name to be given to the MDA. If empty, use the name of the class. By default it is set to . .. raw:: html
  • **tolerance** : *, optional* The tolerance for the MDA algorithm residual. The available normalization strategies for the residual are described in :attr:`.BaseMDA.ResidualScaling`. By default it is set to 1e-06. .. raw:: html
  • **use_lu_fact** : *, optional* Whether to perform an LU factorization. The factorization is used to solve the linear systems arising in the computation of the total derivatives. Since there are possibly several right-hand side, if affordable, such a factorization may improve the solution time. By default it is set to False. .. raw:: html
  • **warm_start** : *, optional* Whether to warm start the execution of the MDA algorithm. The warm start strategy consists in using the last cached values for the coupling variables as an initial guess. This is expected to reduce the number of iteration of the MDA algorithm required to reach convergence. By default it is set to False. .. raw:: html