Skip to content

Commit 6df088f

Browse files
committed
fix HB history output (all instances were going to the same file)
1 parent 495270d commit 6df088f

5 files changed

Lines changed: 58 additions & 88 deletions

File tree

Common/include/CConfig.hpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,6 @@ class CConfig {
11091109
unsigned short Comm_Level; /*!< \brief Level of MPI communications to be performed. */
11101110
unsigned short Kind_Verification_Solution; /*!< \brief Verification solution for accuracy assessment. */
11111111

1112-
ofstream *ConvHistFile; /*!< \brief Store the pointer to each history file */
11131112
bool Time_Domain; /*!< \brief Determines if the multizone problem is solved in time-domain */
11141113
unsigned long nOuterIter, /*!< \brief Determines the number of outer iterations in the multizone problem */
11151114
nInnerIter, /*!< \brief Determines the number of inner iterations in each multizone block */
@@ -9004,16 +9003,6 @@ class CConfig {
90049003
type = top_optim_proj_type; param = top_optim_proj_param;
90059004
}
90069005

9007-
/*!
9008-
* \brief Retrieve the ofstream of the history file for the current zone.
9009-
*/
9010-
ofstream* GetHistFile(void) { return ConvHistFile; }
9011-
9012-
/*!
9013-
* \brief Set the ofstream of the history file for the current zone.
9014-
*/
9015-
void SetHistFile(ofstream *HistFile) { ConvHistFile = HistFile; }
9016-
90179006
/*!
90189007
* \brief Get the filenames of the individual config files
90199008
* \return File name of the config file for zone "index"

Common/src/CConfig.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,8 +1008,6 @@ void CConfig::SetPointersNull(void) {
10081008
nBlades = nullptr;
10091009
FreeStreamTurboNormal = nullptr;
10101010

1011-
ConvHistFile = nullptr;
1012-
10131011
top_optim_kernels = nullptr;
10141012
top_optim_kernel_params = nullptr;
10151013
top_optim_filter_radius = nullptr;
@@ -3064,10 +3062,7 @@ bool CConfig::SetRunTime_Parsing(char case_filename[MAX_STRING_SIZE]) {
30643062
}
30653063

30663064
void CConfig::SetHeader(unsigned short val_software) const{
3067-
/*--- WARNING: when compiling on Windows, ctime() is not available. Comment out
3068-
the two lines below that use the dt variable. ---*/
3069-
//time_t now = time(0);
3070-
//string dt = ctime(&now); dt[24] = '.';
3065+
30713066
if ((iZone == 0) && (rank == MASTER_NODE)){
30723067
cout << endl << "-------------------------------------------------------------------------" << endl;
30733068
cout << "| ___ _ _ ___ |" << endl;
@@ -3083,7 +3078,6 @@ void CConfig::SetHeader(unsigned short val_software) const{
30833078
}
30843079

30853080
cout << "| |" << endl;
3086-
//cout << "| Local date and time: " << dt << " |" << endl;
30873081
cout <<"-------------------------------------------------------------------------" << endl;
30883082
cout << "| SU2 Project Website: https://su2code.github.io |" << endl;
30893083
cout << "| |" << endl;

SU2_CFD/src/drivers/CDriver.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ void CDriver::Solver_Preprocessing(CConfig* config, CGeometry** geometry, CSolve
10631063

10641064
/*--- Set up any necessary inlet profiles ---*/
10651065

1066-
Inlet_Preprocessing(solver, geometry, config);
1066+
Inlet_Preprocessing(solver, geometry, config);
10671067

10681068
}
10691069

@@ -1196,7 +1196,7 @@ void CDriver::Solver_Restart(CSolver ***solver, CGeometry **geometry,
11961196
CConfig *config, bool update_geo) {
11971197

11981198
bool euler, ns, turbulent,
1199-
NEMO_euler, NEMO_ns,
1199+
NEMO_euler, NEMO_ns,
12001200
adj_euler, adj_ns, adj_turb,
12011201
heat, fem, fem_euler, fem_ns, fem_dg_flow,
12021202
template_solver, disc_adj, disc_adj_fem, disc_adj_turb, disc_adj_heat;
@@ -1447,7 +1447,7 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol
14471447
NEMO_euler = compressible = true; break;
14481448

14491449
case NEMO_NAVIER_STOKES:
1450-
NEMO_ns = compressible = true; break;
1450+
NEMO_ns = compressible = true; break;
14511451

14521452
case RANS:
14531453
case DISC_ADJ_RANS:
@@ -3202,7 +3202,6 @@ CTurbomachineryDriver::CTurbomachineryDriver(char* confFile, unsigned short val_
32023202
ConvHist_file[iZone] = new ofstream[nInst[iZone]];
32033203
for (iInst = 0; iInst < nInst[iZone]; iInst++) {
32043204
output_legacy->SetConvHistory_Header(&ConvHist_file[iZone][iInst], config_container[iZone], iZone, iInst);
3205-
config_container[iZone]->SetHistFile(&ConvHist_file[iZone][INST_0]);
32063205
}
32073206
}
32083207
}
@@ -3409,7 +3408,7 @@ bool CTurbomachineryDriver::Monitor(unsigned long ExtIter) {
34093408
case INC_EULER: case INC_NAVIER_STOKES: case INC_RANS:
34103409
StopCalc = integration_container[ZONE_0][INST_0][FLOW_SOL]->GetConvergence(); break;
34113410
case NEMO_EULER: case NEMO_NAVIER_STOKES:
3412-
StopCalc = integration_container[ZONE_0][INST_0][FLOW_SOL]->GetConvergence(); break;
3411+
StopCalc = integration_container[ZONE_0][INST_0][FLOW_SOL]->GetConvergence(); break;
34133412
case DISC_ADJ_EULER: case DISC_ADJ_NAVIER_STOKES: case DISC_ADJ_RANS:
34143413
case DISC_ADJ_INC_EULER: case DISC_ADJ_INC_NAVIER_STOKES: case DISC_ADJ_INC_RANS:
34153414
case DISC_ADJ_FEM_EULER: case DISC_ADJ_FEM_NS: case DISC_ADJ_FEM_RANS:
@@ -3448,7 +3447,6 @@ CHBDriver::CHBDriver(char* confFile,
34483447
ConvHist_file[iZone] = new ofstream[nInst[iZone]];
34493448
for (iInst = 0; iInst < nInst[iZone]; iInst++) {
34503449
output_legacy->SetConvHistory_Header(&ConvHist_file[iZone][iInst], config_container[iZone], iZone, iInst);
3451-
config_container[iZone]->SetHistFile(&ConvHist_file[iZone][iInst]);
34523450
}
34533451
}
34543452
}

SU2_CFD/src/output/CFlowOutput.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -448,10 +448,10 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi
448448
/*--- Compute flow uniformity parameters separately (always area for now). ---*/
449449

450450
Area = fabs(Surface_Area_Total[iMarker_Analyze]);
451-
451+
452452
/*--- The definitions for Distortion and Uniformity Parameters are taken as defined by Banko, Andrew J., et al. in section 3.2 of
453453
https://www.sciencedirect.com/science/article/pii/S0142727X16301412 ------*/
454-
454+
455455
if (Area != 0.0) {
456456
Surface_MomentumDistortion_Total[iMarker_Analyze] = Surface_StreamVelocity2_Total[iMarker_Analyze]/(Surface_NormalVelocity_Total[iMarker_Analyze]*Surface_NormalVelocity_Total[iMarker_Analyze]*Area) - 1.0;
457457
Surface_StreamVelocity2_Total[iMarker_Analyze] /= Area;
@@ -1091,11 +1091,6 @@ void CFlowOutput::WriteForcesBreakdown(CConfig *config, CGeometry *geometry, CSo
10911091
nullptr, *Surface_CFz_Mnt = nullptr, *Surface_CMx_Mnt = nullptr,
10921092
*Surface_CMy_Mnt = nullptr, *Surface_CMz_Mnt = nullptr;
10931093

1094-
/*--- WARNING: when compiling on Windows, ctime() is not available. Comment out
1095-
the two lines below that use the dt variable. ---*/
1096-
//time_t now = time(0);
1097-
//string dt = ctime(&now); dt[24] = '.';
1098-
10991094
/*--- Allocate memory for the coefficients being monitored ---*/
11001095

11011096
Surface_CL = new su2double[config->GetnMarker_Monitoring()];

SU2_CFD/src/output/output_structure_legacy.cpp

Lines changed: 51 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,34 +2014,34 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file,
20142014

20152015
if ((!DualTime_Iteration) && (output_files)) {
20162016
if (!turbo) {
2017-
config[val_iZone]->GetHistFile()[0] << begin << direct_coeff;
2018-
if (buffet) config[val_iZone]->GetHistFile()[0] << buffet_coeff;
2019-
if (thermal) config[val_iZone]->GetHistFile()[0] << heat_coeff;
2020-
if (equiv_area) config[val_iZone]->GetHistFile()[0] << equivalent_area_coeff;
2021-
if (engine || actuator_disk) config[val_iZone]->GetHistFile()[0] << engine_coeff;
2017+
ConvHist_file[0] << begin << direct_coeff;
2018+
if (buffet) ConvHist_file[0] << buffet_coeff;
2019+
if (thermal) ConvHist_file[0] << heat_coeff;
2020+
if (equiv_area) ConvHist_file[0] << equivalent_area_coeff;
2021+
if (engine || actuator_disk) ConvHist_file[0] << engine_coeff;
20222022
if (inv_design) {
2023-
config[val_iZone]->GetHistFile()[0] << Cp_inverse_design;
2024-
if (thermal) config[val_iZone]->GetHistFile()[0] << Heat_inverse_design;
2023+
ConvHist_file[0] << Cp_inverse_design;
2024+
if (thermal) ConvHist_file[0] << Heat_inverse_design;
20252025
}
2026-
if (rotating_frame && !turbo) config[val_iZone]->GetHistFile()[0] << rotating_frame_coeff;
2027-
config[val_iZone]->GetHistFile()[0] << flow_resid;
2028-
if (weakly_coupled_heat) config[val_iZone]->GetHistFile()[0] << heat_resid;
2029-
if (radiation) config[val_iZone]->GetHistFile()[0] << rad_resid;
2026+
if (rotating_frame && !turbo) ConvHist_file[0] << rotating_frame_coeff;
2027+
ConvHist_file[0] << flow_resid;
2028+
if (weakly_coupled_heat) ConvHist_file[0] << heat_resid;
2029+
if (radiation) ConvHist_file[0] << rad_resid;
20302030
}
20312031
else {
2032-
config[val_iZone]->GetHistFile()[0] << begin << turbo_coeff << flow_resid;
2032+
ConvHist_file[0] << begin << turbo_coeff << flow_resid;
20332033
}
20342034

2035-
if (aeroelastic) config[val_iZone]->GetHistFile()[0] << aeroelastic_coeff;
2036-
if (output_per_surface) config[val_iZone]->GetHistFile()[0] << monitoring_coeff;
2037-
if (output_surface) config[val_iZone]->GetHistFile()[0] << surface_outputs;
2035+
if (aeroelastic) ConvHist_file[0] << aeroelastic_coeff;
2036+
if (output_per_surface) ConvHist_file[0] << monitoring_coeff;
2037+
if (output_surface) ConvHist_file[0] << surface_outputs;
20382038
if (direct_diff != NO_DERIVATIVE) {
2039-
config[val_iZone]->GetHistFile()[0] << d_direct_coeff;
2040-
if (output_surface) config[val_iZone]->GetHistFile()[0] << d_surface_outputs;
2039+
ConvHist_file[0] << d_direct_coeff;
2040+
if (output_surface) ConvHist_file[0] << d_surface_outputs;
20412041
}
2042-
if (output_comboObj) config[val_iZone]->GetHistFile()[0] << combo_obj;
2043-
config[val_iZone]->GetHistFile()[0] << end;
2044-
config[val_iZone]->GetHistFile()[0].flush();
2042+
if (output_comboObj) ConvHist_file[0] << combo_obj;
2043+
ConvHist_file[0] << end;
2044+
ConvHist_file[0].flush();
20452045
}
20462046

20472047
/*--- Write screen output ---*/
@@ -2111,33 +2111,33 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file,
21112111
if ((!DualTime_Iteration) && (output_files)) {
21122112

21132113
if (!turbo) {
2114-
config[val_iZone]->GetHistFile()[0] << begin << direct_coeff;
2115-
if (buffet) config[val_iZone]->GetHistFile()[0] << buffet_coeff;
2116-
if (thermal) config[val_iZone]->GetHistFile()[0] << heat_coeff;
2117-
if (equiv_area) config[val_iZone]->GetHistFile()[0] << equivalent_area_coeff;
2118-
if (engine || actuator_disk) config[val_iZone]->GetHistFile()[0] << engine_coeff;
2114+
ConvHist_file[0] << begin << direct_coeff;
2115+
if (buffet) ConvHist_file[0] << buffet_coeff;
2116+
if (thermal) ConvHist_file[0] << heat_coeff;
2117+
if (equiv_area) ConvHist_file[0] << equivalent_area_coeff;
2118+
if (engine || actuator_disk) ConvHist_file[0] << engine_coeff;
21192119
if (inv_design) {
2120-
config[val_iZone]->GetHistFile()[0] << Cp_inverse_design;
2121-
if (thermal) config[val_iZone]->GetHistFile()[0] << Heat_inverse_design;
2120+
ConvHist_file[0] << Cp_inverse_design;
2121+
if (thermal) ConvHist_file[0] << Heat_inverse_design;
21222122
}
2123-
if (rotating_frame && !turbo) config[val_iZone]->GetHistFile()[0] << rotating_frame_coeff;
2124-
config[val_iZone]->GetHistFile()[0] << flow_resid << turb_resid;
2125-
if (weakly_coupled_heat) config[val_iZone]->GetHistFile()[0] << heat_resid;
2123+
if (rotating_frame && !turbo) ConvHist_file[0] << rotating_frame_coeff;
2124+
ConvHist_file[0] << flow_resid << turb_resid;
2125+
if (weakly_coupled_heat) ConvHist_file[0] << heat_resid;
21262126
}
21272127
else {
2128-
config[val_iZone]->GetHistFile()[0] << begin << turbo_coeff << flow_resid << turb_resid;
2128+
ConvHist_file[0] << begin << turbo_coeff << flow_resid << turb_resid;
21292129
}
21302130

2131-
if (aeroelastic) config[val_iZone]->GetHistFile()[0] << aeroelastic_coeff;
2132-
if (output_per_surface) config[val_iZone]->GetHistFile()[0] << monitoring_coeff;
2133-
if (output_surface) config[val_iZone]->GetHistFile()[0] << surface_outputs;
2131+
if (aeroelastic) ConvHist_file[0] << aeroelastic_coeff;
2132+
if (output_per_surface) ConvHist_file[0] << monitoring_coeff;
2133+
if (output_surface) ConvHist_file[0] << surface_outputs;
21342134
if (direct_diff != NO_DERIVATIVE) {
2135-
config[val_iZone]->GetHistFile()[0] << d_direct_coeff;
2136-
if (output_surface) config[val_iZone]->GetHistFile()[0] << d_surface_outputs;
2135+
ConvHist_file[0] << d_direct_coeff;
2136+
if (output_surface) ConvHist_file[0] << d_surface_outputs;
21372137
}
2138-
if (output_comboObj) config[val_iZone]->GetHistFile()[0] << combo_obj;
2139-
config[val_iZone]->GetHistFile()[0] << end;
2140-
config[val_iZone]->GetHistFile()[0].flush();
2138+
if (output_comboObj) ConvHist_file[0] << combo_obj;
2139+
ConvHist_file[0] << end;
2140+
ConvHist_file[0].flush();
21412141
}
21422142

21432143
/*--- Write screen output ---*/
@@ -2209,16 +2209,16 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file,
22092209
case HEAT_EQUATION:
22102210

22112211
if (!DualTime_Iteration) {
2212-
config[val_iZone]->GetHistFile()[0] << begin << direct_coeff << heat_resid << end;
2213-
config[val_iZone]->GetHistFile()[0].flush();
2212+
ConvHist_file[0] << begin << direct_coeff << heat_resid << end;
2213+
ConvHist_file[0].flush();
22142214
}
22152215
break;
22162216

22172217
case FEM_ELASTICITY:
22182218

22192219
if (!DualTime_Iteration) {
2220-
config[val_iZone]->GetHistFile()[0] << begin << fem_coeff << fem_resid << end_fem;
2221-
config[val_iZone]->GetHistFile()[0].flush();
2220+
ConvHist_file[0] << begin << fem_coeff << fem_resid << end_fem;
2221+
ConvHist_file[0].flush();
22222222

22232223
cout.precision(6);
22242224
cout.setf(ios::fixed, ios::floatfield);
@@ -2279,8 +2279,8 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file,
22792279
case DISC_ADJ_INC_EULER: case DISC_ADJ_INC_NAVIER_STOKES:
22802280

22812281
if (!DualTime_Iteration) {
2282-
config[val_iZone]->GetHistFile()[0] << begin << adjoint_coeff << adj_flow_resid << end;
2283-
config[val_iZone]->GetHistFile()[0].flush();
2282+
ConvHist_file[0] << begin << adjoint_coeff << adj_flow_resid << end;
2283+
ConvHist_file[0].flush();
22842284
}
22852285
if ((val_iZone == 0 && val_iInst == 0)|| fluid_structure){
22862286
if (DualTime_Iteration || !Unsteady){
@@ -2333,11 +2333,11 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file,
23332333
case ADJ_RANS : case DISC_ADJ_RANS: case DISC_ADJ_INC_RANS:
23342334

23352335
if (!DualTime_Iteration) {
2336-
config[val_iZone]->GetHistFile()[0] << begin << adjoint_coeff << adj_flow_resid;
2336+
ConvHist_file[0] << begin << adjoint_coeff << adj_flow_resid;
23372337
if (!frozen_visc)
2338-
config[val_iZone]->GetHistFile()[0] << adj_turb_resid;
2339-
config[val_iZone]->GetHistFile()[0] << end;
2340-
config[val_iZone]->GetHistFile()[0].flush();
2338+
ConvHist_file[0] << adj_turb_resid;
2339+
ConvHist_file[0] << end;
2340+
ConvHist_file[0].flush();
23412341
}
23422342
if ((val_iZone == 0 && val_iInst == 0)|| fluid_structure){
23432343
if (DualTime_Iteration || !Unsteady){
@@ -2492,11 +2492,6 @@ void COutputLegacy::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry
24922492
nullptr, *Surface_CFz_Mnt = nullptr, *Surface_CMx_Mnt = nullptr,
24932493
*Surface_CMy_Mnt = nullptr, *Surface_CMz_Mnt = nullptr;
24942494

2495-
/*--- WARNING: when compiling on Windows, ctime() is not available. Comment out
2496-
the two lines below that use the dt variable. ---*/
2497-
//time_t now = time(0);
2498-
//string dt = ctime(&now); dt[24] = '.';
2499-
25002495
/*--- Allocate memory for the coefficients being monitored ---*/
25012496

25022497
Surface_CL = new su2double[config[ZONE_0]->GetnMarker_Monitoring()];
@@ -2782,11 +2777,10 @@ void COutputLegacy::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry
27822777

27832778
Breakdown_file << "\n" <<"-------------------------------------------------------------------------" << "\n";
27842779
Breakdown_file <<"| ___ _ _ ___ |" << "\n";
2785-
Breakdown_file <<"| / __| | | |_ ) Release 6.1.0 \"Falcon\" |" << "\n";
2780+
Breakdown_file <<"| / __| | | |_ ) Release 7.0.7 \"Blackbird\" |" << "\n";
27862781
Breakdown_file <<"| \\__ \\ |_| |/ / |" << "\n";
27872782
Breakdown_file <<"| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |" << "\n";
27882783
Breakdown_file << "| |" << "\n";
2789-
//Breakdown_file << "| Local date and time: " << dt << " |" << "\n";
27902784
Breakdown_file <<"-------------------------------------------------------------------------" << "\n";
27912785
Breakdown_file << "| The current SU2 release has been coordinated by the |" << "\n";
27922786
Breakdown_file << "| SU2 International Developers Society <www.su2devsociety.org> |" << "\n";
@@ -2802,7 +2796,7 @@ void COutputLegacy::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry
28022796
Breakdown_file << "| - Prof. Edwin van der Weide's group at the University of Twente. |" << "\n";
28032797
Breakdown_file << "| - Lab. of New Concepts in Aeronautics at Tech. Inst. of Aeronautics. |" << "\n";
28042798
Breakdown_file <<"-------------------------------------------------------------------------" << "\n";
2805-
Breakdown_file << "| Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, |" << "\n";
2799+
Breakdown_file << "| Copyright 2012-2020, Francisco D. Palacios, Thomas D. Economon, |" << "\n";
28062800
Breakdown_file << "| Tim Albring, and the SU2 contributors. |" << "\n";
28072801
Breakdown_file << "| |" << "\n";
28082802
Breakdown_file << "| SU2 is free software; you can redistribute it and/or |" << "\n";

0 commit comments

Comments
 (0)