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_data dictionary output from the calc_aero_data.

Methods

add_dependencies()

Adds dependencies found in depends_on to the function dictionary for execution.

add_or_set_dependencies(dependencies)

Adds performance parameter dependencies from a Python dictionary.

parse_update_function_str()

Converts the function string to a function executable by Python.

remove_func()

Removes the Objective or Constraint function from all the relevant locations in the object.

set_func_str(func_str)

Simple method that overwrites the func_str attribute.

update(dependencies)

Updates the function and its value using a set of dependencies.

update_function()

Updates the function based on the function string and its dependencies.

update_value()

Update the value of the Objective or Constraint using the stored function.

add_dependencies()[source]#

Adds dependencies found in depends_on to 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 Objective or Constraint.

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 Param name. 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 Objective or Constraint function from all the relevant locations in the object.

set_func_str(func_str: str)[source]#

Simple method that overwrites the func_str attribute.

Parameters:

func_str (str) – Function string used to define the Objective or Constraint from the aero_data dictionary output from the calc_aero_data.

update(dependencies: dict)[source]#

Updates the function and its value using a set of dependencies.

Parameters:

dependencies (dict) – Performance parameter dependencies from the airfoil system analysis.

update_function()[source]#

Updates the function based on the function string and its dependencies.

update_value()[source]#

Update the value of the Objective or Constraint using the stored function.