Match turbomachinery adjoint file suffixes in SU2_PY - #2907
Closed
ManasBagul23 wants to merge 1 commit into
Closed
ManasBagul23 wants to merge 1 commit into
ManasBagul23 wants to merge 1 commit into
Conversation
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.
There was a problem hiding this comment.
🟢 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.
6 tasks
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
CConfig::GetObjFunc_Extensionnames the adjoint files ofTOTAL_PRESSURE_LOSSandKINETIC_ENERGY_LOSSwith_tot_press_lossand_kin_en_loss, butget_adjointSuffixinSU2_PY/SU2/io/tools.pyreturnsplandke. 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_adjointSuffixuses the same one.Related Work
Closes #2917.
The suffixes in CConfig were added in #2446.
PR Checklist
pre-commit run --allto format old commits.