gemseo / disciplines

Show inherited members

constraint_aggregation module

An MDODiscipline to aggregate constraints.

class gemseo.disciplines.constraint_aggregation.ConstraintAggregation(constraint_names, aggregation_function, name=None, **options)[source]

Bases: MDODiscipline

A discipline that aggregates the constraints computed by other disciplines.

An efficient alternative to constraint aggregation in the optimization problem is to aggregate the constraint in a discipline.

This can be included in an MDO formulation, and in particular in an MDA, so only one adjoint calculation can be performed for the aggregated constraint instead of one adjoint per original constraint dimension.

See [KH15] and [KS83].

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

  • constraint_names (Sequence[str]) – The names of the constraints to aggregate, which must be discipline outputs.

  • aggregation_function (EvaluationFunction) – The aggregation function or its name, e.g. IKS, lower_bound_KS,upper_bound_KS, POS_SUM and SUM.

  • name (str | None) – The name of the discipline.

  • **options (Any) – The options for the aggregation method.


ValueError – If the method is not supported.

class EvaluationFunction(value)[source]

Bases: StrEnum

A function to compute an aggregation of constraints.


The induces exponential function.

LOWER_BOUND_KS = 'lower_bound_KS'

The lower bound Kreisselmeier-Steinhauser function.


The maximum function.


The positive sum squared function.


The sum squared function.

UPPER_BOUND_KS = 'upper_bound_KS'

The upper bound Kreisselmeier-Steinhauser function.

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.