Skip to content

Commit e109712

Browse files
authored
Merge pull request #2671 from su2code/pedro/warnings
avoid some compiler warnings
2 parents fa96e09 + 2b38eb2 commit e109712

File tree

9 files changed

+25
-29
lines changed

9 files changed

+25
-29
lines changed

Common/include/geometry/meshreader/CSU2ASCIIMeshReaderBase.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,22 @@ class CSU2ASCIIMeshReaderBase : public CMeshReaderBase {
8181
* elements). \param[in,out] config - Problem configuration where some metadata is updated (e.g. AoA). \returns True
8282
* if single_pass was successful.
8383
*/
84-
bool ReadMetadata(const bool single_pass, CConfig* config);
84+
bool ReadMetadata(bool single_pass, CConfig* config);
8585

8686
/*!
8787
* \brief Reads the grid points from an SU2 zone into linear partitions across all ranks.
8888
*/
89-
virtual void ReadPointCoordinates(const bool single_pass = false);
89+
virtual void ReadPointCoordinates(bool single_pass = false);
9090

9191
/*!
9292
* \brief Reads the interior volume elements from one section of an SU2 zone into linear partitions across all ranks.
9393
*/
94-
virtual void ReadVolumeElementConnectivity(const bool single_pass = false);
94+
virtual void ReadVolumeElementConnectivity(bool single_pass = false);
9595

9696
/*!
9797
* \brief Reads the surface (boundary) elements from the SU2 zone.
9898
*/
99-
virtual void ReadSurfaceElementConnectivity(const bool single_pass = false);
99+
virtual void ReadSurfaceElementConnectivity(bool single_pass = false);
100100

