gemseo / formulations

Show inherited members

idf module

The Individual Discipline Feasible (IDF) formulation.

class gemseo.formulations.idf.IDF(disciplines, objective_name, design_space, maximize_objective=False, normalize_constraints=True, n_processes=1, use_threading=True, start_at_equilibrium=False, grammar_type=GrammarType.JSON)[source]

Bases: MDOFormulation

The Individual Discipline Feasible (IDF) formulation.

This formulation draws an optimization architecture where the coupling variables of strongly coupled disciplines is made consistent by adding equality constraints on the coupling variables at top level, the optimization problem with respect to the local, global design variables and coupling variables is made at the top level.

The disciplinary analysis is made at each optimization iteration while the multidisciplinary analysis is made at the optimum.

  • 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.

  • normalize_constraints (bool) –

    If True, the outputs of the coupling consistency constraints are scaled.

    By default it is set to True.

  • n_processes (int) –

    The maximum simultaneous number of threads, if use_threading is True, or processes otherwise, used to parallelize the execution.

    By default it is set to 1.

  • use_threading (bool) –

    Whether to use threads instead of processes to parallelize the execution; multiprocessing will copy (serialize) all the disciplines, while threading will share all the memory. This is important to note if you want to execute the same discipline multiple times, you shall use multiprocessing.

    By default it is set to True.

  • start_at_equilibrium (bool) –

    If True, an MDA is used to initialize the coupling variables.

    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”.


Get the expected data exchange sequence.

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


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[gemseo.core.discipline.MDODiscipline, gemseo.core.discipline.MDODiscipline, list[str]]]


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.


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

Return type:

list[gemseo.core.execution_sequence.ExecutionSequence, tuple[gemseo.core.execution_sequence.ExecutionSequence]]


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.


The top level disciplines.

Return type:


opt_problem: OptimizationProblem

The optimization problem generated by the formulation from the disciplines.