Skip to content

Commit c863e9c

Browse files
authored
Merge pull request #1203 from su2code/strict_warning_policy
Strict compiler warning policy for CI builds
2 parents 9ab0335 + 8642dcd commit c863e9c

33 files changed

Lines changed: 284 additions & 648 deletions

.github/workflows/regression.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ jobs:
1919
config_set: [BaseMPI, ReverseMPI, ForwardMPI, BaseNoMPI, ReverseNoMPI, ForwardNoMPI, BaseOMP]
2020
include:
2121
- config_set: BaseMPI
22-
flags: '-Denable-pywrapper=true -Denable-tests=true --werror'
22+
flags: '-Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror'
2323
- config_set: ReverseMPI
24-
flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true -Denable-tests=true --werror'
24+
flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror'
2525
- config_set: ForwardMPI
26-
flags: '-Denable-directdiff=true -Denable-normal=false -Denable-tests=true --werror'
26+
flags: '-Denable-directdiff=true -Denable-normal=false -Denable-tests=true --warnlevel=3 --werror'
2727
- config_set: BaseNoMPI
28-
flags: '-Denable-pywrapper=true -Dwith-mpi=disabled -Denable-tests=true --werror'
28+
flags: '-Denable-pywrapper=true -Dwith-mpi=disabled -Denable-tests=true --warnlevel=3 --werror'
2929
- config_set: ReverseNoMPI
30-
flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-pywrapper=true -Denable-tests=true --werror'
30+
flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror'
3131
- config_set: ForwardNoMPI
32-
flags: '-Denable-directdiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-tests=true --werror'
32+
flags: '-Denable-directdiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-tests=true --warnlevel=3 --werror'
3333
- config_set: BaseOMP
34-
flags: '-Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --werror'
34+
flags: '-Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --warnlevel=3 --werror'
3535
runs-on: ubuntu-latest
3636
steps:
3737
- name: Cache Object Files

Common/src/CConfig.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4142,9 +4142,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
41424142
/* Check if the byte alignment of the matrix multiplications is a
41434143
multiple of 64. */
41444144
if( byteAlignmentMatMul%64 ) {
4145-
if(rank == MASTER_NODE)
4146-
cout << "ALIGNED_BYTES_MATMUL must be a multiple of 64." << endl;
4147-
exit(EXIT_FAILURE);
4145+
SU2_MPI::Error("ALIGNED_BYTES_MATMUL must be a multiple of 64.", CURRENT_FUNCTION);
41484146
}
41494147

