SU2 icon indicating copy to clipboard operation
SU2 copied to clipboard

Stability objectives D_*_D_ALPHA fail: SU2.io has no attribute optnames_aero

Open ManasBagul23 opened this issue 2 months ago • 0 comments

Describe the bug

stability() in SU2_PY/SU2/eval/functions.py and SU2_PY/SU2/eval/gradients.py use su2io.optnames_aero to find the base coefficient of the D_LIFT_D_ALPHA, D_DRAG_D_ALPHA, ... objectives, but optnames_aero was removed from SU2_PY/SU2/io/tools.py in 39dbebc574. Using any of these objectives from the Python scripts fails.

To Reproduce

import SU2
config = SU2.io.Config()
config.MESH_FILENAME = "mesh.su2"
SU2.eval.gradients.stability("D_LIFT_D_ALPHA", config)
  File "SU2_PY/SU2/eval/gradients.py", line 380, in stability
    matches = [k for k in su2io.optnames_aero if k in func_name]
AttributeError: module 'SU2.io' has no attribute 'optnames_aero'. Did you mean: 'optnames_geo'?

Expected behavior

The stability objectives can be evaluated from the Python scripts.

A fix is proposed in #2903.

Bug report checklist

  • [x] Consulting the build instructions (https://su2code.github.io/docs_v7/Build-SU2-Linux-MacOS/).
  • [x] Looking for similar problems on GitHub or CFD-Online (https://www.cfd-online.com/Forums/su2/).
  • [x] Updating to the newest version of SU2 (either develop, master, or the pre-built executables https://su2code.github.io/download.html).

Desktop (please complete the following information):

  • OS: Windows 11
  • C++ compiler and version: MSVC 19.44 (Visual Studio 2022 Build Tools)
  • MPI implementation and version: Microsoft MPI 10.1
  • SU2 Version: develop

ManasBagul23 avatar Sep 17 '26 16:09 ManasBagul23