utils module¶
A set of functions to handle disciplines.
- gemseo.disciplines.utils.check_disciplines_consistency(disciplines, log_message, raise_error)[source]
Check if disciplines are consistent.
The disciplines are consistent if each output is computed by one and only one discipline.
- Parameters:
disciplines (Iterable[MDODiscipline]) – The disciplines of interest.
log_message (bool) – Whether to log a message when the disciplines are not consistent.
raise_error (bool) – Whether to raise an error when the disciplines are not consistent.
- Returns:
Whether the disciplines are consistent.
- Raises:
ValueError – When two disciplines compute the same output and
raise_error
isTrue
.- Return type:
- gemseo.disciplines.utils.get_all_inputs(disciplines, skip_scenarios=True)[source]
Return all the input names of the disciplines.
- gemseo.disciplines.utils.get_all_outputs(disciplines, skip_scenarios=True)[source]
Return all the output names of the disciplines.
- gemseo.disciplines.utils.get_sub_disciplines(disciplines, recursive=False)[source]
Determine the sub-disciplines.
This method lists the sub-disciplines’ disciplines. It will list up to one level of disciplines contained inside another one unless the
recursive
argument is set toTrue
.- Parameters:
disciplines (list[MDODiscipline]) – The disciplines from which the sub-disciplines will be determined.
recursive (bool) –
If
True
, the method will look inside any discipline that has other disciplines inside until it reaches a discipline without sub-disciplines, in this case the return value will not include any discipline that has sub-disciplines. IfFalse
, the method will list up to one level of disciplines contained inside another one, in this case the return value may include disciplines that contain sub-disciplines.By default it is set to False.
- Returns:
The sub-disciplines.
- Return type:
Examples using get_all_inputs¶
Example for exterior penalty applied to the Sobieski test case.
Application: Sobieski’s Super-Sonic Business Jet (MDO)
Examples using get_all_outputs¶
Example for exterior penalty applied to the Sobieski test case.
Application: Sobieski’s Super-Sonic Business Jet (MDO)