Skip to content

Commit baa263e

Browse files
committed
Revert some clang-formatting to please python history parsing.
Note that the AddHistoryOutput lines are read by the update_historyMap.py script. And if there are line breaks there are information missing for that script. Using // clang-format off/on can prevent this accidentally breaking.
1 parent a2cb413 commit baa263e

4 files changed

Lines changed: 99 additions & 37 deletions

File tree

SU2_CFD/src/output/CAdjFlowOutput.cpp

Lines changed: 19 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,20 @@ CAdjFlowOutput::CAdjFlowOutput(CConfig* config, unsigned short nDim)
3535
cont_adj(config->GetContinuous_Adjoint()),
3636
frozen_visc((config->GetFrozen_Visc_Disc() && !cont_adj) || (config->GetFrozen_Visc_Cont() && cont_adj)) {}
3737

38+
// The "AddHistoryOutput(" must not be split over multiple lines to assure proper python parsing
39+
// clang-format off
3840
void CAdjFlowOutput::AddHistoryOutputFields_AdjScalarRMS_RES(const CConfig* config) {
3941
if (!frozen_visc) {
4042
switch (TurbModelFamily(turb_model)) {
4143
case TURB_FAMILY::SA:
4244
/// DESCRIPTION: Root-mean square residual of the adjoint nu tilde.
43-
AddHistoryOutput("RMS_ADJ_NU_TILDE", "rms[A_nu]", ScreenOutputFormat::FIXED, "RMS_RES",
44-
"Root-mean square residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL);
45+
AddHistoryOutput("RMS_ADJ_NU_TILDE", "rms[A_nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL);
4546
break;
4647
case TURB_FAMILY::KW:
4748
/// DESCRIPTION: Root-mean square residual of the adjoint kinetic energy.
48-
AddHistoryOutput("RMS_ADJ_TKE", "rms[A_k]", ScreenOutputFormat::FIXED, "RMS_RES",
49-
"Root-mean square residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL);
49+
AddHistoryOutput("RMS_ADJ_TKE", "rms[A_k]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL);
5050
/// DESCRIPTION: Root-mean square residual of the adjoint dissipation.
51-
AddHistoryOutput("RMS_ADJ_DISSIPATION", "rms[A_w]", ScreenOutputFormat::FIXED, "RMS_RES",
52-
" Root-mean square residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL);
51+
AddHistoryOutput("RMS_ADJ_DISSIPATION", "rms[A_w]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL);
5352
break;
5453
case TURB_FAMILY::NONE:
5554
break;
@@ -58,9 +57,7 @@ void CAdjFlowOutput::AddHistoryOutputFields_AdjScalarRMS_RES(const CConfig* conf
5857

5958
if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) {
6059
for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) {
61-
AddHistoryOutput("RMS_ADJ_SPECIES_" + std::to_string(iVar), "rms[A_rho*Y_" + std::to_string(iVar) + "]",
62-
ScreenOutputFormat::FIXED, "RMS_RES",
63-
"Root-mean square residual of the adjoint transported species.", HistoryFieldType::RESIDUAL);
60+
AddHistoryOutput("RMS_ADJ_SPECIES_" + std::to_string(iVar), "rms[A_rho*Y_" + std::to_string(iVar) + "]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint transported species.", HistoryFieldType::RESIDUAL);
6461
}
6562
}
6663
}
@@ -70,16 +67,13 @@ void CAdjFlowOutput::AddHistoryOutputFields_AdjScalarMAX_RES(const CConfig* conf
7067
switch (TurbModelFamily(turb_model)) {
7168
case TURB_FAMILY::SA:
7269
/// DESCRIPTION: Maximum residual of the adjoint nu tilde.
73-
AddHistoryOutput("MAX_ADJ_NU_TILDE", "max[A_nu]", ScreenOutputFormat::FIXED, "MAX_RES",
74-
"Maximum residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL);
70+
AddHistoryOutput("MAX_ADJ_NU_TILDE", "max[A_nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL);
7571
break;
7672
case TURB_FAMILY::KW:
7773
/// DESCRIPTION: Maximum residual of the adjoint kinetic energy.
78-
AddHistoryOutput("MAX_ADJ_TKE", "max[A_k]", ScreenOutputFormat::FIXED, "MAX_RES",
79-
"Maximum residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL);
74+
AddHistoryOutput("MAX_ADJ_TKE", "max[A_k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL);
8075
/// DESCRIPTION: Maximum residual of the adjoint dissipation.
81-
AddHistoryOutput("MAX_ADJ_DISSIPATION", "max[A_w]", ScreenOutputFormat::FIXED, "MAX_RES",
82-
"Maximum residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL);
76+
AddHistoryOutput("MAX_ADJ_DISSIPATION", "max[A_w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL);
8377
break;
8478
case TURB_FAMILY::NONE:
8579
break;
@@ -88,9 +82,7 @@ void CAdjFlowOutput::AddHistoryOutputFields_AdjScalarMAX_RES(const CConfig* conf
8882

8983
if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) {
9084
for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) {
91-
AddHistoryOutput("MAX_ADJ_SPECIES_" + std::to_string(iVar), "max[A_rho*Y_" + std::to_string(iVar) + "]",
92-
ScreenOutputFormat::FIXED, "RMS_RES", "Maximum residual of the adjoint transported species.",
93-
HistoryFieldType::RESIDUAL);
85+
AddHistoryOutput("MAX_ADJ_SPECIES_" + std::to_string(iVar), "max[A_rho*Y_" + std::to_string(iVar) + "]",ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint transported species.", HistoryFieldType::RESIDUAL);
9486
}
9587
}
9688
}
@@ -102,16 +94,13 @@ void CAdjFlowOutput::AddHistoryOutputFields_AdjScalarBGS_RES(const CConfig* conf
10294
switch (TurbModelFamily(turb_model)) {
10395
case TURB_FAMILY::SA:
10496
/// DESCRIPTION: BGS residual of the adjoint nu tilde.
105-
AddHistoryOutput("BGS_ADJ_NU_TILDE", "bgs[A_nu]", ScreenOutputFormat::FIXED, "BGS_RES",
106-
"BGS residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL);
97+
AddHistoryOutput("BGS_ADJ_NU_TILDE", "bgs[A_nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL);
10798
break;
10899
case TURB_FAMILY::KW:
109100
/// DESCRIPTION: BGS residual of the adjoint kinetic energy.
110-
AddHistoryOutput("BGS_ADJ_TKE", "bgs[A_k]", ScreenOutputFormat::FIXED, "BGS_RES",
111-
"BGS residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL);
101+
AddHistoryOutput("BGS_ADJ_TKE", "bgs[A_k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL);
112102
/// DESCRIPTION: BGS residual of the adjoint dissipation.
113-
AddHistoryOutput("BGS_ADJ_DISSIPATION", "bgs[A_w]", ScreenOutputFormat::FIXED, "BGS_RES",
114-
"BGS residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL);
103+
AddHistoryOutput("BGS_ADJ_DISSIPATION", "bgs[A_w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL);
115104
break;
116105
case TURB_FAMILY::NONE:
117106
break;
@@ -120,28 +109,23 @@ void CAdjFlowOutput::AddHistoryOutputFields_AdjScalarBGS_RES(const CConfig* conf
120109

121110
if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) {
122111
for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) {
123-
AddHistoryOutput("BGS_ADJ_SPECIES_" + std::to_string(iVar), "bgs[A_rho*Y_" + std::to_string(iVar) + "]",
124-
ScreenOutputFormat::FIXED, "RMS_RES", "BGS residual of the adjoint transported species.",
125-
HistoryFieldType::RESIDUAL);
112+
AddHistoryOutput("BGS_ADJ_SPECIES_" + std::to_string(iVar), "bgs[A_rho*Y_" + std::to_string(iVar) + "]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint transported species.", HistoryFieldType::RESIDUAL);
126113
}
127114
}
128115
}
129116

130117
void CAdjFlowOutput::AddHistoryOutputFields_AdjScalarLinsol(const CConfig* config) {
131118
if ((turb_model != TURB_MODEL::NONE) && !frozen_visc) {
132-
AddHistoryOutput("LINSOL_ITER_TURB", "LinSolIterTurb", ScreenOutputFormat::INTEGER, "LINSOL",
133-
"Number of iterations of the linear solver for turbulence.");
134-
AddHistoryOutput("LINSOL_RESIDUAL_TURB", "LinSolResTurb", ScreenOutputFormat::FIXED, "LINSOL",
135-
"Residual of the linear solver for turbulence.");
119+
AddHistoryOutput("LINSOL_ITER_TURB", "LinSolIterTurb", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver for turbulence.");
120+
AddHistoryOutput("LINSOL_RESIDUAL_TURB", "LinSolResTurb", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver for turbulence.");
136121
}
137122

138123
if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) {
139-
AddHistoryOutput("LINSOL_ITER_SPECIES", "LinSolIterSpecies", ScreenOutputFormat::INTEGER, "LINSOL",
140-
"Number of iterations of the linear solver for species solver.");
141-
AddHistoryOutput("LINSOL_RESIDUAL_SPECIES", "LinSolResSpecies", ScreenOutputFormat::FIXED, "LINSOL",
142-
"Residual of the linear solver for species solver.");
124+
AddHistoryOutput("LINSOL_ITER_SPECIES", "LinSolIterSpecies", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver for species solver.");
125+
AddHistoryOutput("LINSOL_RESIDUAL_SPECIES", "LinSolResSpecies", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver for species solver.");
143126
}
144127
}
128+
// clang-format on
145129

146130
void CAdjFlowOutput::LoadHistoryData_AdjScalar(const CConfig* config, const CSolver* const* solver) {
147131
const auto adjturb_solver = solver[ADJTURB_SOL];

SU2_CFD/src/output/CFlowOutput.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ CFlowOutput::CFlowOutput(const CConfig *config, unsigned short nDim, bool fem_ou
3636
lastInnerIter(curInnerIter) {
3737
}
3838

39+
// The "AddHistoryOutput(" must not be split over multiple lines to assure proper python parsing
40+
// clang-format off
3941
void CFlowOutput::AddAnalyzeSurfaceOutput(const CConfig *config){
4042

4143
/// DESCRIPTION: Average mass flow
@@ -118,6 +120,7 @@ void CFlowOutput::AddAnalyzeSurfaceOutput(const CConfig *config){
118120
AddHistoryOutputPerSurface("SURFACE_SPECIES_VARIANCE", "Species_Variance", ScreenOutputFormat::SCIENTIFIC, "SPECIES_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT);
119121
/// END_GROUP
120122
}
123+
// clang-format on
121124

122125
void CFlowOutput::SetAnalyzeSurface(const CSolver* const*solver, const CGeometry *geometry, CConfig *config, bool output){
123126

@@ -765,6 +768,8 @@ void CFlowOutput::SetAnalyzeSurface_SpeciesVariance(const CSolver* const*solver,
765768
SetHistoryOutputValue("SURFACE_SPECIES_VARIANCE", Tot_Surface_SpeciesVariance);
766769
}
767770

771+
// The "AddHistoryOutput(" must not be split over multiple lines to assure proper python parsing
772+
// clang-format off
768773
void CFlowOutput::AddHistoryOutputFields_ScalarRMS_RES(const CConfig* config) {
769774
switch (TurbModelFamily(config->GetKind_Turb_Model())) {
770775
case TURB_FAMILY::SA:
@@ -851,6 +856,7 @@ void CFlowOutput::AddHistoryOutputFields_ScalarLinsol(const CConfig* config) {
851856
AddHistoryOutput("LINSOL_RESIDUAL_SPECIES", "LinSolResSpecies", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver for species solver.");
852857
}
853858
}
859+
// clang-format on
854860

855861
void CFlowOutput::LoadHistoryData_Scalar(const CConfig* config, const CSolver* const* solver) {
856862
switch (TurbModelFamily(config->GetKind_Turb_Model())) {

SU2_PY/SU2/io/historyMap.py

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@
6464
'GROUP': 'BGS_RES',
6565
'HEADER': 'bgs[A_Uz]',
6666
'TYPE': 'RESIDUAL'},
67+
'BGS_ADJ_DISSIPATION': {'DESCRIPTION': 'BGS residual of the adjoint '
68+
'dissipation.',
69+
'GROUP': 'BGS_RES',
70+
'HEADER': 'bgs[A_w]',
71+
'TYPE': 'RESIDUAL'},
6772
'BGS_ADJ_ENERGY': {'DESCRIPTION': 'BGS residual of the adjoint energy.',
6873
'GROUP': 'BGS_RES',
6974
'HEADER': 'bgs[A_E]',
@@ -83,6 +88,10 @@
8388
'GROUP': 'BGS_RES',
8489
'HEADER': 'bgs[A_RhoW]',
8590
'TYPE': 'RESIDUAL'},
91+
'BGS_ADJ_NU_TILDE': {'DESCRIPTION': 'BGS residual of the adjoint nu tilde.',
92+
'GROUP': 'BGS_RES',
93+
'HEADER': 'bgs[A_nu]',
94+
'TYPE': 'RESIDUAL'},
8695
'BGS_ADJ_PRESSURE': {'DESCRIPTION': 'BGS residual of the adjoint Pressure.',
8796
'GROUP': 'BGS_RES',
8897
'HEADER': 'bgs[A_Rho]',
@@ -92,11 +101,24 @@
92101
'GROUP': 'BGS_RES',
93102
'HEADER': 'bgs[A_P1]',
94103
'TYPE': 'RESIDUAL'},
104+
'BGS_ADJ_SPECIES_" + std::to_string(iVar': {'DESCRIPTION': 'BGS residual of '
105+
'the adjoint '
106+
'transported '
107+
'species.',
108+
'GROUP': 'BGS_RES',
109+
'HEADER': 'bgs[A_rho*Y_" + '
110+
'std::to_string(iVar) + '
111+
'"]',
112+
'TYPE': 'RESIDUAL'},
95113
'BGS_ADJ_TEMPERATURE': {'DESCRIPTION': 'BGS residual of the adjoint '
96114
'temperature.',
97115
'GROUP': 'BGS_RES',
98116
'HEADER': 'bgs[A_T]',
99117
'TYPE': 'RESIDUAL'},
118+
'BGS_ADJ_TKE': {'DESCRIPTION': 'BGS residual of the adjoint kinetic energy.',
119+
'GROUP': 'BGS_RES',
120+
'HEADER': 'bgs[A_k]',
121+
'TYPE': 'RESIDUAL'},
100122
'BGS_ADJ_VELOCITY-X': {'DESCRIPTION': 'BGS residual of the adjoint Velocity '
101123
'x-component',
102124
'GROUP': 'BGS_RES',
@@ -492,7 +514,7 @@
492514
'HEADER': 'LinSolIterSpecies',
493515
'TYPE': 'DEFAULT'},
494516
'LINSOL_ITER_TURB': {'DESCRIPTION': 'Number of iterations of the linear '
495-
'solver for turbulence solver.',
517+
'solver for turbulence.',
496518
'GROUP': 'LINSOL',
497519
'HEADER': 'LinSolIterTurb',
498520
'TYPE': 'DEFAULT'},
@@ -506,7 +528,7 @@
506528
'HEADER': 'LinSolResSpecies',
507529
'TYPE': 'DEFAULT'},
508530
'LINSOL_RESIDUAL_TURB': {'DESCRIPTION': 'Residual of the linear solver for '
509-
'turbulence solver.',
531+
'turbulence.',
510532
'GROUP': 'LINSOL',
511533
'HEADER': 'LinSolResTurb',
512534
'TYPE': 'DEFAULT'},
@@ -527,6 +549,11 @@
527549
'GROUP': 'MAX_RES',
528550
'HEADER': 'max[A_Rho]',
529551
'TYPE': 'RESIDUAL'},
552+
'MAX_ADJ_DISSIPATION': {'DESCRIPTION': 'Maximum residual of the adjoint '
553+
'dissipation.',
554+
'GROUP': 'MAX_RES',
555+
'HEADER': 'max[A_w]',
556+
'TYPE': 'RESIDUAL'},
530557
'MAX_ADJ_ENERGY': {'DESCRIPTION': 'Maximum residual of the adjoint energy.',
531558
'GROUP': 'MAX_RES',
532559
'HEADER': 'max[A_E]',
@@ -546,15 +573,34 @@
546573
'GROUP': 'MAX_RES',
547574
'HEADER': 'max[A_RhoW]',
548575
'TYPE': 'RESIDUAL'},
576+
'MAX_ADJ_NU_TILDE': {'DESCRIPTION': 'Maximum residual of the adjoint nu '
577+
'tilde.',
578+
'GROUP': 'MAX_RES',
579+
'HEADER': 'max[A_nu]',
580+
'TYPE': 'RESIDUAL'},
549581
'MAX_ADJ_PRESSURE': {'DESCRIPTION': 'Maximum residual of the adjoint '
550582
'Pressure.',
551583
'GROUP': 'MAX_RES',
552584
'HEADER': 'max[A_Rho]',
553585
'TYPE': 'RESIDUAL'},
586+
'MAX_ADJ_SPECIES_" + std::to_string(iVar': {'DESCRIPTION': 'Maximum residual '
587+
'of the adjoint '
588+
'transported '
589+
'species.',
590+
'GROUP': 'MAX_RES',
591+
'HEADER': 'max[A_rho*Y_" + '
592+
'std::to_string(iVar) + '
593+
'"]',
594+
'TYPE': 'RESIDUAL'},
554595
'MAX_ADJ_TEMPERATURE': {'DESCRIPTION': 'Maximum residual of the temperature.',
555596
'GROUP': 'MAX_RES',
556597
'HEADER': 'max[A_T]',
557598
'TYPE': 'RESIDUAL'},
599+
'MAX_ADJ_TKE': {'DESCRIPTION': 'Maximum residual of the adjoint kinetic '
600+
'energy.',
601+
'GROUP': 'MAX_RES',
602+
'HEADER': 'max[A_k]',
603+
'TYPE': 'RESIDUAL'},
558604
'MAX_ADJ_VELOCITY-X': {'DESCRIPTION': 'Maximum residual of the adjoint '
559605
'Velocity x-component',
560606
'GROUP': 'MAX_RES',
@@ -687,6 +733,11 @@
687733
'GROUP': 'RMS_RES',
688734
'HEADER': 'rms[A_Rho]',
689735
'TYPE': 'RESIDUAL'},
736+
'RMS_ADJ_DISSIPATION': {'DESCRIPTION': 'Root-mean square residual of the '
737+
'adjoint dissipation.',
738+
'GROUP': 'RMS_RES',
739+
'HEADER': 'rms[A_w]',
740+
'TYPE': 'RESIDUAL'},
690741
'RMS_ADJ_ENERGY': {'DESCRIPTION': 'Root-mean square residual of the adjoint '
691742
'energy.',
692743
'GROUP': 'RMS_RES',
@@ -707,6 +758,11 @@
707758
'GROUP': 'RMS_RES',
708759
'HEADER': 'rms[A_RhoW]',
709760
'TYPE': 'RESIDUAL'},
761+
'RMS_ADJ_NU_TILDE': {'DESCRIPTION': 'Root-mean square residual of the adjoint '
762+
'nu tilde.',
763+
'GROUP': 'RMS_RES',
764+
'HEADER': 'rms[A_nu]',
765+
'TYPE': 'RESIDUAL'},
710766
'RMS_ADJ_PRESSURE': {'DESCRIPTION': 'Root-mean square residual of the adjoint '
711767
'Pressure.',
712768
'GROUP': 'RMS_RES',
@@ -717,11 +773,26 @@
717773
'GROUP': 'RMS_RES',
718774
'HEADER': 'rms[A_P1]',
719775
'TYPE': 'RESIDUAL'},
776+
'RMS_ADJ_SPECIES_" + std::to_string(iVar': {'DESCRIPTION': 'Root-mean square '
777+
'residual of the '
778+
'adjoint '
779+
'transported '
780+
'species.',
781+
'GROUP': 'RMS_RES',
782+
'HEADER': 'rms[A_rho*Y_" + '
783+
'std::to_string(iVar) + '
784+
'"]',
785+
'TYPE': 'RESIDUAL'},
720786
'RMS_ADJ_TEMPERATURE': {'DESCRIPTION': 'Root-mean square residual of the '
721787
'adjoint temperature.',
722788
'GROUP': 'RMS_RES',
723789
'HEADER': 'rms[A_T]',
724790
'TYPE': 'RESIDUAL'},
791+
'RMS_ADJ_TKE': {'DESCRIPTION': 'Root-mean square residual of the adjoint '
792+
'kinetic energy.',
793+
'GROUP': 'RMS_RES',
794+
'HEADER': 'rms[A_k]',
795+
'TYPE': 'RESIDUAL'},
725796
'RMS_ADJ_VELOCITY-X': {'DESCRIPTION': 'Root-mean square residual of the '
726797
'adjoint Velocity x-component.',
727798
'GROUP': 'RMS_RES',

SU2_PY/updateHistoryMap.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
'CHeatOutput.cpp',
3535
'CFlowCompFEMOutput.cpp',
3636
'CElasticityOutput.cpp',
37+
'CAdjFlowOutput.cpp',
3738
'CAdjHeatOutput.cpp',
3839
'CAdjFlowIncOutput.cpp',
3940
'CAdjFlowCompOutput.cpp',

0 commit comments

Comments
 (0)