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:
- parameters
Union
[ 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
[]
.- constraints
Union
[ 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_states
Union
[ 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
[]
.- objectives
Union
[ 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
[]
.- variables
Union
[ 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
[]
.- responses
Union
[ 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.
- parameters
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
Remove all defined parameters from the 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
Tuple of all constraints.
Tuple of all constraint names.
Feasibility of the design.
ID of the design.
Tuple of all limit states.
Tuple of all limit state names.
Tuple of all objectives.
Tuple of all objective names.
Tuple of all parameters.
Tuple of all parameter names.
Tuple of all responses.
Tuple of all response names.
Status of the
Design
class instance.Tuple of all variables.
Tuple of all variable names.