bluemira.geometry.optimisation._tools ===================================== .. py:module:: bluemira.geometry.optimisation._tools Classes ------- .. autoapisummary:: bluemira.geometry.optimisation._tools.KeepOutZone Functions --------- .. autoapisummary:: bluemira.geometry.optimisation._tools.to_objective bluemira.geometry.optimisation._tools.to_optimiser_callable bluemira.geometry.optimisation._tools.to_optimiser_callable_from_cls bluemira.geometry.optimisation._tools.to_constraint bluemira.geometry.optimisation._tools.calculate_signed_distance bluemira.geometry.optimisation._tools.make_keep_out_zone_constraint bluemira.geometry.optimisation._tools.get_shape_ineq_constraint Module Contents --------------- .. py:class:: KeepOutZone Definition of a keep-out zone for a geometry optimisation. .. py:attribute:: wire :type: bluemira.geometry.wire.BluemiraWire Closed wire defining the keep-out zone. .. py:attribute:: byedges :type: bool :value: True Whether to discretise the keep-out zone by edges or not. .. py:attribute:: dl :type: float | None :value: None The discretisation length for the keep-out zone. This overrides ``n_discr`` if given. .. py:attribute:: n_discr :type: int :value: 100 The number of points to discretise the keep-out zone into. .. py:attribute:: shape_n_discr :type: int :value: 100 The number of points to discretise the geometry being optimised into. .. py:attribute:: tol :type: float :value: 1e-08 The tolerance for the keep-out zone constraint. .. py:function:: to_objective(geom_objective: bluemira.geometry.optimisation.typed.GeomOptimiserObjective, geom: bluemira.geometry.parameterisations.GeometryParameterisation) -> bluemira.optimisation.ObjectiveCallable Convert a geometry objective function to a normal objective function. :returns: The objective function converted from a geometry objective function. .. py:function:: to_optimiser_callable(geom_callable: bluemira.geometry.optimisation.typed.GeomOptimiserCallable, geom: bluemira.geometry.parameterisations.GeometryParameterisation) -> bluemira.optimisation.OptimiserCallable Convert a geometry optimiser function to a normal optimiser function. For example, a gradient or constraint. :returns: The optimiser function converted from a geometry optimiser function. .. py:function:: to_optimiser_callable_from_cls(geom_callable: bluemira.geometry.optimisation.typed.GeomClsOptimiserCallable, geom: bluemira.geometry.parameterisations.GeometryParameterisation) -> bluemira.optimisation.OptimiserCallable Convert a geometry optimiser function to a normal optimiser function. For example, a gradient or constraint. :returns: The optimiser function converted from a geometry optimiser function. .. py:function:: to_constraint(geom_constraint: bluemira.geometry.optimisation.typed.GeomConstraintT, geom: bluemira.geometry.parameterisations.GeometryParameterisation) -> bluemira.optimisation.ConstraintT Convert a geometry constraint to a normal one. :returns: The consatraint constructed from the geometry constraint. .. py:function:: calculate_signed_distance(parameterisation: bluemira.geometry.parameterisations.GeometryParameterisation, n_shape_discr: int, zone_points: numpy.ndarray) -> numpy.ndarray Signed distance from the parameterised shape to the keep-out/in zone. :returns: Signed distance from the parameterised shape to the keep-out/in zone. .. py:function:: make_keep_out_zone_constraint(koz: KeepOutZone) -> bluemira.geometry.optimisation.typed.GeomConstraintT Make a keep-out zone inequality constraint from a wire. :returns: The inequality constraint for the keep-out zone. :raises GeometryOptimisationError: Koz wire is not closed .. py:function:: get_shape_ineq_constraint(geom: bluemira.geometry.parameterisations.GeometryParameterisation) -> list[bluemira.optimisation.ConstraintT] Retrieve the inequality constraints registered for the given parameterisation. If no constraints are registered, return an empty list. :returns: The inequality constraints registered for the given parameterisation.