.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/api/plot_mda.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_api_plot_mda.py: MDA === In this example, we will discover the different functions of the API related to MDAs, which are the |g|' objects dedicated to the feasibility of the multidisciplinary coupling. All classes implementing MDAs inherit from :class:`.MDA` which is an abstract class. .. GENERATED FROM PYTHON SOURCE LINES 32-46 .. code-block:: default from __future__ import division, unicode_literals from gemseo.api import ( configure_logger, create_discipline, create_mda, get_available_mdas, get_mda_options_schema, ) configure_logger() .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 47-52 Get available MDA ----------------- The :meth:`~gemseo.api.get_available_mdas` function returns the list of MDAs available in |g| or in external modules .. GENERATED FROM PYTHON SOURCE LINES 52-54 .. code-block:: default print(get_available_mdas()) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none ['GSNewtonMDA', 'MDAChain', 'MDAGaussSeidel', 'MDAJacobi', 'MDANewtonRaphson', 'MDAQuasiNewton', 'MDARoot', 'MDASequential'] .. GENERATED FROM PYTHON SOURCE LINES 55-59 Get MDA options schema ---------------------- For a given MDA algorithm, e.g. :code:`"MDAGaussSeidel"`, we can get the options; e.g. .. GENERATED FROM PYTHON SOURCE LINES 59-61 .. code-block:: default print(get_mda_options_schema("MDAGaussSeidel")) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none {'$schema': 'http://json-schema.org/schema#', 'type': 'object', 'properties': {'name': {'description': 'the name of the chain :type name: str', 'type': 'null'}, 'max_mda_iter': {'description': 'maximum number of iterations :type max_mda_iter: int', 'type': 'integer'}, 'grammar_type': {'description': 'the type of grammar to use for IO declaration either JSON_GRAMMAR_TYPE or SIMPLE_GRAMMAR_TYPE :type grammar_type: str', 'type': 'string'}, 'tolerance': {'description': 'tolerance of the iterative direct coupling solver, norm of the current residuals divided by initial residuals norm shall be lower than the tolerance to stop iterating :type tolerance: float', 'type': 'number'}, 'linear_solver_tolerance': {'description': 'Tolerance of the linear solver in the adjoint equation :type linear_solver_tolerance: float', 'type': 'number'}, 'warm_start': {'description': 'if True, the second iteration and ongoing start from the previous coupling solution :type warm_start: bool', 'type': 'boolean'}, 'use_lu_fact': {'description': 'if True, when using adjoint/forward differenciation, store a LU factorization of the matrix to solve faster multiple RHS problem :type use_lu_fact: bool', 'type': 'boolean'}, 'over_relax_factor': {'description': 'relaxation coefficient, used to make the method more robust, if 0` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_mda.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_