diff --git a/AUTHORS.md b/AUTHORS.md index 9249aef50a1..f47640de49a 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -98,6 +98,7 @@ Kedar Naik Kürşat Yurt LaSerpe Lennaert Tol +Liang Cheng Lisa Kusch Matteo Pini Max Aehle diff --git a/Common/include/parallelization/omp_structure.hpp b/Common/include/parallelization/omp_structure.hpp index 2ba94e99e2a..50db940e745 100644 --- a/Common/include/parallelization/omp_structure.hpp +++ b/Common/include/parallelization/omp_structure.hpp @@ -189,14 +189,14 @@ void omp_finalize(); */ #define BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS \ - SU2_OMP_BARRIER \ + SU2_OMP_BARRIER; \ if (omp_in_parallel()) AD::StartNoSharedReading(); \ SU2_OMP_MASTER #define END_SU2_OMP_SAFE_GLOBAL_ACCESS \ END_SU2_OMP_MASTER \ if (omp_in_parallel()) AD::EndNoSharedReading(); \ - SU2_OMP_BARRIER + SU2_OMP_BARRIER; #define SU2_OMP_SAFE_GLOBAL_ACCESS(...) BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS{__VA_ARGS__} END_SU2_OMP_SAFE_GLOBAL_ACCESS diff --git a/SU2_CFD/include/output/COutput.hpp b/SU2_CFD/include/output/COutput.hpp index 0060e60501f..2ce54f87e48 100644 --- a/SU2_CFD/include/output/COutput.hpp +++ b/SU2_CFD/include/output/COutput.hpp @@ -806,6 +806,11 @@ class COutput { */ void SetCommonHistoryFields(); + /*! + * \brief Request the history fields common for all solvers. + */ + void RequestCommonHistory(bool dynamic); + /*! * \brief Parses user-defined outputs. */ diff --git a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp index 92c09dd01f4..95c2b7fec42 100644 --- a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp @@ -36,8 +36,7 @@ CAdjFlowCompOutput::CAdjFlowCompOutput(CConfig *config, unsigned short nDim) : C /*--- Set the default history fields if nothing is set in the config file ---*/ if (nRequestedHistoryFields == 0) { - requestedHistoryFields.emplace_back("ITER"); - requestedHistoryFields.emplace_back("RMS_RES"); + RequestCommonHistory(config->GetTime_Domain()); requestedHistoryFields.emplace_back("SENSITIVITY"); nRequestedHistoryFields = requestedHistoryFields.size(); } diff --git a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp index b279d0fbfe1..abde7c95334 100644 --- a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp @@ -42,8 +42,7 @@ CAdjFlowIncOutput::CAdjFlowIncOutput(CConfig *config, unsigned short nDim) : CAd /*--- Set the default history fields if nothing is set in the config file ---*/ if (nRequestedHistoryFields == 0) { - requestedHistoryFields.emplace_back("ITER"); - requestedHistoryFields.emplace_back("RMS_RES"); + RequestCommonHistory(config->GetTime_Domain()); requestedHistoryFields.emplace_back("SENSITIVITY"); nRequestedHistoryFields = requestedHistoryFields.size(); } diff --git a/SU2_CFD/src/output/CAdjHeatOutput.cpp b/SU2_CFD/src/output/CAdjHeatOutput.cpp index 2b856ef793b..bb4e03f005a 100644 --- a/SU2_CFD/src/output/CAdjHeatOutput.cpp +++ b/SU2_CFD/src/output/CAdjHeatOutput.cpp @@ -36,8 +36,7 @@ CAdjHeatOutput::CAdjHeatOutput(CConfig *config, unsigned short nDim) : COutput(c /*--- Set the default history fields if nothing is set in the config file ---*/ if (nRequestedHistoryFields == 0){ - requestedHistoryFields.emplace_back("ITER"); - requestedHistoryFields.emplace_back("RMS_RES"); + RequestCommonHistory(config->GetTime_Domain()); requestedHistoryFields.emplace_back("SENSITIVITY"); nRequestedHistoryFields = requestedHistoryFields.size(); } diff --git a/SU2_CFD/src/output/CElasticityOutput.cpp b/SU2_CFD/src/output/CElasticityOutput.cpp index 288fd8adbf8..8abc2688f1e 100644 --- a/SU2_CFD/src/output/CElasticityOutput.cpp +++ b/SU2_CFD/src/output/CElasticityOutput.cpp @@ -43,8 +43,7 @@ CElasticityOutput::CElasticityOutput(CConfig *config, unsigned short nDim) : COu /*--- Default fields for screen output ---*/ if (nRequestedHistoryFields == 0){ - requestedHistoryFields.emplace_back("ITER"); - requestedHistoryFields.emplace_back("RMS_RES"); + RequestCommonHistory(dynamic); nRequestedHistoryFields = requestedHistoryFields.size(); } diff --git a/SU2_CFD/src/output/CFlowCompFEMOutput.cpp b/SU2_CFD/src/output/CFlowCompFEMOutput.cpp index d6ed5b9dc48..31f9542d11f 100644 --- a/SU2_CFD/src/output/CFlowCompFEMOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompFEMOutput.cpp @@ -38,8 +38,7 @@ CFlowCompFEMOutput::CFlowCompFEMOutput(CConfig *config, unsigned short nDim) : C /*--- Set the default history fields if nothing is set in the config file ---*/ if (nRequestedHistoryFields == 0){ - requestedHistoryFields.emplace_back("ITER"); - requestedHistoryFields.emplace_back("RMS_RES"); + RequestCommonHistory(config->GetTime_Domain()); nRequestedHistoryFields = requestedHistoryFields.size(); } if (nRequestedScreenFields == 0){ diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index 8e39772f9c1..73f528ece17 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -37,8 +37,7 @@ CFlowCompOutput::CFlowCompOutput(const CConfig *config, unsigned short nDim) : C /*--- Set the default history fields if nothing is set in the config file ---*/ if (nRequestedHistoryFields == 0){ - requestedHistoryFields.emplace_back("ITER"); - requestedHistoryFields.emplace_back("RMS_RES"); + RequestCommonHistory(config->GetTime_Domain()); nRequestedHistoryFields = requestedHistoryFields.size(); } if (nRequestedScreenFields == 0){ diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index f729dfed82e..8159c16b345 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -46,8 +46,7 @@ CFlowIncOutput::CFlowIncOutput(CConfig *config, unsigned short nDim) : CFlowOutp /*--- Set the default history fields if nothing is set in the config file ---*/ if (nRequestedHistoryFields == 0){ - requestedHistoryFields.emplace_back("ITER"); - requestedHistoryFields.emplace_back("RMS_RES"); + RequestCommonHistory(config->GetTime_Domain()); nRequestedHistoryFields = requestedHistoryFields.size(); } diff --git a/SU2_CFD/src/output/CHeatOutput.cpp b/SU2_CFD/src/output/CHeatOutput.cpp index 39d5ee3796f..04cb4504a7e 100644 --- a/SU2_CFD/src/output/CHeatOutput.cpp +++ b/SU2_CFD/src/output/CHeatOutput.cpp @@ -35,8 +35,7 @@ CHeatOutput::CHeatOutput(CConfig *config, unsigned short nDim) : CFVMOutput(conf /*--- Set the default history fields if nothing is set in the config file ---*/ if (nRequestedHistoryFields == 0){ - requestedHistoryFields.emplace_back("ITER"); - requestedHistoryFields.emplace_back("RMS_RES"); + RequestCommonHistory(config->GetTime_Domain()); nRequestedHistoryFields = requestedHistoryFields.size(); } if (nRequestedScreenFields == 0){ diff --git a/SU2_CFD/src/output/CMultizoneOutput.cpp b/SU2_CFD/src/output/CMultizoneOutput.cpp index a30acca6268..60060b79cb1 100644 --- a/SU2_CFD/src/output/CMultizoneOutput.cpp +++ b/SU2_CFD/src/output/CMultizoneOutput.cpp @@ -45,6 +45,7 @@ CMultizoneOutput::CMultizoneOutput(const CConfig* driver_config, const CConfig* if (nRequestedHistoryFields == 0){ requestedHistoryFields.emplace_back("ITER"); + if (config[ZONE_0]->GetTime_Domain()) requestedHistoryFields.emplace_back("CUR_TIME"); for (iZone = 0; iZone < nZone; iZone++){ requestedHistoryFields.emplace_back(bgs_res_name + "[" + PrintingToolbox::to_string(iZone) + "]"); requestedHistoryFields.emplace_back("AVG_RES[" + PrintingToolbox::to_string(iZone) + "]"); diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index 67adfe1559e..e02c58f2c9e 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -38,8 +38,7 @@ CNEMOCompOutput::CNEMOCompOutput(const CConfig *config, unsigned short nDim) : C /*--- Set the default history fields if nothing is set in the config file ---*/ if (nRequestedHistoryFields == 0){ - requestedHistoryFields.emplace_back("ITER"); - requestedHistoryFields.emplace_back("RMS_RES"); + RequestCommonHistory(config->GetTime_Domain()); nRequestedHistoryFields = requestedHistoryFields.size(); } if (nRequestedScreenFields == 0){ diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 4f52cd64fdb..4dad97f8e34 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -2017,6 +2017,13 @@ void COutput::SetCommonHistoryFields() { } +void COutput::RequestCommonHistory(bool dynamic) { + + requestedHistoryFields.emplace_back("ITER"); + if (dynamic) requestedHistoryFields.emplace_back("CUR_TIME"); + requestedHistoryFields.emplace_back("RMS_RES"); +} + void COutput::SetCustomOutputs(const CConfig* config) { const auto& inputString = config->GetCustomOutputs();