bluemira.geometry.optimisation.problem

Interface for defining a geometry-based optimisation problem.

Attributes

_GeomT

Classes

GeomOptimisationProblem

Interface for a geometry optimisation problem.

Module Contents

bluemira.geometry.optimisation.problem._GeomT
class bluemira.geometry.optimisation.problem.GeomOptimisationProblem

Bases: abc.ABC, bluemira.optimisation.problem.OptimisationProblemBase

Inheritance diagram of bluemira.geometry.optimisation.problem.GeomOptimisationProblem

Interface for a geometry optimisation problem.

This is an alternative to running a geometry optimisation using the optimise_geometry() function.

abstract objective(geom: _GeomT) float

The objective function to minimise.

Parameters:

geom (_GeomT)

Return type:

float

abstract df_objective(geom: _GeomT) numpy.ndarray

The derivative of the objective function.

If not overridden, an approximation of the derivative is made using the ‘central differences’ method. This method is ignored if a non-gradient based algorithm is used when calling GeomOptimisationProblem.optimise().

Parameters:

geom (_GeomT)

Return type:

numpy.ndarray

eq_constraints() list[bluemira.geometry.optimisation.typed.GeomConstraintT]

List of equality constraints for the optimisation.

See optimise_geometry() for a description of the form these constraints should take.

Returns:

List of equality constraints for the optimisation.

Return type:

list[bluemira.geometry.optimisation.typed.GeomConstraintT]

ineq_constraints() list[bluemira.geometry.optimisation.typed.GeomConstraintT]

List of inequality constraints for the optimisation.

See optimise_geometry() for a description of the form these constraints should take.

Returns:

List of inequality constraints for the optimisation.

Return type:

list[bluemira.geometry.optimisation.typed.GeomConstraintT]

keep_out_zones() list[bluemira.geometry.optimisation._optimise.KeepOutZone]

List of geometric keep-out zones.

An iterable of keep-out zones: closed wires that the geometry must not intersect.

Returns:

List of geometric keep-out zones.

Return type:

list[bluemira.geometry.optimisation._optimise.KeepOutZone]

optimise(geom: _GeomT, *, algorithm: bluemira.optimisation._algorithm.AlgorithmType = Algorithm.SLSQP, opt_conditions: collections.abc.Mapping[str, int | float] | None = None, opt_parameters: collections.abc.Mapping[str, Any] | None = None, keep_history: bool = False, check_constraints: bool = True, check_constraints_warn: bool = True) bluemira.geometry.optimisation._optimise.GeomOptimiserResult[_GeomT]

Run the geometry optimisation.

See optimise_geometry() for a description of the parameters.

Return type:

The result of the optimisation.

Parameters:
  • geom (_GeomT)

  • algorithm (bluemira.optimisation._algorithm.AlgorithmType)

  • opt_conditions (collections.abc.Mapping[str, int | float] | None)

  • opt_parameters (collections.abc.Mapping[str, Any] | None)

  • keep_history (bool)

  • check_constraints (bool)

  • check_constraints_warn (bool)