Skip to content

Commit 8a49e82

Browse files
committed
fix build and clean a bunch of warnings
1 parent 43cd22e commit 8a49e82

7 files changed

Lines changed: 289 additions & 364 deletions

File tree

SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ class CFVMFlowSolverBase : public CSolver {
234234
* \param[in] config - Definition of the particular problem.
235235
* \param[in] reconstruction - indicator that the gradient being computed is for upwind reconstruction.
236236
*/
237-
void SetPrimitive_Gradient_GG(CGeometry* geometry, const CConfig* config, bool reconstruction = false) final;
237+
void SetPrimitive_Gradient_GG(CGeometry* geometry, const CConfig* config, bool reconstruction = false) override;
238238

239239
/*!
240240
* \brief Compute the gradient of the primitive variables using a Least-Squares method,
@@ -243,7 +243,7 @@ class CFVMFlowSolverBase : public CSolver {
243243
* \param[in] config - Definition of the particular problem.
244244
* \param[in] reconstruction - indicator that the gradient being computed is for upwind reconstruction.
245245
*/
246-
void SetPrimitive_Gradient_LS(CGeometry* geometry, const CConfig* config, bool reconstruction = false) final;
246+
void SetPrimitive_Gradient_LS(CGeometry* geometry, const CConfig* config, bool reconstruction = false) override;
247247

248248
/*!
249249
* \brief Compute the limiter of the primitive variables.

SU2_CFD/include/solvers/CFVMFlowSolverBase.inl

Lines changed: 224 additions & 231 deletions
Large diffs are not rendered by default.

SU2_CFD/include/solvers/CNEMOEulerSolver.hpp

Lines changed: 38 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class CNEMOEulerSolver : public CFVMFlowSolverBase<CNEMOEulerVariable, COMPRESSI
9696
CSolver **solver_container,
9797
CConfig *config,
9898
unsigned short iMesh,
99-
unsigned long Iteration);
99+
unsigned long Iteration) final;
100100

101101
/*!
102102
* \brief Set the initial condition for the Euler Equations.
@@ -105,7 +105,7 @@ class CNEMOEulerSolver : public CFVMFlowSolverBase<CNEMOEulerVariable, COMPRESSI
105105
* \param[in] config - Definition of the particular problem.
106106
* \param[in] ExtIter - External iteration.
107107
*/
108-
void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter);
108+
void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter) final;
109109

110110
/*!
111111
* \brief Load a solution from a restart file.
@@ -115,7 +115,7 @@ class CNEMOEulerSolver : public CFVMFlowSolverBase<CNEMOEulerVariable, COMPRESSI
115115
* \param[in] val_iter - Current external iteration number.
116116
* \param[in] val_update_geo - Flag for updating coords and grid velocity.
117117
*/
118-
void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo);
118+
void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo) final;
119119

120120
/*!
121121
* \brief Compute the spatial integration using a centered scheme.
@@ -125,49 +125,48 @@ class CNEMOEulerSolver : public CFVMFlowSolverBase<CNEMOEulerVariable, COMPRESSI
125125
* \param[in] config - Definition of the particular problem.
126126
* \param[in] iMesh - Index of the mesh in multigrid computations.
127127
*/
128-
void Centered_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics,
129-
CConfig *config, unsigned short iMesh, unsigned short iRKStep);
128+
void Centered_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics,
129+
CConfig *config, unsigned short iMesh, unsigned short iRKStep) final;
130130

