gemseo.core.derivatives.chain_rule module#
The chain rule.
- traverse_add_diff_io(graph, input_names, output_names, add_differentiated_ios=True)[source]#
Set the required differentiated IOs for the disciplines in a chain.
Add the differentiated inputs and outputs to the disciplines in a chain of executions, given the list of inputs with respect to which the derivation is made and the list of outputs to be derived. The inputs and outputs are a subset of all the inputs and outputs of the chain. This allows to minimize the number of linearizations to perform in the disciplines.
Uses a two ways (from inputs to outputs and then from outputs to inputs) breadth first search graph traversal algorithm. The graph is constructed by
DependencyGraph
, which represents the data connexions (edges) between the disciplines (nodes).- Parameters:
graph (DiGraph) -- The data graph of the process, built from
DependencyGraph
.input_names (Iterable[str]) -- The inputs with respect to which the chain is differentiated.
output_names (Iterable[str]) -- The chain outputs to be differentiated.
add_differentiated_ios (bool) --
Whether to add the differentiated inputs and outputs to the discipline by calling ~.Discipline.add_differentiated_inputs and ~.Discipline.add_differentiated_outputs
By default it is set to True.
- Returns:
The merged differentiated inputs and outputs.
- Return type:
DisciplineIOMapping