Design#

class ansys.optislang.core.project_parametric.Design(parameters: Mapping[str, bool | str | float | None] | Iterable[Parameter | DesignVariable] = [], constraints: Mapping[str, bool | str | float | None] | Iterable[LimitStateCriterion | DesignVariable] = [], limit_states: Mapping[str, bool | str | float | None] | Iterable[LimitStateCriterion | DesignVariable] = [], objectives: Mapping[str, bool | str | float | None] | Iterable[ObjectiveCriterion | DesignVariable] = [], variables: Mapping[str, bool | str | float | None] | Iterable[VariableCriterion | DesignVariable] = [], responses: Mapping[str, bool | str | float | None] | Iterable[Response | DesignVariable] = [], feasibility: bool | None = None, design_id: int | None = None, status: DesignStatus = DesignStatus.IDLE)#

Stores information about the design point, exclusively for the root system.

Parameters:
parametersUnion[

Mapping[str, Union[bool, str, float, None]], Iterable[Union[Parameter, DesignVariable]],

], optional

Dictionary of parameters and their values {‘name’: value, …} or an iterable of design variables or parameters. By default [].

constraintsUnion[

Mapping[str, Union[bool, str, float, None]], Iterable[Union[ConstraintCriterion, DesignVariable]],

], optional

Dictionary of constraint criteria and their values {‘name’: value, …} or an iterable of design variables or constraint criteria. By default [].

limit_statesUnion[

Mapping[str, Union[bool, str, float, None]], Iterable[Union[Criterion, DesignVariable]],

], optional

Dictionary of limit state criteria and their values {‘name’: value, …} or an iterable of design variables or limist state criteria. By default [].

objectivesUnion[

Mapping[str, Union[bool, str, float, None]], Iterable[Union[Criterion, DesignVariable]],

], optional

Dictionary of objective criteria and their values {‘name’: value, …} or an iterable of design variables or objective criteria. By default [].

variablesUnion[

Mapping[str, Union[bool, str, float, None]], Iterable[Union[Criterion, DesignVariable]],

], optional

Dictionary of variable criteria and their values {‘name’: value, …} or an iterable of design variables or variable criteria. By default [].

responsesUnion[

Mapping[str, Union[bool, str, float, None]], Iterable[Union[Response, DesignVariable]],

], optional

Dictionary of responses and their values {‘name’: value, …} or an iterable of design variables or responses. By default []`.

feasibility: Optional[bool], optional

Determines whether design is feasible, defaults to None (no info about feasibility).

design_id: Optional[int], optional

Design’s id, defaults to None.

status: DesignStatus, optional

Design’s status, defaults to DesignStatus.IDLE.

Examples

Get the reference design:

>>> from ansys.optislang.core import Optislang
>>> osl = Optislang()
>>> root_system = osl.project.root_system
>>> design = root_system.get_reference_design()
>>> design.set_parameter_by_name(parameter = 'a', value = 2)
>>> print(design)
>>> osl.dispose()

Methods

Design.clear_parameters()

Remove all defined parameters from the design.

Design.copy_unevaluated_design()

Create a deep copy of the unevaluated design.

Design.remove_parameter(name)

Remove a parameter from the design.

Design.set_parameter(parameter[, reset_output])

Set the value of a parameter by instance or add a new parameter.

Design.set_parameter_by_name(name[, value, ...])

Set the value of a parameter by name or add a new parameter.

Attributes

Design.constraints

Tuple of all constraints.

Design.constraints_names

Tuple of all constraint names.

Design.feasibility

Feasibility of the design.

Design.id

ID of the design.

Design.limit_states

Tuple of all limit states.

Design.limit_states_names

Tuple of all limit state names.

Design.objectives

Tuple of all objectives.

Design.objectives_names

Tuple of all objective names.

Design.parameters

Tuple of all parameters.

Design.parameters_names

Tuple of all parameter names.

Design.responses

Tuple of all responses.

Design.responses_names

Tuple of all response names.

Design.status

Status of the Design class instance.

Design.variables

Tuple of all variables.

Design.variables_names

Tuple of all variable names.