fix(SU2_PY): Fix Custom Objective Function for Unsteady Adjoint#2663
Closed
shbhmexe wants to merge 22 commits intosu2code:developfrom
Closed
fix(SU2_PY): Fix Custom Objective Function for Unsteady Adjoint#2663shbhmexe wants to merge 22 commits intosu2code:developfrom
shbhmexe wants to merge 22 commits intosu2code:developfrom
Conversation
added 4 commits
December 28, 2025 12:08
Rebased fix from PR su2code#2587 with additional compatibility patch. Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
Add CUSTOM_OBJFUNC output field support for shape_optimization.py. Fix updateHistoryMap.py parsing for field types without :: separator. Rebased from PR su2code#2587 (ErcanUmut60). Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
pcarruscag
reviewed
Dec 28, 2025
added 2 commits
December 29, 2025 14:55
Run updateHistoryMap.py to regenerate historyMap.py. Fix script to handle HistoryFieldType passed as variable (without ::). Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
added 14 commits
December 30, 2025 12:47
Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
Updated updateHistoryMap.py to robustly parse conditional AddHistoryOutput calls. Regenerated historyMap.py to restore missing CUSTOM_OBJFUNC entries, resolving 'ComboObj' mapping errors in regression tests. Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
…CUSTOM_OBJFUNC; regenerate and format • updateHistoryMap.py: write history_header_map in insertion order (not sorted) to keep precedence when multiple fields share a HEADER (e.g. CUSTOM_OBJFUNC and COMBO both use "ComboObj"); ensures the last entry (COMBO from C++ output) wins. • Regenerate SU2_PY/SU2/io/historyMap.py with corrected ordering (CUSTOM_OBJFUNC before COMBO). • Run Black on the touched files. Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
Author
|
hey @pcarruscag , I have implemented the fixes . I've verified that all regression tests are now passing with the latest commit. |
Author
|
what about this ? |
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.
Description
Defining Custom Objective Function does not work with
shape_optimization.py. ThehistoryMap.pyis updated in order to fix the problem.This PR is a rebased and fixed version of #2587 (original author: @ErcanUmut60), which was approved but stalled due to merge permissions.
Additional Fix: The
updateHistoryMap.pyscript has been updated to handle cases whereHistoryFieldTypeis passed as a variable (without::separator), preventing script crashes on some existing files indevelop.Proposed Changes
Files Modified:
SU2_CFD/src/output/CFlowOutput.cppSU2_PY/updateHistoryMap.py::separatordevelopbranchSU2_PY/SU2/io/historyMap.pyChecklist
pre-commit run --allto format old commits.Related Issues/PRs
Testing
updateHistoryMap.pyruns successfullyhistoryMap.pymatches expected output