Skip to content

Add missing adjoint suffixes to get_adjointSuffix - #2909

Merged
pcarruscag merged 1 commit into
su2code:developfrom
ManasBagul23:fix-missing-adjoint-suffixes
Sep 17, 2026
Merged

pcarruscag merged 1 commit into
su2code:developfrom
ManasBagul23:fix-missing-adjoint-suffixes

Conversation

@ManasBagul23

Copy link
Copy Markdown

Proposed Changes

Eleven objectives that CConfig::GetObjFunc_Extension gives an adjoint file suffix were missing from get_adjointSuffix in SU2_PY/SU2/io/tools.py, so the Python scripts stop with Unrecognized adjoint function name when one of them is used:

INVERSE_DESIGN_HEATFLUX, AVG_TEMPERATURE, SURFACE_STATIC_TEMPERATURE, SURFACE_SPECIES_0, SURFACE_SPECIES_VARIANCE, REFERENCE_GEOMETRY, REFERENCE_NODE, VOLUME_FRACTION, TOPOL_DISCRETENESS, TOPOL_COMPLIANCE, STRESS_PENALTY

INVERSE_DESIGN_HEATFLUX was listed as INVERSE_DESIGN_HEAT, which is not an objective name in SU2, so that entry is renamed. The suffixes are the ones from GetObjFunc_Extension. After this change every objective with a suffix in CConfig is found by get_adjointSuffix.

Related Work

Complements #2907, which corrects the suffixes of TOTAL_PRESSURE_LOSS and KINETIC_ENERGY_LOSS. The two PRs do not conflict.

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

Eleven objectives that CConfig::GetObjFunc_Extension gives an adjoint
file suffix (for example SURFACE_STATIC_TEMPERATURE, AVG_TEMPERATURE,
SURFACE_SPECIES_0 and INVERSE_DESIGN_HEATFLUX) were missing from the
Python name map, so the Python scripts stopped with "Unrecognized
adjoint function name" for them. INVERSE_DESIGN_HEATFLUX was listed as
INVERSE_DESIGN_HEAT, which is not an objective name in SU2.
Copilot AI lite review requested due to automatic review settings September 16, 2026 20:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review issues were identified.

Pull request overview

Updates Python adjoint suffix lookup to match the C++ objective definitions.

Changes:

  • Corrects the inverse-design heat objective name.
  • Adds suffix mappings for eleven objectives.
  • Aligns Python output naming with GetObjFunc_Extension.
File summaries
File Summary
SU2_PY/SU2/io/tools.py Updates and expands adjoint objective suffix mappings.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@pcarruscag
pcarruscag merged commit 4ea31da into su2code:develop Sep 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants