Skip to content

Match turbomachinery adjoint file suffixes in SU2_PY - #2907

Closed
ManasBagul23 wants to merge 1 commit into
su2code:developfrom
ManasBagul23:fix-turbo-adjoint-suffix
Closed

ManasBagul23 wants to merge 1 commit into
su2code:developfrom
ManasBagul23:fix-turbo-adjoint-suffix

Conversation

@ManasBagul23

@ManasBagul23 ManasBagul23 commented Sep 16, 2026

Copy link
Copy Markdown

Proposed Changes

CConfig::GetObjFunc_Extension names the adjoint files of TOTAL_PRESSURE_LOSS and KINETIC_ENERGY_LOSS with _tot_press_loss and _kin_en_loss, but get_adjointSuffix in SU2_PY/SU2/io/tools.py returns pl and ke. The Python scripts therefore look for adjoint restart and solution files that SU2 does not write when either objective is used.

After this change every objective that has a suffix in both CConfig and get_adjointSuffix uses the same one.

Related Work

Closes #2917.

The suffixes in CConfig were added in #2446.

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.

CConfig::GetObjFunc_Extension names the adjoint files for
TOTAL_PRESSURE_LOSS and KINETIC_ENERGY_LOSS with the suffixes
"_tot_press_loss" and "_kin_en_loss", but get_adjointSuffix still
returned "pl" and "ke". The Python scripts therefore looked for adjoint
restart and solution files that SU2 never writes when either of these
objectives is used.
Copilot AI lite review requested due to automatic review settings September 16, 2026 19:56

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

The suffix mappings now match generated filenames, with no unresolved issues.

Pull request overview

This pull request aligns Python adjoint filename suffixes with C++ CConfig output names.

Changes:

  • Updated kinetic-energy-loss suffix mapping.
  • Updated total-pressure-loss suffix mapping.
File summaries
File Description
SU2_PY/SU2/io/tools.py Synchronizes turbomachinery 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 pushed a commit that referenced this pull request Sep 17, 2026
[skip ci]
## 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
- [x] I am submitting my contribution to the develop branch.
- [x] My contribution generates no new compiler warnings (try with
--warnlevel=3 when using meson).
- [x] My contribution is commented and consistent with SU2 style
(https://su2code.github.io/docs_v7/Style-Guide/).
- [x] 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.
@bigfooted bigfooted closed this Sep 18, 2026
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