diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f15df3f4ea2b..0956918eb06d 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -12,7 +12,7 @@ *Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.* - [ ] I am submitting my contribution to the develop branch. -- [ ] My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags). +- [ ] My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags, or simply --warnlevel=2 when using meson). - [ ] My contribution is commented and consistent with SU2 style. - [ ] I have added a test case that demonstrates my contribution, if necessary. - [ ] I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp) , if necessary. diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index afd8310eb5ec..226be8107930 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -205,8 +205,8 @@ class CNumerics { su2double StrainMag_i, StrainMag_j; /*!< \brief Strain rate magnitude. */ su2double Dissipation_i, Dissipation_j; /*!< \brief Dissipation. */ su2double Dissipation_ij; - su2double roughness_i, /*!< \brief Roughness of the wall nearest to point i. */ - roughness_j; /*!< \brief Roughness of the wall nearest to point j. */ + su2double roughness_i = 0.0, /*!< \brief Roughness of the wall nearest to point i. */ + roughness_j = 0.0; /*!< \brief Roughness of the wall nearest to point j. */ su2double *l, *m; diff --git a/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp index 5775045ade6c..c172e545fec0 100644 --- a/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp @@ -71,7 +71,7 @@ void CParaviewXMLFileWriter::Write_Data(){ char str_buf[255]; OpenMPIFile(); - + dataOffset = 0; /*--- Communicate the number of total points that will be @@ -295,7 +295,7 @@ void CParaviewXMLFileWriter::Write_Data(){ } } - WriteDataArray(dataBufferFloat.data(), VTKDatatype::FLOAT32, myPoint*NCOORDS, GlobalPoint*NCOORDS, + WriteDataArray(dataBufferFloat.data(), VTKDatatype::FLOAT32, myPoint*NCOORDS, GlobalPoint*NCOORDS, dataSorter->GetnPointCumulative(rank)*NCOORDS); VarCounter++; @@ -336,23 +336,21 @@ void CParaviewXMLFileWriter::WriteDataArray(void* data, VTKDatatype type, unsign /*--- Compute the size of the data to write in bytes ---*/ - int byteSize; - byteSize = arraySize*typeSize; + size_t byteSize = arraySize*typeSize; /*--- The total data size ---*/ - unsigned long totalByteSize; - totalByteSize = globalSize*typeSize; + size_t totalByteSize = globalSize*typeSize; /*--- Only the master node writes the total size in bytes as unsigned long in front of the array data ---*/ - - if (!WriteMPIBinaryData(&totalByteSize, sizeof(unsigned long), MASTER_NODE)){ + + if (!WriteMPIBinaryData(&totalByteSize, sizeof(size_t), MASTER_NODE)){ SU2_MPI::Error("Writing array size failed", CURRENT_FUNCTION); } - + /*--- Collectively write all the data ---*/ - + if (!WriteMPIBinaryDataAll(data, byteSize, totalByteSize, offset*typeSize)){ - SU2_MPI::Error("Writing data array failed", CURRENT_FUNCTION); + SU2_MPI::Error("Writing data array failed", CURRENT_FUNCTION); } } @@ -373,13 +371,13 @@ void CParaviewXMLFileWriter::AddDataArray(VTKDatatype type, string name, string offsetStr = ss.str(); std::string typeStr; - unsigned long typeSize = 0, totalByteSize; + unsigned long typeSize = 0; GetTypeInfo(type, typeStr, typeSize); /*--- Total data size ---*/ - totalByteSize = globalSize*typeSize; + size_t totalByteSize = globalSize*typeSize; /*--- Write the ASCII XML header information for this array ---*/ @@ -389,6 +387,6 @@ void CParaviewXMLFileWriter::AddDataArray(VTKDatatype type, string name, string(" offset=") + offsetStr + string(" format=\"appended\"/>\n"), MASTER_NODE); - dataOffset += totalByteSize + sizeof(unsigned long); + dataOffset += totalByteSize + sizeof(size_t); }