From 9307d7d645127d6e7bb9e8447c3f33380dfe34e7 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Thu, 21 Nov 2024 15:49:10 +0100 Subject: [PATCH] remove variable --- SU2_CFD/include/output/COutput.hpp | 1 - SU2_CFD/src/output/COutput.cpp | 15 ++++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/SU2_CFD/include/output/COutput.hpp b/SU2_CFD/include/output/COutput.hpp index 9d3d9685a98..0f5dddf43e3 100644 --- a/SU2_CFD/include/output/COutput.hpp +++ b/SU2_CFD/include/output/COutput.hpp @@ -245,7 +245,6 @@ class COutput { CParallelDataSorter* surfaceDataSorter; //!< Surface data sorter vector volumeFieldNames; //!< Vector containing the volume field names - unsigned short nVolumeFields; //!< Number of fields in the volume output vector requiredVolumeFieldNames; //!< Vector containing the minimum required volume field names. diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 2d82b1fecf0..ac0d893ae96 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -1542,9 +1542,6 @@ void COutput::PreprocessVolumeOutput(CConfig *config){ nRequestedVolumeFields++; } - nVolumeFields = 0; - - string RequestedField; string RequiredField; std::vector FoundField(nRequestedVolumeFields, false); vector FieldsToRemove; @@ -1562,7 +1559,7 @@ void COutput::PreprocessVolumeOutput(CConfig *config){ VolumeOutputField &Field = volumeOutput_Map.at(fieldReference); /*--- Loop through all fields specified in the config ---*/ - for (unsigned short iReqField = 0; iReqField < nRequiredVolumeFields; iReqField++) { + for (size_t iReqField = 0; iReqField < nRequiredVolumeFields; iReqField++) { RequiredField = requiredVolumeFields[iReqField]; if (((RequiredField == Field.outputGroup) || (RequiredField == fieldReference)) && (Field.offset == -1)) { @@ -1571,7 +1568,8 @@ void COutput::PreprocessVolumeOutput(CConfig *config){ } } } - nVolumeFields = 0; + + unsigned short nVolumeFields = 0; for (size_t iField_Output = 0; iField_Output < volumeOutput_List.size(); iField_Output++) { @@ -1581,9 +1579,9 @@ void COutput::PreprocessVolumeOutput(CConfig *config){ /*--- Loop through all fields specified in the config ---*/ - for (unsigned short iReqField = 0; iReqField < nRequestedVolumeFields; iReqField++) { + for (size_t iReqField = 0; iReqField < nRequestedVolumeFields; iReqField++) { - RequestedField = requestedVolumeFields[iReqField]; + const string &RequestedField = requestedVolumeFields[iReqField]; if (((RequestedField == Field.outputGroup) || (RequestedField == fieldReference)) && (Field.offset == -1)) { @@ -1625,8 +1623,7 @@ void COutput::PreprocessVolumeOutput(CConfig *config){ if (rank == MASTER_NODE){ cout <<"Volume output fields: "; - for (unsigned short iReqField = 0; iReqField < nRequestedVolumeFields; iReqField++){ - RequestedField = requestedVolumeFields[iReqField]; + for (size_t iReqField = 0; iReqField < nRequestedVolumeFields; iReqField++){ cout << requestedVolumeFields[iReqField]; if (iReqField != nRequestedVolumeFields - 1) cout << ", "; }