Skip to content

Commit

Permalink
Merge pull request #2141 from WelSimLLC/develop
Browse files Browse the repository at this point in the history
add Cur_Time column to the default history field for transient analysis;
  • Loading branch information
pcarruscag authored Oct 18, 2023
2 parents 9416b42 + 67c3835 commit 41d2522
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 20 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Kedar Naik
Kürşat Yurt
LaSerpe
Lennaert Tol
Liang Cheng
Lisa Kusch
Matteo Pini
Max Aehle
Expand Down
4 changes: 2 additions & 2 deletions Common/include/parallelization/omp_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions SU2_CFD/include/output/COutput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
3 changes: 1 addition & 2 deletions SU2_CFD/src/output/CAdjFlowCompOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
3 changes: 1 addition & 2 deletions SU2_CFD/src/output/CAdjFlowIncOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
3 changes: 1 addition & 2 deletions SU2_CFD/src/output/CAdjHeatOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
3 changes: 1 addition & 2 deletions SU2_CFD/src/output/CElasticityOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
3 changes: 1 addition & 2 deletions SU2_CFD/src/output/CFlowCompFEMOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
3 changes: 1 addition & 2 deletions SU2_CFD/src/output/CFlowCompOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
3 changes: 1 addition & 2 deletions SU2_CFD/src/output/CFlowIncOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
3 changes: 1 addition & 2 deletions SU2_CFD/src/output/CHeatOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
1 change: 1 addition & 0 deletions SU2_CFD/src/output/CMultizoneOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) + "]");
Expand Down
3 changes: 1 addition & 2 deletions SU2_CFD/src/output/CNEMOCompOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
7 changes: 7 additions & 0 deletions SU2_CFD/src/output/COutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 41d2522

Please sign in to comment.