diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/convertLagrangian.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/convertLagrangian.H index 143f9f226f..101debd6a0 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/convertLagrangian.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/convertLagrangian.H @@ -67,10 +67,10 @@ if (doLagrangian) } } - forAllConstIters(theseCloudFields, fieldIter) + // Field order may differ on individual processors, so sort by name + for (const word& fieldName : theseCloudFields.sortedToc()) { - const word& fieldName = fieldIter.key(); - const word& fieldType = fieldIter.val(); + const word& fieldType = theseCloudFields[fieldName]; IOobject fieldObject ( @@ -88,9 +88,13 @@ if (doLagrangian) // but that combination does not work. // So check the header and sync globally + const bool parRun = Pstream::parRun(); + Pstream::parRun() = false; + fieldExists = fieldObject.typeHeaderOk>(false); + Pstream::parRun() = parRun; reduce(fieldExists, orOp()); }