Skip to content

Commit 5236b8a

Browse files
committed
Merge branch 'develop' into fix_const_members
2 parents f8187ef + 34d48d6 commit 5236b8a

17 files changed

Lines changed: 106 additions & 25 deletions

File tree

AUTHORS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Copyright holders might be the individual person or their respective employer. I
4343
```
4444
Akshay.K.R
4545
Alejandro
46+
Aman uz zaman Baig
4647
Amit Sachdeva
4748
Ana Lourenco
4849
Andrew Burkett
@@ -59,6 +60,7 @@ Daumantas Kavolis
5960
Dave Taflin
6061
Eduardo Molina
6162
Ethan Alan Hereth
63+
FlorianDm
6264
Francisco D. Palacios
6365
Gaurav Bansal
6466
Giulio Gori
@@ -76,7 +78,9 @@ João Loureiro
7678
Kedar Naik
7779
LaSerpe
7880
Matteo Pini
81+
Max Le
7982
Max Sagebaum
83+
Michele Gaffuri
8084
Mickael Philit
8185
Ole Burghardt
8286
Patrick Mischke
@@ -90,6 +94,7 @@ Ryan Barrett
9094
Salvatore Vitale
9195
Samet Cakmakcioglu
9296
Scott Imlay
97+
Steffen Schotthöfer
9398
Steven Endres
9499
Teus van der Stelt
95100
Thomas D. Economon
@@ -98,18 +103,22 @@ TobiKattmann
98103
Trent Lukaczyk
99104
VivaanKhatri
100105
Wally Maier
106+
aaronyicongfu
101107
anilvar
102108
bmunguia
103109
chamsolli
104110
costat
111+
cr109
105112
cvencro
106113
daniel-linton
107114
demanosalvas
108115
dmudiger
109116
erangit
117+
flo
110118
hlkline
111119
juliendm
112120
jvanoostrom
121+
koodlyakshay
113122
mcolonno
114123
minkwankim
115124
padronas

Common/include/linear_algebra/CSysSolve.hpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ class CSysSolve {
7878

7979
private:
8080

81-
bool mesh_deform; /*!< \brief Operate in mesh deformation mode, changes the source of solver options. */
82-
ScalarType Residual; /*!< \brief Residual at the end of a call to Solve. */
81+
bool mesh_deform; /*!< \brief Operate in mesh deformation mode, changes the source of solver options. */
82+
ScalarType Residual=1e-20; /*!< \brief Residual at the end of a call to Solve or Solve_b. */
83+
unsigned long Iterations=0;/*!< \brief Iterations done in Solve or Solve_b. */
8384

8485
mutable bool cg_ready; /*!< \brief Indicate if memory used by CG is allocated. */
8586
mutable bool bcg_ready; /*!< \brief Indicate if memory used by BCGSTAB is allocated. */
@@ -313,9 +314,15 @@ class CSysSolve {
313314
unsigned long Solve_b(MatrixType & Jacobian, const CSysVector<su2double> & LinSysRes, CSysVector<su2double> & LinSysSol,
314315
CGeometry *geometry, CConfig *config);
315316

317+
/*!
318+
* \brief Get the number of iterations.
319+
* \return The number of iterations done by Solve or Solve_b
320+
*/
321+
inline unsigned long GetIterations(void) const { return Iterations; }
322+
316323
/*!
317324
* \brief Get the final residual.
318-
* \return The residual at the end of Solve
325+
* \return The residual at the end of Solve or Solve_b
319326
*/
320327
inline ScalarType GetResidual(void) const { return Residual; }
321328

Common/src/linear_algebra/CSysSolve.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,13 +937,17 @@ unsigned long CSysSolve<ScalarType>::Solve(CSysMatrix<ScalarType> & Jacobian, co
937937
Jacobian.BuildPastixPreconditioner(geometry, config, KindSolver);
938938
Jacobian.ComputePastixPreconditioner(*LinSysRes_ptr, *LinSysSol_ptr, geometry, config);
939939
IterLinSol = 1;
940+
residual = 1e-20;
940941
break;
941942
default:
942943
SU2_MPI::Error("Unknown type of linear solver.",CURRENT_FUNCTION);
943944
}
944945

945946
SU2_OMP_MASTER
946-
Residual = residual;
947+
{
948+
Residual = residual;
949+
Iterations = IterLinSol;
950+
}
947951

948952
HandleTemporariesOut(LinSysSol);
949953

@@ -1074,6 +1078,7 @@ unsigned long CSysSolve<ScalarType>::Solve_b(CSysMatrix<ScalarType> & Jacobian,
10741078
Jacobian.BuildPastixPreconditioner(geometry, config, KindSolver, RequiresTranspose);
10751079
Jacobian.ComputePastixPreconditioner(*LinSysRes_ptr, *LinSysSol_ptr, geometry, config);
10761080
IterLinSol = 1;
1081+
Residual = 1e-20;
10771082
break;
10781083
default:
10791084
SU2_MPI::Error("The specified linear solver is not yet implemented for the discrete adjoint method.", CURRENT_FUNCTION);
@@ -1084,8 +1089,10 @@ unsigned long CSysSolve<ScalarType>::Solve_b(CSysMatrix<ScalarType> & Jacobian,
10841089

10851090
delete precond;
10861091

1092+
Iterations = IterLinSol;
10871093
return IterLinSol;
10881094
#else
1095+
Iterations = 0;
10891096
return 0;
10901097
#endif
10911098
}

SU2_CFD/src/output/CAdjElasticityOutput.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ void CAdjElasticityOutput::SetHistoryOutputFields(CConfig *config){
108108

109109
AddHistoryOutput("COMBO", "ObjFun", ScreenOutputFormat::SCIENTIFIC, "COMBO", "", HistoryFieldType::COEFFICIENT);
110110

111+
AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver.");
112+
AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver.");
113+
111114
}
112115

113116
inline void CAdjElasticityOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) {
@@ -136,6 +139,9 @@ inline void CAdjElasticityOutput::LoadHistoryData(CConfig *config, CGeometry *ge
136139

137140
SetHistoryOutputValue("COMBO", solver[FEA_SOL]->GetTotal_ComboObj());
138141

142+
SetHistoryOutputValue("LINSOL_ITER", solver[ADJFEA_SOL]->GetIterLinSolver());
143+
SetHistoryOutputValue("LINSOL_RESIDUAL", log10(solver[ADJFEA_SOL]->GetResLinSolver()));
144+
139145
}
140146

141147
void CAdjElasticityOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){

SU2_CFD/src/output/CAdjFlowCompOutput.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,21 @@ void CAdjFlowCompOutput::SetHistoryOutputFields(CConfig *config){
198198
AddHistoryOutput("SENS_TEMP", "Sens_Temp", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "Sensitivity of the objective function with respect to the far-field temperature.", HistoryFieldType::COEFFICIENT);
199199
/// END_GROUP
200200

201+
AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver.");
202+
AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver.");
203+
204+
if (config->GetDeform_Mesh()){
205+
AddHistoryOutput("DEFORM_ITER", "DeformIter", ScreenOutputFormat::INTEGER, "DEFORM", "Linear solver iterations for the mesh deformation");
206+
AddHistoryOutput("DEFORM_RESIDUAL", "DeformRes", ScreenOutputFormat::FIXED, "DEFORM", "Residual of the linear solver for the mesh deformation");
207+
}
208+
201209
}
202210

203211
void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver){
204212

205213
CSolver* adjflow_solver = solver[ADJFLOW_SOL];
206214
CSolver* adjturb_solver = solver[ADJTURB_SOL];
215+
CSolver* mesh_solver = solver[MESH_SOL];
207216

208217
SetHistoryOutputValue("RMS_ADJ_DENSITY", log10(adjflow_solver->GetRes_RMS(0)));
209218
SetHistoryOutputValue("RMS_ADJ_MOMENTUM-X", log10(adjflow_solver->GetRes_RMS(1)));
@@ -242,7 +251,7 @@ void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, C
242251
break;
243252
case SST:
244253
SetHistoryOutputValue("MAX_ADJ_TKE", log10(adjturb_solver->GetRes_Max(0)));
245-
SetHistoryOutputValue("MAX_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_Max(1)));
254+
SetHistoryOutputValue("MAX_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_Max(1)));
246255
break;
247256
default: break;
248257
}
@@ -278,6 +287,14 @@ void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, C
278287
SetHistoryOutputValue("SENS_PRESS", adjflow_solver->GetTotal_Sens_Press());
279288
SetHistoryOutputValue("SENS_TEMP", adjflow_solver->GetTotal_Sens_Temp());
280289

290+
SetHistoryOutputValue("LINSOL_ITER", adjflow_solver->GetIterLinSolver());
291+
SetHistoryOutputValue("LINSOL_RESIDUAL", log10(adjflow_solver->GetResLinSolver()));
292+
293+
if (config->GetDeform_Mesh()) {
294+
SetHistoryOutputValue("DEFORM_ITER", mesh_solver->System.GetIterations());
295+
SetHistoryOutputValue("DEFORM_RESIDUAL", log10(mesh_solver->System.GetResidual()));
296+
}
297+
281298
}
282299

283300
void CAdjFlowCompOutput::SetVolumeOutputFields(CConfig *config){

SU2_CFD/src/output/CAdjFlowIncOutput.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,23 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){
208208
AddHistoryOutput("SENS_PRESS_OUT", "Sens_Pout", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "Sensitivity of the objective function with respect to the outlet pressure.", HistoryFieldType::COEFFICIENT);
209209
/// END_GROUP
210210

211+
AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver.");
212+
AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver.");
213+
214+
if (config->GetDeform_Mesh()){
215+
AddHistoryOutput("DEFORM_ITER", "DeformIter", ScreenOutputFormat::INTEGER, "DEFORM", "Linear solver iterations for the mesh deformation");
216+
AddHistoryOutput("DEFORM_RESIDUAL", "DeformRes", ScreenOutputFormat::FIXED, "DEFORM", "Residual of the linear solver for the mesh deformation");
217+
}
218+
211219
}
212220

213221
void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) {
214222

215223
CSolver* adjflow_solver = solver[ADJFLOW_SOL];
216224
CSolver* adjturb_solver = solver[ADJTURB_SOL];
217225
CSolver* adjheat_solver = solver[ADJHEAT_SOL];
218-
CSolver* adjrad_solver = solver[ADJRAD_SOL];
226+
CSolver* adjrad_solver = solver[ADJRAD_SOL];
227+
CSolver* mesh_solver = solver[MESH_SOL];
219228

220229
SetHistoryOutputValue("RMS_ADJ_PRESSURE", log10(adjflow_solver->GetRes_RMS(0)));
221230
SetHistoryOutputValue("RMS_ADJ_VELOCITY-X", log10(adjflow_solver->GetRes_RMS(1)));
@@ -308,6 +317,14 @@ void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS
308317
SetHistoryOutputValue("SENS_VEL_IN", adjflow_solver->GetTotal_Sens_ModVel());
309318
SetHistoryOutputValue("SENS_PRESS_OUT", adjflow_solver->GetTotal_Sens_BPress());
310319

320+
SetHistoryOutputValue("LINSOL_ITER", adjflow_solver->GetIterLinSolver());
321+
SetHistoryOutputValue("LINSOL_RESIDUAL", log10(adjflow_solver->GetResLinSolver()));
322+
323+
if (config->GetDeform_Mesh()) {
324+
SetHistoryOutputValue("DEFORM_ITER", mesh_solver->System.GetIterations());
325+
SetHistoryOutputValue("DEFORM_RESIDUAL", log10(mesh_solver->System.GetResidual()));
326+
}
327+
311328
}
312329

313330
void CAdjFlowIncOutput::SetVolumeOutputFields(CConfig *config){

SU2_CFD/src/output/CAdjHeatOutput.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ void CAdjHeatOutput::SetHistoryOutputFields(CConfig *config){
110110
AddHistoryOutput("SENS_GEO", "Sens_Geo", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "Sum of the geometrical sensitivities on all markers set in MARKER_MONITORING.", HistoryFieldType::COEFFICIENT);
111111
/// END_GROUP
112112

113+
AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver.");
114+
AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver.");
115+
116+
if (config->GetDeform_Mesh()){
117+
AddHistoryOutput("DEFORM_ITER", "DeformIter", ScreenOutputFormat::INTEGER, "DEFORM", "Linear solver iterations for the mesh deformation");
118+
AddHistoryOutput("DEFORM_RESIDUAL", "DeformRes", ScreenOutputFormat::FIXED, "DEFORM", "Residual of the linear solver for the mesh deformation");
119+
}
120+
113121
}
114122

115123
void CAdjHeatOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) {
@@ -126,6 +134,13 @@ void CAdjHeatOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv
126134

127135
SetHistoryOutputValue("SENS_GEO", adjheat_solver->GetTotal_Sens_Geo());
128136

137+
SetHistoryOutputValue("LINSOL_ITER", adjheat_solver->GetIterLinSolver());
138+
SetHistoryOutputValue("LINSOL_RESIDUAL", log10(adjheat_solver->GetResLinSolver()));
139+
140+
if (config->GetDeform_Mesh()) {
141+
SetHistoryOutputValue("DEFORM_ITER", solver[MESH_SOL]->System.GetIterations());
142+
SetHistoryOutputValue("DEFORM_RESIDUAL", log10(solver[MESH_SOL]->System.GetResidual()));
143+
}
129144

130145
}
131146

@@ -174,7 +189,7 @@ void CAdjHeatOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve
174189
if (nDim == 3)
175190
SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2));
176191

177-
SetVolumeOutputValue("ADJ_TEMPERATURE", iPoint, Node_AdjHeat->GetSolution(iPoint, 0));
192+
SetVolumeOutputValue("ADJ_TEMPERATURE", iPoint, Node_AdjHeat->GetSolution(iPoint, 0));
178193

179194
// Residuals
180195
SetVolumeOutputValue("RES_ADJ_TEMPERATURE", iPoint, Node_AdjHeat->GetSolution(iPoint, 0) - Node_AdjHeat->GetSolution_Old(iPoint, 0));
@@ -192,4 +207,3 @@ void CAdjHeatOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolv
192207

193208
}
194209

195-

SU2_CFD/src/output/CElasticityOutput.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ void CElasticityOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS
139139

140140
void CElasticityOutput::SetHistoryOutputFields(CConfig *config){
141141

142-
AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver.");
143-
AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver.");
142+
AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver.");
143+
AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver.");
144144

145145
// Residuals
146146

SU2_CFD/src/output/CFlowCompFEMOutput.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ void CFlowCompFEMOutput::SetHistoryOutputFields(CConfig *config){
115115
AddHistoryOutput("MAX_ENERGY", "max[RhoE]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the energy.", HistoryFieldType::RESIDUAL);
116116
/// END_GROUP
117117

118-
/// DESCRIPTION: Linear solver iterations
119-
AddHistoryOutput("LINSOL_ITER", "Linear_Solver_Iterations", ScreenOutputFormat::INTEGER, "LINSOL_ITER", "Number of iterations of the linear solver.");
120-
121118
AddHistoryOutput("CFL_NUMBER", "CFL number", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current value of the CFL number");
122119

123120
/*--- Add analyze surface history fields --- */
@@ -263,7 +260,6 @@ void CFlowCompFEMOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, C
263260
}
264261

265262
SetHistoryOutputValue("AOA", config->GetAoA());
266-
SetHistoryOutputValue("LINSOL_ITER", flow_solver->GetIterLinSolver());
267263
SetHistoryOutputValue("CFL_NUMBER", config->GetCFL(MESH_0));
268264

269265
/*--- Set the analyse surface history values --- */

SU2_CFD/src/output/CHeatOutput.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,30 +82,32 @@ void CHeatOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver
8282

8383
CSolver* heat_solver = solver[HEAT_SOL];
8484

85-
SetHistoryOutputValue("TOTAL_HEATFLUX", heat_solver->GetTotal_HeatFlux());
85+
SetHistoryOutputValue("TOTAL_HEATFLUX", heat_solver->GetTotal_HeatFlux());
8686
SetHistoryOutputValue("HEATFLUX_MAX", heat_solver->GetTotal_MaxHeatFlux());
87-
SetHistoryOutputValue("AVG_TEMPERATURE", heat_solver->GetTotal_AvgTemperature());
87+
SetHistoryOutputValue("AVG_TEMPERATURE", heat_solver->GetTotal_AvgTemperature());
8888
SetHistoryOutputValue("RMS_TEMPERATURE", log10(heat_solver->GetRes_RMS(0)));
8989
SetHistoryOutputValue("MAX_TEMPERATURE", log10(heat_solver->GetRes_Max(0)));
9090
if (multiZone)
9191
SetHistoryOutputValue("BGS_TEMPERATURE", log10(heat_solver->GetRes_BGS(0)));
9292

9393
SetHistoryOutputValue("LINSOL_ITER", heat_solver->GetIterLinSolver());
94+
SetHistoryOutputValue("LINSOL_RESIDUAL", log10(heat_solver->GetResLinSolver()));
9495
SetHistoryOutputValue("CFL_NUMBER", config->GetCFL(MESH_0));
9596

9697
}
9798

9899

99100
void CHeatOutput::SetHistoryOutputFields(CConfig *config){
100101

101-
AddHistoryOutput("LINSOL_ITER", "Linear_Solver_Iterations", ScreenOutputFormat::INTEGER, "LINSOL_ITER", "Linear solver iterations");
102+
AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver.");
103+
AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver.");
102104

103105
AddHistoryOutput("RMS_TEMPERATURE", "rms[T]", ScreenOutputFormat::FIXED, "RMS_RES", "Root mean square residual of the temperature", HistoryFieldType::RESIDUAL);
104106
AddHistoryOutput("MAX_TEMPERATURE", "max[T]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the temperature", HistoryFieldType::RESIDUAL);
105107
AddHistoryOutput("BGS_TEMPERATURE", "bgs[T]", ScreenOutputFormat::FIXED, "BGS_RES", "Block-Gauss seidel residual of the temperature", HistoryFieldType::RESIDUAL);
106108

107-
AddHistoryOutput("TOTAL_HEATFLUX", "HF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total heatflux on all surfaces defined in MARKER_MONITORING", HistoryFieldType::COEFFICIENT);
108-
AddHistoryOutput("HEATFLUX_MAX", "MaxHF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total maximal heatflux on all surfaces defined in MARKER_MONITORING", HistoryFieldType::COEFFICIENT);
109+
AddHistoryOutput("TOTAL_HEATFLUX", "HF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total heatflux on all surfaces defined in MARKER_MONITORING", HistoryFieldType::COEFFICIENT);
110+
AddHistoryOutput("HEATFLUX_MAX", "MaxHF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total maximal heatflux on all surfaces defined in MARKER_MONITORING", HistoryFieldType::COEFFICIENT);
109111
AddHistoryOutput("AVG_TEMPERATURE", "AvgTemp", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total average temperature on all surfaces defined in MARKER_MONITORING", HistoryFieldType::COEFFICIENT);
110112
AddHistoryOutput("CFL_NUMBER", "CFL number", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current value of the CFL number");
111113

0 commit comments

Comments
 (0)