OptimisationConstraint
- class compas_fea2.optimisation.OptimisationConstraint(*args, **kwargs)[source]
Define an optimisation constraint.
Note
Constraints can be set by simply using the
==, >=, <=
operators.Note
In topology optimization the start model for the optimization is the model used for the first finite element analysis in the optimization procedure (iteration 0). The element densities might differ from the initial model (e.g. when no volume constraint is present they are set to 50% of the original density). Take this into account when defining, e.g., relative displacement or frequency onstraints. This behavior can be controlled by the user with the parameter
DENSITY_INITIAL
in theOptimisationParameters
command.Warning
Inequality constraints can only be used for the sensitivity-based optimizations. Equality constraints can be used only for controller-based optimisations.
- Parameters
name (str) – name of the constraint
design_response (obj) –
compas_fea2.optimisation.DesignResponse
subclass object of the desing response to constraintrelative (bool) – if
True
the constraint is set relatively to the initial value of the desing response. Relative values always refer to the design response of the start model for the optimization. Example: The relative value 0.8 represents 80%
Example
>>> constraint = OptimisationConstraint('vol_frac', dr_volume, True) >>> constraint <= 0.3
Inherited Methods
Converts the instance to a string.
Make an independent copy of the data object.
Construct an object of this type from the provided data.
Construct an object from serialized data contained in a JSON file.
Construct an object from serialized data contained in a JSON string.
Create an instance of a class of the registered plugin from its name.
Compute a hash of the data for comparison during version control using the sha256 algorithm.
Convert an object to its native data representation.
Serialize the data representation of an object to a JSON file.
Serialize the data representation of an object to a JSON string.
Validate the object's data against its data schema.
Validate the object's data against its json schema.