From a282e2247469cf5bed4ae3bc502a0fd0b4704739 Mon Sep 17 00:00:00 2001 From: riddhi1228 <24ume036@lnmiit.ac.in> Date: Tue, 17 Mar 2026 19:06:22 +0000 Subject: [PATCH] fix: add CUSTOM_OBJFUNC to historyMap.py and CFlowOutput.cpp - Add if (false) AddHistoryOutput for CUSTOM_OBJFUNC in CFlowOutput.cpp so the generator can pick it up in future - Manually add CUSTOM_OBJFUNC entry to historyMap.py Fixes #2586 --- SU2_CFD/src/output/CFlowOutput.cpp | 3 +++ SU2_PY/SU2/io/historyMap.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index d9216b7bdc2f..446db73dc13f 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1789,6 +1789,9 @@ void CFlowOutput::AddAerodynamicCoefficients(const CConfig* config) { AddHistoryOutput("AOA", "AoA", ScreenOutputFormat::FIXED, "AOA", "Angle of attack"); AddHistoryOutput("COMBO", "ComboObj", ScreenOutputFormat::SCIENTIFIC, "COMBO", "Combined obj. function value.", HistoryFieldType::COEFFICIENT); + // CUSTOM_OBJFUNC is added here so historyMap.py knows how to get its + // value, the actual output is COMBO. + if (false) AddHistoryOutput("CUSTOM_OBJFUNC", "ComboObj", ScreenOutputFormat::SCIENTIFIC, "COMBO", "Custom obj. function value.", HistoryFieldType::COEFFICIENT); } void CFlowOutput::SetAerodynamicCoefficients(const CConfig* config, const CSolver* flow_solver){ diff --git a/SU2_PY/SU2/io/historyMap.py b/SU2_PY/SU2/io/historyMap.py index 93a49a2ce0f5..76fdefbe5e63 100644 --- a/SU2_PY/SU2/io/historyMap.py +++ b/SU2_PY/SU2/io/historyMap.py @@ -310,6 +310,12 @@ "HEADER": "ComboObj", "TYPE": "COEFFICIENT", }, + "CUSTOM_OBJFUNC": { + "DESCRIPTION": "Custom obj. function value.", + "GROUP": "COMBO", + "HEADER": "ComboObj", + "TYPE": "COEFFICIENT", + }, "DEFORM_ITER": { "DESCRIPTION": "Linear solver iterations for the mesh " "deformation", "GROUP": "DEFORM",