Skip to content

Conversation

@shbhmexe
Copy link

Description

Defining Custom Objective Function does not work with shape_optimization.py. The historyMap.py is 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.py script has been updated to handle cases where HistoryFieldType is passed as a variable (without :: separator), preventing script crashes on some existing files in develop.


Proposed Changes

Files Modified:

  1. SU2_CFD/src/output/CFlowOutput.cpp

    • Added custom objective function output field for unsteady adjoint cases
  2. SU2_PY/updateHistoryMap.py

    • Fixed parsing logic to handle field types with and without :: separator
    • Ensures compatibility with existing code in develop branch
  3. SU2_PY/SU2/io/historyMap.py

    • Regenerated using the updated script

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.

Related Issues/PRs


Testing

  • Locally verified that updateHistoryMap.py runs successfully
  • Generated historyMap.py matches expected output
  • No compilation errors expected

Rebased fix from PR su2code#2587 with additional compatibility patch.

Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
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.

1 participant