gemseo.core.chains.chain module#

Chains of disciplines.

class MDOChain(disciplines, name='')[source]#

Bases: ProcessDiscipline

Chain of disciplines that is based on a predefined order of execution.

Initialize self. See help(type(self)) for accurate signature.

Parameters:
  • disciplines (Sequence[Discipline]) -- The disciplines.

  • name (str) --

    The name of the discipline. If None, use the class name.

    By default it is set to "".

class LinearizationMode(*values)#

Bases: StrEnum

AUTO = 'auto'#
CENTERED_DIFFERENCES = 'centered_differences'#
COMPLEX_STEP = 'complex_step'#
FINITE_DIFFERENCES = 'finite_differences'#
REVERSE = 'reverse'#
static copy_jacs(jacobian)[source]#

Deepcopy a Jacobian dictionary.

Parameters:

jacobian (dict[str, dict[str, ndarray]]) -- The Jacobian dictionary, which is a nested dictionary as {'out': {'in': derivatives}}.

Returns:

The deepcopy of the Jacobian dictionary.

Return type:

dict[str, dict[str, ndarray]]

reverse_chain_rule(chain_outputs, discipline)[source]#

Chain the derivatives with a new discipline in the chain in reverse mode.

Perform chain ruling: (notation: D is total derivative, d is partial derivative)

D out d out dinpt_1 d output dinpt_2 ----- = -------- . ------- + -------- . -------- D new_in d inpt_1 d new_in d inpt_2 d new_in

D out d out d out dinpt_2 ----- = -------- + -------- . -------- D z d z d inpt_2 d z

D out d out [dinpt_1 d out d inpt_1 dinpt_2 ] ----- = -------- . [------- + -------- . -------- . --------] D z d inpt_1 [d z d inpt_1 d inpt_2 d z ]

Parameters:
  • discipline (Discipline) -- The new discipline to compose in the chain.

  • chain_outputs (Iterable[str]) -- The outputs to lineariza.

Return type:

None