131131
/*!
132-
* \brief Compute the spatial integration using a upwind scheme.
133-
* \param[in] geometry - Geometrical definition of the problem.
134-
* \param[in] solver_container - Container vector with all the solutions.
135-
* \param[in] solver - Description of the numerical method.
136-
* \param[in] config - Definition of the particular problem.
137-
* \param[in] iMesh - Index of the mesh in multigrid computations.
138-
*/
139-
void Upwind_Residual(CGeometry *geometry,
132+
* \brief Compute the spatial integration using a upwind scheme.
133+
* \param[in] geometry - Geometrical definition of the problem.
134+
* \param[in] solver_container - Container vector with all the solutions.
135+
* \param[in] solver - Description of the numerical method.
136+
* \param[in] config - Definition of the particular problem.
137+
* \param[in] iMesh - Index of the mesh in multigrid computations.
138+
*/
139+
void Upwind_Residual(CGeometry *geometry,
140140
CSolver **solver_container,
141141
CNumerics **numerics_container,
142142
CConfig *config,
143143
unsigned short iMesh) final;
144144

145-
146-
147145
/*!
148-
* \brief Source term integration.
149-
* \param[in] geometry - Geometrical definition of the problem.
150-
* \param[in] solver_container - Container vector with all the solutions.
151-
* \param[in] numerics - Description of the numerical method.
146+
* \brief Source term integration.
147+
* \param[in] geometry - Geometrical definition of the problem.
148+
* \param[in] solver_container - Container vector with all the solutions.
149+
* \param[in] numerics - Description of the numerical method.
152150
* \param[in] second_numerics - Description of the second numerical method.
153-
* \param[in] config - Definition of the particular problem.
154-
* \param[in] iMesh - Index of the mesh in multigrid computations.
155-
*/
156-
void Source_Residual(CGeometry *geometry,
151+
* \param[in] config - Definition of the particular problem.
152+
* \param[in] iMesh - Index of the mesh in multigrid computations.
153+
*/
154+
void Source_Residual(CGeometry *geometry,
157155
CSolver **solver_container,
158156
CNumerics **numerics_container,
159157
CConfig *config,
160158
unsigned short iMesh) final;
161159

162160
/*!
163-
* \brief Compute the velocity^2, SoundSpeed, Pressure, Enthalpy, Viscosity.
164-
* \param[in] geometry - Geometrical definition of the problem.
165-
* \param[in] solver_container - Container vector with all the solutions.
166-
* \param[in] config - Definition of the particular problem.
167-
* \param[in] iRKStep - Current step of the Runge-Kutta iteration.
161+
* \brief Compute the velocity^2, SoundSpeed, Pressure, Enthalpy, Viscosity.
162+
* \param[in] geometry - Geometrical definition of the problem.
163+
* \param[in] solver_container - Container vector with all the solutions.
164+
* \param[in] config - Definition of the particular problem.
165+
* \param[in] iRKStep - Current step of the Runge-Kutta iteration.
168166
* \param[in] RunTime_EqSystem - System of equations which is going to be solved.
169-
*/
170-
void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output);
167+
*/
168+
void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh,
169+
unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) override;
171170

172171
/*!
173172
* \brief Computes primitive variables.
@@ -194,25 +193,14 @@ class CNEMOEulerSolver : public CFVMFlowSolverBase<CNEMOEulerVariable, COMPRESSI
194193
void SetNondimensionalization(CConfig *config, unsigned short iMesh) final;
195194

196195
/*!
197-
* \brief Impose via the residual the Euler wall boundary condition.
198-
* \param[in] geometry - Geometrical definition of the problem.
199-
* \param[in] solver_container - Container vector with all the solutions.
200-
* \param[in] numerics - Description of the numerical method.
201-
* \param[in] config - Definition of the particular problem.
202-
* \param[in] val_marker - Surface marker where the boundary condition is applied.
203-
*/
204-
//void BC_Euler_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics,
205-
// CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final;
206-
207-
/*!
208-
* \brief Impose the far-field boundary condition using characteristics.
209-
* \param[in] geometry - Geometrical definition of the problem.
210-
* \param[in] solver_container - Container vector with all the solutions.
211-
* \param[in] conv_numerics - Description of the numerical method for convective terms.
196+
* \brief Impose the far-field boundary condition using characteristics.
197+
* \param[in] geometry - Geometrical definition of the problem.
198+
* \param[in] solver_container - Container vector with all the solutions.
199+
* \param[in] conv_numerics - Description of the numerical method for convective terms.
212200
* \param[in] visc_numerics - Description of the numerical method for viscous terms.
213-
* \param[in] config - Definition of the particular problem.
214-
* \param[in] val_marker - Surface marker where the boundary condition is applied.
215-
*/
201+
* \param[in] config - Definition of the particular problem.
202+
* \param[in] val_marker - Surface marker where the boundary condition is applied.
203+
*/
216204
void BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics,
217205
CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override;
218206

