diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C index 1a01cb6564..a73b46621e 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C @@ -651,7 +651,7 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show) labelList nZones(pbMesh.size(), 0); // Per global zone number the average face centre position - DynamicList zoneCentre(pbMesh.size()); + List > zoneCentre(pbMesh.size()); // Loop through all patches to determine zones, and centre of each zone @@ -693,31 +693,28 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show) labelList zoneNFaces(pZones.nZones(), 0); - // Save start of information for current patch - label patchStart = zoneCentre.size(); - // Create storage for additional zone centres forAll(zoneNFaces, zoneI) { - zoneCentre.append(vector::zero); + zoneCentre[patchI].append(vector::zero); } // Do averaging per individual zone forAll(pp, faceI) { label zoneI = pZones[faceI]; - zoneCentre[patchStart+zoneI] += pp[faceI].centre(pp.points()); + zoneCentre[patchI][zoneI] += pp[faceI].centre(pp.points()); zoneNFaces[zoneI]++; } - for (label i=0; i