pymead.optimization.objectives_and_constraints.ObjectiveConstraint#
- class ObjectiveConstraint(func_str: str)[source]#
Bases:
object- __init__(func_str: str)[source]#
Objective or Constraint used in shape optimization. Allows for dynamic updates and equation validity checking inside the GUI.
- Parameters:
func_str (str) – Function string used to define the Objective or Constraint from the
aero_datadictionary output from thecalc_aero_data.
Methods
Adds dependencies found in
depends_onto the function dictionary for execution.add_or_set_dependencies(dependencies)Adds performance parameter dependencies from a Python dictionary.
Converts the function string to a function executable by Python.
Removes the
ObjectiveorConstraintfunction from all the relevant locations in the object.set_func_str(func_str)Simple method that overwrites the
func_strattribute.update(dependencies)Updates the function and its value using a set of dependencies.
Updates the function based on the function string and its dependencies.
Update the value of the
ObjectiveorConstraintusing the stored function.- add_dependencies()[source]#
Adds dependencies found in
depends_onto the function dictionary for execution.
- add_or_set_dependencies(dependencies: dict)[source]#
Adds performance parameter dependencies from a Python dictionary.
- Parameters:
dependencies (dict) – Performance parameters extracted from an airfoil system analysis used to define value of an
ObjectiveorConstraint.
- parse_update_function_str()[source]#
Converts the function string to a function executable by Python. The special character “.” is used to signal a depth increment within the airfoil system hierarchy. The special character “$” is used to define the start of a
Paramname. For example, the string"A0.Base.R_le"corresponds to the leading edge radius of the base parameter set of airfoil"A0".
- remove_func()[source]#
Removes the
ObjectiveorConstraintfunction from all the relevant locations in the object.
- set_func_str(func_str: str)[source]#
Simple method that overwrites the
func_strattribute.- Parameters:
func_str (str) – Function string used to define the Objective or Constraint from the
aero_datadictionary output from thecalc_aero_data.