@@ -314,30 +302,12 @@ class CNEMOEulerSolver : public CFVMFlowSolverBase<CNEMOEulerVariable, COMPRESSI
314302
void SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config,
315303
unsigned short iRKStep, unsigned short iMesh, unsigned short RunTime_EqSystem) override;
316304

317-
/*!
318-
* \brief Load a direct flow solution for use with the adjoint solver.
319-
* \param[in] geometry - Geometrical definition of the problem.
320-
* \param[in] config - Definition of the particular problem.
321-
* \param[in] val_iZone - Current zone in the mesh.
322-
*/
323-
void GetRestart(CGeometry *geometry, CConfig *config, unsigned short val_iZone);
324-
325-
/*!
326-
* \brief Load the output data container with the variables to be written to the volume solution file.
327-
* \param[in] config - Definition of the particular problem.
328-
* \param[in] geometry - Geometrical definition of the problem.
329-
* \param[in] data_container - Container holding the output variable data.
330-
* \param[in] nOutput_Vars - Number of output variables being stored.
331-
*/
332-
void SetVolume_Output(CConfig *config, CGeometry *geometry, su2double **data_container, unsigned short nOutput_Vars);
333-
334305
/*!
335306
* \brief Compute a pressure sensor switch.
336307
* \param[in] geometry - Geometrical definition of the problem.
337308
* \param[in] solver_container - Container vector with all the solutions.
338309
* \param[in] config - Definition of the particular problem.
339-
*/
340-
310+
*/
341311
inline void SetCentered_Dissipation_Sensor(CGeometry *geometry, CConfig *config) { }
342312

343313
/*!
@@ -353,4 +323,4 @@ class CNEMOEulerSolver : public CFVMFlowSolverBase<CNEMOEulerVariable, COMPRESSI
353323
*/
354324
void PrintVerificationError(const CConfig* config) const final { }
355325

356-
};
326+
};

SU2_CFD/include/solvers/CNEMONSSolver.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* \author S. R. Copeland, F. Palacios, W. Maier.
4141
* \version 6.1
4242
*/
43-
class CNEMONSSolver : public CNEMOEulerSolver {
43+
class CNEMONSSolver final : public CNEMOEulerSolver {
4444
private:
4545

4646
su2double Prandtl_Lam, /*!< \brief Laminar Prandtl number. */
@@ -76,8 +76,8 @@ class CNEMONSSolver : public CNEMOEulerSolver {
7676
* \param[in] reconstruction - indicator that the gradient being computed is for upwind reconstruction.
7777
*/
7878
void SetPrimitive_Gradient_GG(CGeometry *geometry,
79-
CConfig *config,
80-
bool reconstruction = false);
79+
const CConfig *config,
80+
bool reconstruction = false) override;
8181

8282
/*!
8383
* \brief Compute the gradient of the primitive variables using a Least-Squares method,
@@ -87,8 +87,8 @@ class CNEMONSSolver : public CNEMOEulerSolver {
8787
* \param[in] reconstruction - indicator that the gradient being computed is for upwind reconstruction.
8888
*/
8989
void SetPrimitive_Gradient_LS(CGeometry *geometry,
90-
CConfig *config,
91-
bool reconstruction = false);
90+
const CConfig *config,
91+
bool reconstruction = false) override;
9292

9393
/*!
9494
* \brief Impose a constant heat-flux condition at the wall.
@@ -100,7 +100,7 @@ class CNEMONSSolver : public CNEMOEulerSolver {
100100
* \param[in] val_marker - Surface marker where the boundary condition is applied.
101101
*/
102102
void BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics,
103-
CNumerics *visc_numerics, CConfig *config, unsigned short val_marker);
103+
CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override;
104104

