Skip to content

Commit f7cb95d

Browse files
authored
Merge pull request #1055 from su2code/fix_windows_vtu_output
Fix vtu output on Windows
2 parents 41ffb84 + e71a956 commit f7cb95d

3 files changed

Lines changed: 15 additions & 17 deletions

File tree

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*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.*
1313

1414
- [ ] I am submitting my contribution to the develop branch.
15-
- [ ] My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags).
15+
- [ ] 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).
1616
- [ ] My contribution is commented and consistent with SU2 style.
1717
- [ ] I have added a test case that demonstrates my contribution, if necessary.
1818
- [ ] I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp) , if necessary.

SU2_CFD/include/numerics/CNumerics.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ class CNumerics {
205205
su2double StrainMag_i, StrainMag_j; /*!< \brief Strain rate magnitude. */
206206
su2double Dissipation_i, Dissipation_j; /*!< \brief Dissipation. */
207207
su2double Dissipation_ij;
208-
su2double roughness_i, /*!< \brief Roughness of the wall nearest to point i. */
209-
roughness_j; /*!< \brief Roughness of the wall nearest to point j. */
208+
su2double roughness_i = 0.0, /*!< \brief Roughness of the wall nearest to point i. */
209+
roughness_j = 0.0; /*!< \brief Roughness of the wall nearest to point j. */
210210

211211
su2double *l, *m;
212212

SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void CParaviewXMLFileWriter::Write_Data(){
7171
char str_buf[255];
7272

7373
OpenMPIFile();
74-
74+
7575
dataOffset = 0;
7676

7777
/*--- Communicate the number of total points that will be
@@ -295,7 +295,7 @@ void CParaviewXMLFileWriter::Write_Data(){
295295
}
296296
}
297297

298-
WriteDataArray(dataBufferFloat.data(), VTKDatatype::FLOAT32, myPoint*NCOORDS, GlobalPoint*NCOORDS,
298+
WriteDataArray(dataBufferFloat.data(), VTKDatatype::FLOAT32, myPoint*NCOORDS, GlobalPoint*NCOORDS,
299299
dataSorter->GetnPointCumulative(rank)*NCOORDS);
300300

301301
VarCounter++;
@@ -336,23 +336,21 @@ void CParaviewXMLFileWriter::WriteDataArray(void* data, VTKDatatype type, unsign
336336

337337
/*--- Compute the size of the data to write in bytes ---*/
338338

339-
int byteSize;
340-
byteSize = arraySize*typeSize;
339+
size_t byteSize = arraySize*typeSize;
341340

342341
/*--- The total data size ---*/
343-
unsigned long totalByteSize;
344-
totalByteSize = globalSize*typeSize;
342+
size_t totalByteSize = globalSize*typeSize;
345343

346344
/*--- Only the master node writes the total size in bytes as unsigned long in front of the array data ---*/
347-
348-
if (!WriteMPIBinaryData(&totalByteSize, sizeof(unsigned long), MASTER_NODE)){
345+
346+
if (!WriteMPIBinaryData(&totalByteSize, sizeof(size_t), MASTER_NODE)){
349347
SU2_MPI::Error("Writing array size failed", CURRENT_FUNCTION);
350348
}
351-
349+
352350
/*--- Collectively write all the data ---*/
353-
351+
354352
if (!WriteMPIBinaryDataAll(data, byteSize, totalByteSize, offset*typeSize)){
355-
SU2_MPI::Error("Writing data array failed", CURRENT_FUNCTION);
353+
SU2_MPI::Error("Writing data array failed", CURRENT_FUNCTION);
356354
}
357355
}
358356

@@ -373,13 +371,13 @@ void CParaviewXMLFileWriter::AddDataArray(VTKDatatype type, string name,
373371
string offsetStr = ss.str();
374372

375373
std::string typeStr;
376-
unsigned long typeSize = 0, totalByteSize;
374+
unsigned long typeSize = 0;
377375

378376
GetTypeInfo(type, typeStr, typeSize);
379377

380378
/*--- Total data size ---*/
381379

382-
totalByteSize = globalSize*typeSize;
380+
size_t totalByteSize = globalSize*typeSize;
383381

384382
/*--- Write the ASCII XML header information for this array ---*/
385383

@@ -389,6 +387,6 @@ void CParaviewXMLFileWriter::AddDataArray(VTKDatatype type, string name,
389387
string(" offset=") + offsetStr +
390388
string(" format=\"appended\"/>\n"), MASTER_NODE);
391389

392-
dataOffset += totalByteSize + sizeof(unsigned long);
390+
dataOffset += totalByteSize + sizeof(size_t);
393391

394392
}

0 commit comments

Comments
 (0)