gemseo / disciplines

Show inherited members

splitter module

A discipline splitting an input variable.

class gemseo.disciplines.splitter.Splitter(input_name, output_names_to_input_indices)[source]

Bases: MDODiscipline

A discipline splitting an input variable.

Several output variables containing slice of the input variable are extracted.

Examples

>>> discipline = Splitter("alpha", {"beta": [0, 1], "delta": [2, 3],
"gamma": 4})
>>> discipline.execute({"alpha": array([1.0, 2.0, 3.0, 4.0, 5.0])})
>>> delta = discipline.local_data["delta"]  # delta = array([3.0, 4.0])

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

Parameters:
  • input_name (str) – The name of the input to split.

  • output_names_to_input_indices (dict[str, Iterable[int] | int]) – The input indices associated with the output names.

cache: AbstractCache | None

The cache containing one or several executions of the discipline according to the cache policy.

data_processor: DataProcessor

A tool to pre- and post-process discipline data.

exec_for_lin: bool

Whether the last execution was due to a linearization.

input_grammar: BaseGrammar

The input grammar.

jac: MutableMapping[str, MutableMapping[str, ndarray | csr_array | JacobianOperator]]

The Jacobians of the outputs wrt inputs.

The structure is {output: {input: matrix}}.

name: str

The name of the discipline.

output_grammar: BaseGrammar

The output grammar.

re_exec_policy: ReExecutionPolicy

The policy to re-execute the same discipline.

residual_variables: dict[str, str]

The output variables mapping to their inputs, to be considered as residuals; they shall be equal to zero.

run_solves_residuals: bool

Whether the run method shall solve the residuals.