Skip to content
6 changes: 3 additions & 3 deletions Common/src/geometry/CPhysicalGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9574,17 +9574,17 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) {
points which are distributed throughout the file in blocks of nVar_Restart data. ---*/

int *blocklen = new int[GetnPointDomain()];
int *displace = new int[GetnPointDomain()];
MPI_Aint *displace = new MPI_Aint[GetnPointDomain()];

counter = 0;
for (iPoint_Global = 0; iPoint_Global < GetGlobal_nPointDomain(); iPoint_Global++ ) {
if (GetGlobal_to_Local_Point(iPoint_Global) > -1) {
blocklen[counter] = nFields;
displace[counter] = iPoint_Global*nFields;
displace[counter] = iPoint_Global*nFields*sizeof(passivedouble);
counter++;
}
}
MPI_Type_indexed(GetnPointDomain(), blocklen, displace, MPI_DOUBLE, &filetype);
MPI_Type_create_hindexed(GetnPointDomain(), blocklen, displace, MPI_DOUBLE, &filetype);
MPI_Type_commit(&filetype);

/*--- Set the view for the MPI file write, i.e., describe the location in
Expand Down
14 changes: 6 additions & 8 deletions SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ void CParaviewXMLFileWriter::Write_Data(){
*/

if (!bigEndian){
WriteMPIString("<VTKFile type=\"UnstructuredGrid\" version=\"1.0\" byte_order=\"LittleEndian\">\n", MASTER_NODE);
WriteMPIString("<VTKFile type=\"UnstructuredGrid\" version=\"1.0\" byte_order=\"LittleEndian\" header_type=\"UInt64\">\n", MASTER_NODE);
} else {
WriteMPIString("<VTKFile type=\"UnstructuredGrid\" version=\"1.0\" byte_order=\"BigEndian\">\n", MASTER_NODE);
WriteMPIString("<VTKFile type=\"UnstructuredGrid\" version=\"1.0\" byte_order=\"BigEndian\" header_type=\"UInt64\">\n", MASTER_NODE);
}

WriteMPIString("<UnstructuredGrid>\n", MASTER_NODE);
Expand Down Expand Up @@ -329,25 +329,23 @@ void CParaviewXMLFileWriter::Write_Data(){
void CParaviewXMLFileWriter::WriteDataArray(void* data, VTKDatatype type, unsigned long arraySize,
unsigned long globalSize, unsigned long offset){


int totalByteSize, byteSize;

std::string typeStr;
unsigned long typeSize = 0;

GetTypeInfo(type, typeStr, typeSize);

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

int byteSize;
byteSize = arraySize*typeSize;

/*--- The total data size ---*/

unsigned long totalByteSize;
totalByteSize = globalSize*typeSize;

/*--- Only the master node writes the total size in bytes as int32 in front of the array data ---*/

if (!WriteMPIBinaryData(&totalByteSize, sizeof(int), MASTER_NODE)){
if (!WriteMPIBinaryData(&totalByteSize, sizeof(unsigned long), MASTER_NODE)){
SU2_MPI::Error("Writing array size failed", CURRENT_FUNCTION);
}

Expand Down Expand Up @@ -391,6 +389,6 @@ void CParaviewXMLFileWriter::AddDataArray(VTKDatatype type, string name,
string(" offset=") + offsetStr +
string(" format=\"appended\"/>\n"), MASTER_NODE);

dataOffset += totalByteSize + sizeof(int);
dataOffset += totalByteSize + sizeof(unsigned long);

}
6 changes: 3 additions & 3 deletions SU2_CFD/src/solvers/CSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3831,16 +3831,16 @@ void CSolver::Read_SU2_Restart_Binary(CGeometry *geometry, CConfig *config, stri
points which are distributed throughout the file in blocks of nVar_Restart data. ---*/

int *blocklen = new int[geometry->GetnPointDomain()];
int *displace = new int[geometry->GetnPointDomain()];
MPI_Aint *displace = new MPI_Aint[geometry->GetnPointDomain()];
int counter = 0;
for (iPoint_Global = 0; iPoint_Global < geometry->GetGlobal_nPointDomain(); iPoint_Global++ ) {
if (geometry->GetGlobal_to_Local_Point(iPoint_Global) > -1) {
blocklen[counter] = nFields;
displace[counter] = iPoint_Global*nFields;
displace[counter] = iPoint_Global*nFields*sizeof(passivedouble);
counter++;
}
}
MPI_Type_indexed(geometry->GetnPointDomain(), blocklen, displace, MPI_DOUBLE, &filetype);
MPI_Type_create_hindexed(geometry->GetnPointDomain(), blocklen, displace, MPI_DOUBLE, &filetype);
MPI_Type_commit(&filetype);

/*--- Set the view for the MPI file write, i.e., describe the location in
Expand Down