105105
/*!
106106
* \brief Impose a constant heat-flux condition at the wall.
@@ -142,7 +142,7 @@ class CNEMONSSolver : public CNEMOEulerSolver {
142142
* \param[in] val_marker - Surface marker where the boundary condition is applied.
143143
*/
144144
void BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics,
145-
CNumerics *visc_numerics, CConfig *config, unsigned short val_marker);
145+
CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override;
146146

147147
/*!
148148
* \brief Impose the Navier-Stokes boundary condition (strong).
@@ -185,7 +185,7 @@ class CNEMONSSolver : public CNEMOEulerSolver {
185185
CNumerics *conv_numerics,
186186
CNumerics *visc_numerics,
187187
CConfig *config,
188-
unsigned short val_marker);
188+
unsigned short val_marker) override;
189189

190190
/*!
191191
* \brief Compute the viscous residuals.
@@ -197,6 +197,6 @@ class CNEMONSSolver : public CNEMOEulerSolver {
197197
* \param[in] iRKStep - Current step of the Runge-Kutta iteration.
198198
*/
199199
void Viscous_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container,
200-
CConfig *config, unsigned short iMesh, unsigned short iRKStep);
200+
CConfig *config, unsigned short iMesh, unsigned short iRKStep) override;
201201

202-
};
202+
};

SU2_CFD/include/variables/CNEMOEulerVariable.hpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ class CNEMOEulerVariable : public CVariable {
259259
* \param[in] iDim - Index of the dimension.
260260
* \param[in] value - Value of the reconstruction gradient component.
261261
*/
262-
inline void SetGradient_Reconstruction(unsigned long iPoint, unsigned long iVar, unsigned long iDim, su2double value) { Gradient_Reconstruction(iPoint,iVar,iDim) = value;
262+
inline void SetGradient_Reconstruction(unsigned long iPoint, unsigned long iVar, unsigned long iDim, su2double value) override {
263+
Gradient_Reconstruction(iPoint,iVar,iDim) = value;
263264
}
264265

265266
/*!
@@ -434,28 +435,28 @@ class CNEMOEulerVariable : public CVariable {
434435
* \brief A virtual member.
435436
* \return Value of the vibrational-electronic temperature.
436437
*/
437-
inline su2double GetTemperature_ve(unsigned long iPoint) const
438+
inline su2double GetTemperature_ve(unsigned long iPoint) const override
438439
{ return Primitive(iPoint,TVE_INDEX); }
439440

440441
/*!
441442
* \brief Sets the vibrational electronic temperature of the flow.
442443
* \return Value of the temperature of the flow.
443444
*/
444-
inline bool SetTemperature_ve(unsigned long iPoint, su2double val_Tve)
445+
inline bool SetTemperature_ve(unsigned long iPoint, su2double val_Tve) override
445446
{ Primitive(iPoint,TVE_INDEX) = val_Tve; return false; }
446447

447448
/*!
448449
* \brief Get the mixture specific heat at constant volume (trans.-rot.).
449450
* \return \f$\rho C^{t-r}_{v} \f$
450451
*/
451-
inline su2double GetRhoCv_tr(unsigned long iPoint) const
452+
inline su2double GetRhoCv_tr(unsigned long iPoint) const override
452453
{ return Primitive(iPoint,RHOCVTR_INDEX); }
453454

454455
/*!
455456
* \brief Get the mixture specific heat at constant volume (vib.-el.).
456457
* \return \f$\rho C^{v-e}_{v} \f$
457458
*/
458-
inline su2double GetRhoCv_ve(unsigned long iPoint) const
459+
inline su2double GetRhoCv_ve(unsigned long iPoint) const override
459460
{ return Primitive(iPoint,RHOCVVE_INDEX); }
460461

461462
/*!
@@ -471,17 +472,17 @@ class CNEMOEulerVariable : public CVariable {
471472
/*!
472473
* \brief Set partial derivative of pressure w.r.t. density \f$\frac{\partial P}{\partial \rho_s}\f$
473474
*/
474-
inline su2double *GetdPdU(unsigned long iPoint) { return dPdU[iPoint]; }
475+
inline su2double *GetdPdU(unsigned long iPoint) override { return dPdU[iPoint]; }
475476

476477
/*!
477478
* \brief Set partial derivative of temperature w.r.t. density \f$\frac{\partial T}{\partial \rho_s}\f$
478479
*/
479-
inline su2double *GetdTdU(unsigned long iPoint) { return dTdU[iPoint]; }
480+
inline su2double *GetdTdU(unsigned long iPoint) override { return dTdU[iPoint]; }
480481

481482
/*!
482483
* \brief Set partial derivative of vib.-el. temperature w.r.t. density \f$\frac{\partial T^{V-E}}{\partial \rho_s}\f$
483484
*/
484-
inline su2double *GetdTvedU(unsigned long iPoint) { return dTvedU[iPoint]; }
485+
inline su2double *GetdTvedU(unsigned long iPoint) override { return dTvedU[iPoint]; }
485486

486487
/*!
487488
* \brief Get the mass fraction \f$\rho_s / \rho \f$ of species s.

SU2_CFD/src/solvers/CNEMOEulerSolver.cpp

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -730,12 +730,14 @@ void CNEMOEulerSolver::SetMax_Eigenvalue(CGeometry *geometry, CConfig *config) {
730730

731731
}
732732

733-
void CNEMOEulerSolver::Centered_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics,
733+
void CNEMOEulerSolver::Centered_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container,
734734
CConfig *config, unsigned short iMesh, unsigned short iRKStep) {
735735
unsigned long iEdge, iPoint, jPoint;
736736
unsigned short iVar, jVar;
737737
bool err;
738738

739+
auto numerics = numerics_container[CONV_TERM];
740+
739741
/*--- Set booleans based on config settings ---*/
740742
bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT);
741743

@@ -3073,44 +3075,3 @@ void CNEMOEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CCon
30733075

30743076
}
30753077

