From 3c875ab062f857e69db56bf99a9f13de1bb8d2f2 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Thu, 1 Jan 2026 18:16:54 -0800 Subject: [PATCH 1/2] avoid some warnings, remove unused code --- .../geometry/meshreader/CSU2ASCIIMeshReaderBase.hpp | 8 ++++---- .../geometry/meshreader/CSU2ASCIIMeshReaderFEM.hpp | 8 ++++---- .../geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp | 2 +- Common/include/option_structure.hpp | 4 ---- Common/src/geometry/CPhysicalGeometry.cpp | 11 ++++------- .../geometry/meshreader/CSU2ASCIIMeshReaderFEM.cpp | 12 ++++++------ SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp | 4 +++- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 2 +- config_template.cfg | 2 +- 9 files changed, 24 insertions(+), 29 deletions(-) diff --git a/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderBase.hpp b/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderBase.hpp index f693133d5e81..40308d3eb596 100644 --- a/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderBase.hpp +++ b/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderBase.hpp @@ -81,22 +81,22 @@ class CSU2ASCIIMeshReaderBase : public CMeshReaderBase { * elements). \param[in,out] config - Problem configuration where some metadata is updated (e.g. AoA). \returns True * if single_pass was successful. */ - bool ReadMetadata(const bool single_pass, CConfig* config); + bool ReadMetadata(bool single_pass, CConfig* config); /*! * \brief Reads the grid points from an SU2 zone into linear partitions across all ranks. */ - virtual void ReadPointCoordinates(const bool single_pass = false); + virtual void ReadPointCoordinates(bool single_pass = false); /*! * \brief Reads the interior volume elements from one section of an SU2 zone into linear partitions across all ranks. */ - virtual void ReadVolumeElementConnectivity(const bool single_pass = false); + virtual void ReadVolumeElementConnectivity(bool single_pass = false); /*! * \brief Reads the surface (boundary) elements from the SU2 zone. */ - virtual void ReadSurfaceElementConnectivity(const bool single_pass = false); + virtual void ReadSurfaceElementConnectivity(bool single_pass = false); /*! * \brief Helper function to find the current zone in an SU2 ASCII mesh object. diff --git a/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFEM.hpp b/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFEM.hpp index 1550f012eea0..9c6634993c20 100644 --- a/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFEM.hpp +++ b/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFEM.hpp @@ -37,23 +37,23 @@ * \brief Reads a native SU2 ASCII grid into linear partitions for the finite element solver (FEM). * \author T. Economon, E. van der Weide */ -class CSU2ASCIIMeshReaderFEM : public CSU2ASCIIMeshReaderBase { +class CSU2ASCIIMeshReaderFEM final : public CSU2ASCIIMeshReaderBase { private: /*! * \brief Reads the grid points from an SU2 zone into linear partitions across all ranks. */ - void ReadPointCoordinates(); + void ReadPointCoordinates(bool) override; /*! * \brief Reads the interior volume elements from one section of an SU2 zone into linear partitions across all ranks. */ - void ReadVolumeElementConnectivity(); + void ReadVolumeElementConnectivity(bool) override; /*! * \brief Reads the surface (boundary) elements from one section of an SU2 zone into linear partitions across all * ranks. */ - void ReadSurfaceElementConnectivity(); + void ReadSurfaceElementConnectivity(bool) override; public: /*! diff --git a/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp b/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp index 148fe4d9af45..eaf55a6871e0 100644 --- a/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp +++ b/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp @@ -37,7 +37,7 @@ * \brief Reads a native SU2 ASCII grid into linear partitions for the finite volume solver (FVM). * \author T. Economon */ -class CSU2ASCIIMeshReaderFVM : public CSU2ASCIIMeshReaderBase { +class CSU2ASCIIMeshReaderFVM final : public CSU2ASCIIMeshReaderBase { private: /*! * \brief Splits a single surface actuator disk boundary into two separate markers (repeated points). diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index a07e768fff17..2b7a0e8c3961 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -2046,10 +2046,6 @@ enum class WALL_TYPE { SMOOTH, /*!< \brief Smooth wall */ ROUGH, /*!< \brief Rough wall */ }; -static const MapType WallType_Map = { - MakePair("SMOOTH", WALL_TYPE::SMOOTH) - MakePair("ROUGH", WALL_TYPE::ROUGH) -}; /*! * \brief Types of objective functions diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index aaa71428ca4a..d5836e7ac890 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -4482,7 +4482,7 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig* config) { * which is equivalent to incrementing an integer marking the end of the * result and the start of the queue. ---*/ vector InQueue(nPoint, false); - vector AuxQueue, Result; + vector Result; Result.reserve(nPoint); unsigned long QueueStart = 0; @@ -4521,21 +4521,18 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig* config) { /*--- Add all adjacent nodes to the queue in increasing order of their degree, checking if the element is already in the queue. ---*/ - AuxQueue.clear(); for (auto iNode = 0u; iNode < nodes->GetnPoint(AddPoint); iNode++) { const auto AdjPoint = nodes->GetPoint(AddPoint, iNode); if (!InQueue[AdjPoint]) { - AuxQueue.push_back(AdjPoint); + Result.push_back(AdjPoint); InQueue[AdjPoint] = true; } } - if (AuxQueue.empty()) continue; - /*--- Sort the auxiliar queue based on the number of neighbors (degree). ---*/ - stable_sort(AuxQueue.begin(), AuxQueue.end(), [&](unsigned long iPoint, unsigned long jPoint) { + /*--- Sort the new points based on the number of neighbors (degree). ---*/ + stable_sort(Result.begin() + QueueStart, Result.end(), [&](unsigned long iPoint, unsigned long jPoint) { return nodes->GetnPoint(iPoint) < nodes->GetnPoint(jPoint); }); - Result.insert(Result.end(), AuxQueue.begin(), AuxQueue.end()); } } reverse(Result.begin(), Result.end()); diff --git a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFEM.cpp b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFEM.cpp index 4c5290405468..dfa4b38fe9aa 100644 --- a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFEM.cpp +++ b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFEM.cpp @@ -37,20 +37,20 @@ CSU2ASCIIMeshReaderFEM::CSU2ASCIIMeshReaderFEM(CConfig* val_config, unsigned sho /*--- Read the volume connectivity and distribute it linearly over the MPI ranks. ---*/ - ReadVolumeElementConnectivity(); + ReadVolumeElementConnectivity({}); /*--- Read the coordinates of the points that are needed on this MPI rank. ---*/ - ReadPointCoordinates(); + ReadPointCoordinates({}); /*--- Read the surface connectivity and store the surface elements whose corresponding volume element is stored on this MPI rank. ---*/ - ReadSurfaceElementConnectivity(); + ReadSurfaceElementConnectivity({}); } CSU2ASCIIMeshReaderFEM::~CSU2ASCIIMeshReaderFEM() = default; -void CSU2ASCIIMeshReaderFEM::ReadPointCoordinates() { +void CSU2ASCIIMeshReaderFEM::ReadPointCoordinates(bool) { /*--- Loop over the local elements to determine the global point IDs to be stored on this rank. --*/ unsigned long ind = 0; @@ -113,7 +113,7 @@ void CSU2ASCIIMeshReaderFEM::ReadPointCoordinates() { mesh_file.close(); } -void CSU2ASCIIMeshReaderFEM::ReadVolumeElementConnectivity() { +void CSU2ASCIIMeshReaderFEM::ReadVolumeElementConnectivity(bool) { /* Get a partitioner to help with linear partitioning. */ CLinearPartitioner elemPartitioner(numberOfGlobalElements, 0); @@ -213,7 +213,7 @@ void CSU2ASCIIMeshReaderFEM::ReadVolumeElementConnectivity() { mesh_file.close(); } -void CSU2ASCIIMeshReaderFEM::ReadSurfaceElementConnectivity() { +void CSU2ASCIIMeshReaderFEM::ReadSurfaceElementConnectivity(bool) { /*--- Determine the vector to hold the faces of the local elements. ---*/ vector localFaces; DetermineFacesVolumeElements(localFaces); diff --git a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp index 920886fc6f97..831b72911ed2 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp @@ -1065,7 +1065,7 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config, ModVel_FreeStreamND = sqrt(ModVel_FreeStreamND); config->SetModVel_FreeStreamND(ModVel_FreeStreamND); Viscosity_FreeStreamND = Viscosity_FreeStream / Viscosity_Ref; config->SetViscosity_FreeStreamND(Viscosity_FreeStreamND); - Thermal_Conductivity_FreeStreamND = Thermal_Conductivity_FreeStream / Conductivity_Ref; + Thermal_Conductivity_FreeStreamND = Thermal_Conductivity_FreeStream / Conductivity_Ref; config->SetThermalConductivity_FreeStreamND(Thermal_Conductivity_FreeStreamND); SpecificHeat_Cp_FreeStreamND = SpecificHeat_Cp_FreeStream / Gas_Constant_Ref; config->SetSpecificHeatCp_FreeStreamND(SpecificHeat_Cp_FreeStreamND); @@ -9457,6 +9457,8 @@ void CFEM_DG_EulerSolver::ComputeInviscidFluxesFace(CConfig *config numerics->ComputeResidual(flux, Jacobian_i, Jacobian_j, config); } } + /*--- Just to avoid compilers complaining about dangling pointers. ---*/ + numerics->SetPrimitive(nullptr, nullptr); for (unsigned short iVar = 0; iVar < nVar; iVar++) { delete [] Jacobian_i[iVar]; diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index afc97b79e226..f72784f81509 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -408,7 +408,7 @@ void CTurbSSTSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_cont string Marker_Tag = config->GetMarker_All_TagBound(val_marker); WALL_TYPE WallType; su2double Roughness_Height; tie(WallType, Roughness_Height) = config->GetWallRoughnessProperties(Marker_Tag); - const bool rough_wall = WallType == WALL_TYPE::ROUGH && Roughness_Height > 0; + const bool rough_wall = WallType == WALL_TYPE::ROUGH; /*--- Evaluate nu tilde at the closest point to the surface using the wall functions. ---*/ diff --git a/config_template.cfg b/config_template.cfg index 6d7657e76217..5bb7f5ead4f1 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1359,7 +1359,7 @@ MARKER_DISPLACEMENT= ( NONE ) % ------------------------ WALL ROUGHNESS DEFINITION --------------------------% % The equivalent sand grain roughness height (k_s) on each of the wall. This must be in m. -% This is a list of (string, double) each element corresponding to the MARKER defined in WALL_TYPE. +% This is a list of (string, double) each element corresponding to a wall marker. WALL_ROUGHNESS = (wall1, ks1, wall2, ks2) %WALL_ROUGHNESS = (wall1, ks1, wall2, 0.0) %is also allowed % From 2b38eb267196bf7581be54d15f6046be3d52854e Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Thu, 1 Jan 2026 21:27:01 -0800 Subject: [PATCH 2/2] fix --- Common/src/geometry/CPhysicalGeometry.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index d5836e7ac890..03ac4bf0487e 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -4521,6 +4521,7 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig* config) { /*--- Add all adjacent nodes to the queue in increasing order of their degree, checking if the element is already in the queue. ---*/ + auto currEnd = Result.end(); for (auto iNode = 0u; iNode < nodes->GetnPoint(AddPoint); iNode++) { const auto AdjPoint = nodes->GetPoint(AddPoint, iNode); if (!InQueue[AdjPoint]) { @@ -4530,7 +4531,7 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig* config) { } /*--- Sort the new points based on the number of neighbors (degree). ---*/ - stable_sort(Result.begin() + QueueStart, Result.end(), [&](unsigned long iPoint, unsigned long jPoint) { + stable_sort(currEnd, Result.end(), [&](unsigned long iPoint, unsigned long jPoint) { return nodes->GetnPoint(iPoint) < nodes->GetnPoint(jPoint); }); }