gemseo / formulations

Show inherited members

mdf module

The Multi-disciplinary Design Feasible (MDF) formulation.

class gemseo.formulations.mdf.MDF(disciplines, objective_name, design_space, maximize_objective=False, grammar_type=GrammarType.JSON, main_mda_name='MDAChain', inner_mda_name='MDAJacobi', **main_mda_options)[source]

Bases: MDOFormulation

The Multidisciplinary Design Feasible (MDF) formulation.

This formulation draws an optimization architecture where:

  • the coupling of strongly coupled disciplines is made consistent by means of a Multidisciplinary Design Analysis (MDA),

  • the optimization problem with respect to the local and global design variables is made at the top level.

Note that the multidisciplinary analysis is made at each optimization iteration.

Parameters:
  • disciplines (list[MDODiscipline]) – The disciplines.

  • objective_name (str) – The name(s) of the discipline output(s) used as objective. If multiple names are passed, the objective will be a vector.

  • design_space (DesignSpace) – The design space.

  • maximize_objective (bool) –

    Whether to maximize the objective.

    By default it is set to False.

  • grammar_type (MDODiscipline.GrammarType) –

    The type of the input and output grammars.

    By default it is set to “JSONGrammar”.

  • main_mda_name (str) –

    The name of the class used for the main MDA, typically the MDAChain, but one can force to use MDAGaussSeidel for instance.

    By default it is set to “MDAChain”.

  • inner_mda_name (str) –

    The name of the class used for the inner-MDA of the main MDA, if any; typically when the main MDA is an MDAChain.

    By default it is set to “MDAJacobi”.

  • **main_mda_options (Any) – The options of the main MDA, which may include those of the inner-MDA.

classmethod get_default_sub_option_values(**options)[source]

Return the default values of the sub-options of the formulation.

When some options of the formulation depend on higher level options, the default values of these sub-options may be obtained here, mainly for use in the API.

Parameters:

**options (str) – The options required to deduce the sub-options grammar.

Returns:

Either None or the sub-options default values.

Return type:

dict

get_expected_dataflow()[source]

Get the expected data exchange sequence.

This method is used for the XDSM representation and can be overloaded by subclasses.

Returns:

The expected sequence of data exchange where the i-th item is described by the starting discipline, the ending discipline and the coupling variables.

Return type:

list[tuple[MDODiscipline, MDODiscipline, list[str]]]

get_expected_workflow()[source]

Get the expected sequence of execution of the disciplines.

This method is used for the XDSM representation and can be overloaded by subclasses.

For instance:

  • [A, B] denotes the execution of A, then the execution of B

  • (A, B) denotes the concurrent execution of A and B

  • [A, (B, C), D] denotes the execution of A, then the concurrent execution of B and C, then the execution of D.

Returns:

A sequence of elements which are either an ExecutionSequence or a tuple of ExecutionSequence for concurrent execution.

Return type:

list[ExecutionSequence, tuple[ExecutionSequence]]

classmethod get_sub_options_grammar(**options)[source]

Get the sub-options grammar.

When some options of the formulation depend on higher level options, the schema of the sub-options may be obtained here, mainly for use in the API.

Parameters:

**options (str) – The options required to deduce the sub-options grammar.

Returns:

Either None or the sub-options grammar.

Return type:

JSONGrammar

get_top_level_disc()[source]

Return the disciplines which inputs are required to run the scenario.

A formulation seeks to compute the objective and constraints from the input variables. It structures the optimization problem into multiple levels of disciplines. The disciplines directly depending on these inputs are called top level disciplines.

By default, this method returns all disciplines. This method can be overloaded by subclasses.

Returns:

The top level disciplines.

Return type:

list[MDODiscipline]

DEFAULT_INNER_MDA_NAME: Final[str] = 'MDAJacobi'

The default name of the inner MDA.

DEFAULT_MAIN_MDA_NAME: Final[str] = 'MDAChain'

The default name of the main MDA.

mda: MDA

The MDA used in the formulation.

opt_problem: OptimizationProblem

The optimization problem generated by the formulation from the disciplines.