BUG: foamToVTK patch/proc ids missing if there are no volume fields

This commit is contained in:
Mark Olesen 2021-09-22 21:21:11 +02:00
parent fcd7423fa8
commit 8628d4216c

View File

@ -264,7 +264,7 @@ Description
// Begin CellData
if (internalWriter)
{
// Optionally with cellID and procID fields
// Optionally with (cellID, procID) fields
internalWriter->beginCellData
(
(withMeshIds ? 1 + (internalWriter->parallel() ? 1 : 0) : 0)
@ -278,20 +278,21 @@ Description
}
}
if (nVolFields)
if (nVolFields || withMeshIds)
{
for (vtk::patchWriter& writer : patchWriters)
{
// Optionally with patchID field
// Optionally with (patchID, procID) fields
writer.beginCellData
(
(withMeshIds ? 1 : 0)
(withMeshIds ? 2 : 0)
+ nVolFields
);
if (withMeshIds)
{
writer.writePatchIDs();
writer.writeProcIDs();
}
}
}