41504148
/* Determine the value of sizeMatMulPadding, which is the matrix size in

SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ FORCEINLINE void correctGradient(const PrimitiveType& V,
7171
*/
7272
template<size_t nVar, size_t nDim>
7373
FORCEINLINE MatrixDbl<nDim> stressTensor(Double viscosity,
74-
const MatrixDbl<nVar,nDim> grad) {
74+
const MatrixDbl<nVar,nDim>& grad) {
7575
/*--- Hydrostatic term. ---*/
7676
Double velDiv = 0.0;
7777
for (size_t iDim = 0; iDim < nDim; ++iDim) {
@@ -154,7 +154,7 @@ FORCEINLINE void addQCR(const MatrixType& grad, MatrixDbl<nDim>& tau) {
154154
*/
155155
template<size_t nVar, size_t nDim, class PrimitiveType>
156156
FORCEINLINE MatrixDbl<nDim,nVar> stressTensorJacobian(const PrimitiveType& V,
157-
const VectorDbl<nDim> normal,
157+
const VectorDbl<nDim>& normal,
158158
Double dist_ij) {
159159
Double viscosity = V.laminarVisc() + V.eddyVisc();
160160
Double xi = viscosity / (V.density() * dist_ij);

SU2_CFD/include/sgs_model.inl

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* SU2 Project Website: https://su2code.github.io
88
*
9-
* The SU2 Project is maintained by the SU2 Foundation
9+
* The SU2 Project is maintained by the SU2 Foundation
1010
* (http://su2foundation.org)
1111
*
1212
* Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md)
@@ -191,8 +191,7 @@ inline void CSmagorinskyModel::ComputeGradEddyViscosity_2D(const su2double rho,
191191
const su2double distToWall,
192192
su2double &dMuTdx,
193193
su2double &dMuTdy) {
194-
cout << "CSmagorinskyModel::ComputeGradEddyViscosity_2D: Not implemented yet" << endl;
195-
exit(1);
194+
SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION);
196195
}
197196

198197
inline void CSmagorinskyModel::ComputeGradEddyViscosity_3D(const su2double rho,
@@ -231,8 +230,7 @@ inline void CSmagorinskyModel::ComputeGradEddyViscosity_3D(const su2double rho,
231230
su2double &dMuTdx,
232231
su2double &dMuTdy,
233232
su2double &dMuTdz) {
234-
cout << "CSmagorinskyModel::ComputeGradEddyViscosity_3D: Not implemented yet" << endl;
235-
exit(1);
233+
SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION);
236234
}
237235

238236
inline CWALEModel::CWALEModel(void) : CSGSModel() {
@@ -363,8 +361,7 @@ inline void CWALEModel::ComputeGradEddyViscosity_2D(const su2double rho,
363361
const su2double distToWall,
364362
su2double &dMuTdx,
365363
su2double &dMuTdy) {
366-
cout << "CWALEModel::ComputeGradEddyViscosity_2D: Not implemented yet" << endl;
367-
exit(1);
364+
SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION);
368365
}
369366

370367
inline void CWALEModel::ComputeGradEddyViscosity_3D(const su2double rho,
@@ -403,12 +400,11 @@ inline void CWALEModel::ComputeGradEddyViscosity_3D(const su2double rho,
403400
su2double &dMuTdx,
404401
su2double &dMuTdy,
405402
su2double &dMuTdz) {
406-
cout << "CWALEModel::ComputeGradEddyViscosity_3D: Not implemented yet" << endl;
407-
exit(1);
403+
SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION);
408404
}
409405

410406
inline CVremanModel::CVremanModel(void) : CSGSModel() {
411-
407+
412408
/* const_Vreman = 2.5*Cs*Cs where Cs is the Smagorinsky constant */
413409
const_Vreman = 0.07;
414410
}
@@ -422,8 +418,8 @@ inline su2double CVremanModel::ComputeEddyViscosity_2D(const su2double rho,
422418
const su2double dvdy,
423419
const su2double lenScale,
424420
const su2double distToWall) {
425-
cout << "CVremanModel::ComputeEddyViscosity_2D: Not implemented yet" << endl;
426-
exit(1);
421+
SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION);
422+
return 0;
427423
}
428424

429425
inline su2double CVremanModel::ComputeEddyViscosity_3D(const su2double rho,
@@ -438,7 +434,7 @@ inline su2double CVremanModel::ComputeEddyViscosity_3D(const su2double rho,
438434
const su2double dwdz,
439435
const su2double lenScale,
440436
const su2double distToWall) {
441-
437+
442438
su2double alpha11 = dudx;
443439
su2double alpha22 = dvdy;
444440
su2double alpha33 = dwdz;
@@ -495,8 +491,7 @@ inline void CVremanModel::ComputeGradEddyViscosity_2D(const su2double rho,
495491
const su2double distToWall,
496492
su2double &dMuTdx,
497493
su2double &dMuTdy) {
498-
cout << "CWALEModel::ComputeGradEddyViscosity_2D: Not implemented yet" << endl;
499-
exit(1);
494+
SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION);
500495
}
501496

502497
inline void CVremanModel::ComputeGradEddyViscosity_3D(const su2double rho,
@@ -535,6 +530,5 @@ inline void CVremanModel::ComputeGradEddyViscosity_3D(const su2double rho,
535530
su2double &dMuTdx,
536531
su2double &dMuTdy,
537532
su2double &dMuTdz) {
538-
cout << "CWALEModel::ComputeGradEddyViscosity_3D: Not implemented yet" << endl;
539-
exit(1);
533+
SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION);
540534
}

SU2_CFD/include/solvers/CEulerSolver.hpp

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,42 +43,38 @@ class CEulerSolver : public CFVMFlowSolverBase<CEulerVariable, COMPRESSIBLE> {
4343
Prandtl_Lam = 0.0, /*!< \brief Laminar Prandtl number. */
4444
Prandtl_Turb = 0.0; /*!< \brief Turbulent Prandtl number. */
4545

46+
su2double AllBound_CEquivArea_Inv=0.0; /*!< \brief equivalent area coefficient (inviscid contribution) for all the boundaries. */
47+
vector<su2double> CEquivArea_Mnt; /*!< \brief Equivalent area (inviscid contribution) for each boundary. */
48+
vector<su2double> CEquivArea_Inv; /*!< \brief Equivalent area (inviscid contribution) for each boundary. */
49+
50+
vector<su2double> Inflow_MassFlow; /*!< \brief Mass flow rate for each boundary. */
51+
vector<su2double> Exhaust_MassFlow; /*!< \brief Mass flow rate for each boundary. */
52+
vector<su2double> Inflow_Pressure; /*!< \brief Fan face pressure for each boundary. */
53+
vector<su2double> Inflow_Mach; /*!< \brief Fan face mach number for each boundary. */
54+
vector<su2double> Inflow_Area; /*!< \brief Boundary total area. */
55+
vector<su2double> Exhaust_Area; /*!< \brief Boundary total area. */
56+
vector<su2double> Exhaust_Pressure; /*!< \brief Fan face pressure for each boundary. */
57+
vector<su2double> Exhaust_Temperature; /*!< \brief Fan face mach number for each boundary. */
4658
su2double
47-
AllBound_CEquivArea_Inv = 0.0, /*!< \brief equivalent area coefficient (inviscid contribution) for all the boundaries. */
48-
*CEquivArea_Mnt = nullptr, /*!< \brief Equivalent area (inviscid contribution) for each boundary. */
49-
*CEquivArea_Inv = nullptr; /*!< \brief Equivalent area (inviscid contribution) for each boundary. */
50-
51-
su2double
52-
*Inflow_MassFlow = nullptr, /*!< \brief Mass flow rate for each boundary. */
53-
*Exhaust_MassFlow = nullptr, /*!< \brief Mass flow rate for each boundary. */
54-
*Inflow_Pressure = nullptr, /*!< \brief Fan face pressure for each boundary. */
55-
*Inflow_Mach = nullptr, /*!< \brief Fan face mach number for each boundary. */
56-
*Inflow_Area = nullptr, /*!< \brief Boundary total area. */
57-
*Exhaust_Area = nullptr, /*!< \brief Boundary total area. */
58-
*Exhaust_Pressure = nullptr, /*!< \brief Fan face pressure for each boundary. */
59-
*Exhaust_Temperature = nullptr,/*!< \brief Fan face mach number for each boundary. */
6059
Inflow_MassFlow_Total = 0.0, /*!< \brief Mass flow rate for each boundary. */
6160
Exhaust_MassFlow_Total = 0.0, /*!< \brief Mass flow rate for each boundary. */
6261
Inflow_Pressure_Total = 0.0, /*!< \brief Fan face pressure for each boundary. */
6362
Inflow_Mach_Total = 0.0, /*!< \brief Fan face mach number for each boundary. */
6463
InverseDesign = 0.0; /*!< \brief Inverse design functional for each boundary. */
65-
unsigned long
66-
**DonorGlobalIndex = nullptr; /*!< \brief Value of the donor global index. */
67-
su2double
68-
***DonorPrimVar = nullptr, /*!< \brief Value of the donor variables at each boundary. */
69-
**ActDisk_DeltaP = nullptr, /*!< \brief Value of the Delta P. */
70-
**ActDisk_DeltaT = nullptr; /*!< \brief Value of the Delta T. */
64+
vector<vector<unsigned long> > DonorGlobalIndex; /*!< \brief Value of the donor global index. */
65+
vector<su2activematrix> DonorPrimVar; /*!< \brief Value of the donor variables at each boundary. */
66+
vector<vector<su2double> > ActDisk_DeltaP; /*!< \brief Value of the Delta P. */
67+
vector<vector<su2double> > ActDisk_DeltaT; /*!< \brief Value of the Delta T. */
7168

7269
su2activevector
7370
ActDisk_R; /*!< \brief Value of the actuator disk Radius. */
7471
su2activematrix
7572
ActDisk_C, /*!< \brief Value of the actuator disk Center. */
7673
ActDisk_Axis; /*!< \brief Value of the actuator disk Axis. */
77-
su2double
78-
**ActDisk_Fa, /*!< \brief Value of the actuator disk Axial Force per Unit Area. */
79-
**ActDisk_Fx, /*!< \brief Value of the actuator disk X component of the radial and tangential forces per Unit Area resultant. */
80-
**ActDisk_Fy, /*!< \brief Value of the actuator disk Y component of the radial and tangential forces per Unit Area resultant. */
81-
**ActDisk_Fz; /*!< \brief Value of the actuator disk Z component of the radial and tangential forces per Unit Area resultant. */
74+
vector<vector<su2double> > ActDisk_Fa; /*!< \brief Value of the actuator disk Axial Force per Unit Area. */
75+
vector<vector<su2double> > ActDisk_Fx; /*!< \brief Value of the actuator disk X component of the radial and tangential forces per Unit Area resultant. */
76+
vector<vector<su2double> > ActDisk_Fy; /*!< \brief Value of the actuator disk Y component of the radial and tangential forces per Unit Area resultant. */
77+
vector<vector<su2double> > ActDisk_Fz; /*!< \brief Value of the actuator disk Z component of the radial and tangential forces per Unit Area resultant. */
8278

8379
su2double
8480
Total_CL_Prev = 0.0, /*!< \brief Total lift coefficient for all the boundaries (fixed lift mode). */

0 commit comments

Comments
 (0)