3076-
void CNEMOEulerSolver::SetVolume_Output(CConfig *config, CGeometry *geometry, su2double **data_container, unsigned short nOutput_Vars) {
3077-
3078-
#ifdef DEBUG_TDE
3079-
3080-
unsigned short iVar;
3081-
unsigned long iPoint;
3082-
3083-
/*--- Add up total number of output variables to be written. ---*/
3084-
nOutput_Vars = nVar;
3085-
3086-
for (iVar = 0; iVar < config->GetnOutput_Vars_Vol(); iVar++ ) {
3087-
3088-
switch(config->GetOutput_Vars_Vol(iVar)) {
3089-
case PRESSURE:
3090-
nOutput_Vars++;
3091-
break;
3092-
case MACH:
3093-
nOutput_Vars++;
3094-
break;
3095-
}
3096-
}
3097-
3098-
// NEEDS TO BE MAX NUMBER OF POINTS ON ANY PARTITION ?
3099-
data_container = new su2double*[nOutput_Vars];
3100-
for (iVar = 0; iVar < nOutput_Vars; iVar++ ) {
3101-
data_container[iVar] = new su2double[nPointDomain];
3102-
}
3103-
3104-
for (iVar = 0; iVar < config->GetnOutput_Vars_Vol(); iVar++ ) {
3105-
3106-
switch(config->GetOutput_Vars_Vol(iVar)) {
3107-
case PRESSURE:
3108-
nOutput_Vars++;
3109-
break;
3110-
case MACH:
3111-
nOutput_Vars++;
3112-
break;
3113-
}
3114-
}
3115-
#endif
3116-
}

0 commit comments

Comments
 (0)