101101
/*!
102102
* \brief Helper function to find the current zone in an SU2 ASCII mesh object.

Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFEM.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@
3737
* \brief Reads a native SU2 ASCII grid into linear partitions for the finite element solver (FEM).
3838
* \author T. Economon, E. van der Weide
3939
*/
40-
class CSU2ASCIIMeshReaderFEM : public CSU2ASCIIMeshReaderBase {
40+
class CSU2ASCIIMeshReaderFEM final : public CSU2ASCIIMeshReaderBase {
4141
private:
4242
/*!
4343
* \brief Reads the grid points from an SU2 zone into linear partitions across all ranks.
4444
*/
45-
void ReadPointCoordinates();
45+
void ReadPointCoordinates(bool) override;
4646

4747
/*!
4848
* \brief Reads the interior volume elements from one section of an SU2 zone into linear partitions across all ranks.
4949
*/
50-
void ReadVolumeElementConnectivity();
50+
void ReadVolumeElementConnectivity(bool) override;
5151

5252
/*!
5353
* \brief Reads the surface (boundary) elements from one section of an SU2 zone into linear partitions across all
5454
* ranks.
5555
*/
56-
void ReadSurfaceElementConnectivity();
56+
void ReadSurfaceElementConnectivity(bool) override;
5757

5858
public:
5959
/*!

Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* \brief Reads a native SU2 ASCII grid into linear partitions for the finite volume solver (FVM).
3838
* \author T. Economon
3939
*/
40-
class CSU2ASCIIMeshReaderFVM : public CSU2ASCIIMeshReaderBase {
40+
class CSU2ASCIIMeshReaderFVM final : public CSU2ASCIIMeshReaderBase {
4141
private:
4242
/*!
4343
* \brief Splits a single surface actuator disk boundary into two separate markers (repeated points).

Common/include/option_structure.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,10 +2046,6 @@ enum class WALL_TYPE {
20462046
SMOOTH, /*!< \brief Smooth wall */
20472047
ROUGH, /*!< \brief Rough wall */
20482048
};
2049-
static const MapType<std::string, WALL_TYPE> WallType_Map = {
2050-
MakePair("SMOOTH", WALL_TYPE::SMOOTH)
2051-
MakePair("ROUGH", WALL_TYPE::ROUGH)
2052-
};
20532049

20542050
/*!
20552051
* \brief Types of objective functions

Common/src/geometry/CPhysicalGeometry.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4482,7 +4482,7 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig* config) {
44824482
* which is equivalent to incrementing an integer marking the end of the
44834483
* result and the start of the queue. ---*/
44844484
vector<char> InQueue(nPoint, false);
4485-
vector<unsigned long> AuxQueue, Result;
4485+
vector<unsigned long> Result;
44864486
Result.reserve(nPoint);
44874487
unsigned long QueueStart = 0;
44884488

@@ -4521,21 +4521,19 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig* config) {
45214521

45224522
/*--- Add all adjacent nodes to the queue in increasing order of their
45234523
degree, checking if the element is already in the queue. ---*/
4524-
AuxQueue.clear();
4524+
auto currEnd = Result.end();
45254525
for (auto iNode = 0u; iNode < nodes->GetnPoint(AddPoint); iNode++) {
45264526
const auto AdjPoint = nodes->GetPoint(AddPoint, iNode);
45274527
if (!InQueue[AdjPoint]) {
4528-
AuxQueue.push_back(AdjPoint);
4528+
Result.push_back(AdjPoint);
45294529
InQueue[AdjPoint] = true;
45304530
}
45314531
}
4532-
if (AuxQueue.empty()) continue;
45334532

4534-
/*--- Sort the auxiliar queue based on the number of neighbors (degree). ---*/
4535-
stable_sort(AuxQueue.begin(), AuxQueue.end(), [&](unsigned long iPoint, unsigned long jPoint) {
4533+
/*--- Sort the new points based on the number of neighbors (degree). ---*/
4534+
stable_sort(currEnd, Result.end(), [&](unsigned long iPoint, unsigned long jPoint) {
45364535
return nodes->GetnPoint(iPoint) < nodes->GetnPoint(jPoint);
45374536
});
4538-
Result.insert(Result.end(), AuxQueue.begin(), AuxQueue.end());
45394537
}
45404538
}
45414539
reverse(Result.begin(), Result.end());

Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFEM.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@ CSU2ASCIIMeshReaderFEM::CSU2ASCIIMeshReaderFEM(CConfig* val_config, unsigned sho
3737

3838
/*--- Read the volume connectivity and distribute it
3939
linearly over the MPI ranks. ---*/
40-
ReadVolumeElementConnectivity();
40+
ReadVolumeElementConnectivity({});
4141

4242
/*--- Read the coordinates of the points that are needed
4343
on this MPI rank. ---*/
44-
ReadPointCoordinates();
44+
ReadPointCoordinates({});
4545

4646
/*--- Read the surface connectivity and store the surface elements whose
4747
corresponding volume element is stored on this MPI rank. ---*/
48-
ReadSurfaceElementConnectivity();
48+
ReadSurfaceElementConnectivity({});
4949
}
5050

5151
CSU2ASCIIMeshReaderFEM::~CSU2ASCIIMeshReaderFEM() = default;
5252

53-
void CSU2ASCIIMeshReaderFEM::ReadPointCoordinates() {
53+
void CSU2ASCIIMeshReaderFEM::ReadPointCoordinates(bool) {
5454
/*--- Loop over the local elements to determine the global
5555
point IDs to be stored on this rank. --*/
5656
unsigned long ind = 0;
@@ -113,7 +113,7 @@ void CSU2ASCIIMeshReaderFEM::ReadPointCoordinates() {
113113
mesh_file.close();
114114
}
115115

116-
void CSU2ASCIIMeshReaderFEM::ReadVolumeElementConnectivity() {
116+
void CSU2ASCIIMeshReaderFEM::ReadVolumeElementConnectivity(bool) {
117117
/* Get a partitioner to help with linear partitioning. */
118118
CLinearPartitioner elemPartitioner(numberOfGlobalElements, 0);
119119

@@ -213,7 +213,7 @@ void CSU2ASCIIMeshReaderFEM::ReadVolumeElementConnectivity() {
213213
mesh_file.close();
214214
}
215215

216-
void CSU2ASCIIMeshReaderFEM::ReadSurfaceElementConnectivity() {
216+
void CSU2ASCIIMeshReaderFEM::ReadSurfaceElementConnectivity(bool) {
217217
/*--- Determine the vector to hold the faces of the local elements. ---*/
218218
vector<CFaceOfElement> localFaces;
219219
DetermineFacesVolumeElements(localFaces);

SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config,
10651065
ModVel_FreeStreamND = sqrt(ModVel_FreeStreamND); config->SetModVel_FreeStreamND(ModVel_FreeStreamND);
10661066

10671067
Viscosity_FreeStreamND = Viscosity_FreeStream / Viscosity_Ref; config->SetViscosity_FreeStreamND(Viscosity_FreeStreamND);
1068-
Thermal_Conductivity_FreeStreamND = Thermal_Conductivity_FreeStream / Conductivity_Ref;
1068+
Thermal_Conductivity_FreeStreamND = Thermal_Conductivity_FreeStream / Conductivity_Ref;
10691069
config->SetThermalConductivity_FreeStreamND(Thermal_Conductivity_FreeStreamND);
10701070
SpecificHeat_Cp_FreeStreamND = SpecificHeat_Cp_FreeStream / Gas_Constant_Ref;
10711071
config->SetSpecificHeatCp_FreeStreamND(SpecificHeat_Cp_FreeStreamND);
@@ -9457,6 +9457,8 @@ void CFEM_DG_EulerSolver::ComputeInviscidFluxesFace(CConfig *config
94579457
numerics->ComputeResidual(flux, Jacobian_i, Jacobian_j, config);
94589458
}
94599459
}
9460+
/*--- Just to avoid compilers complaining about dangling pointers. ---*/
9461+
numerics->SetPrimitive(nullptr, nullptr);
94609462

94619463
for (unsigned short iVar = 0; iVar < nVar; iVar++) {
94629464
delete [] Jacobian_i[iVar];

SU2_CFD/src/solvers/CTurbSSTSolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ void CTurbSSTSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_cont
408408
string Marker_Tag = config->GetMarker_All_TagBound(val_marker);
409409
WALL_TYPE WallType; su2double Roughness_Height;
410410
tie(WallType, Roughness_Height) = config->GetWallRoughnessProperties(Marker_Tag);
411-
const bool rough_wall = WallType == WALL_TYPE::ROUGH && Roughness_Height > 0;
411+
const bool rough_wall = WallType == WALL_TYPE::ROUGH;
412412

413413
/*--- Evaluate nu tilde at the closest point to the surface using the wall functions. ---*/
414414

config_template.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ MARKER_DISPLACEMENT= ( NONE )
13591359

13601360
% ------------------------ WALL ROUGHNESS DEFINITION --------------------------%
13611361
% The equivalent sand grain roughness height (k_s) on each of the wall. This must be in m.
1362-
% This is a list of (string, double) each element corresponding to the MARKER defined in WALL_TYPE.
1362+
% This is a list of (string, double) each element corresponding to a wall marker.
13631363
WALL_ROUGHNESS = (wall1, ks1, wall2, ks2)
13641364
%WALL_ROUGHNESS = (wall1, ks1, wall2, 0.0) %is also allowed
13651365
%

0 commit comments

Comments
 (0)