From 35e0a53d62f3098b627f1d8d48e99d9b707a96dd Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Thu, 8 Nov 2018 19:32:34 +0000 Subject: [PATCH] Bugfix: Reading of zone meshes in parallel; load balancing --- .../meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/foam/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C b/src/foam/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C index 0323fdaed..3172453da 100644 --- a/src/foam/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C +++ b/src/foam/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C @@ -164,24 +164,28 @@ ZoneMesh::ZoneMesh mesh_(mesh), zoneMapPtr_(NULL) { - PtrList& zones = *this; - PtrList zoneEntries(is); - zones.setSize(zoneEntries.size()); - forAll(zones, zoneI) + if (!zoneEntries.empty()) { - zones.set - ( - zoneI, - ZoneType::New + PtrList& zones = *this; + + zones.setSize(zoneEntries.size()); + + forAll(zones, zoneI) + { + zones.set ( - zoneEntries[zoneI].keyword(), - zoneEntries[zoneI].dict(), zoneI, - *this - ) - ); + ZoneType::New + ( + zoneEntries[zoneI].keyword(), + zoneEntries[zoneI].dict(), + zoneI, + *this + ) + ); + } } }