From ccd2321a9093ff0b216c825c7960bd332e8e8dc8 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 20 May 2011 18:17:02 +0100 Subject: [PATCH] BUG: Corrected parallel behaviour of cloud FacePostProcessing model --- .../FacePostProcessing/FacePostProcessing.C | 43 +++++++++---------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C index b3cdad013e..024f439666 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C @@ -66,10 +66,9 @@ void Foam::FacePostProcessing::write() const label procI = Pstream::myProcNo(); scalarListList allProcMass(Pstream::nProcs()); - allProcMass[procI].setSize(massTotal_.size()); allProcMass[procI] = massTotal_; Pstream::gatherList(allProcMass); - scalarList allMass + scalarField allMass ( ListListOps::combine ( @@ -78,10 +77,9 @@ void Foam::FacePostProcessing::write() ); scalarListList allProcMassFlux(Pstream::nProcs()); - allProcMassFlux[procI].setSize(massFlux_.size()); allProcMassFlux[procI] = massFlux_; Pstream::gatherList(allProcMassFlux); - scalarList allMassFlux + scalarField allMassFlux ( ListListOps::combine ( @@ -109,16 +107,8 @@ void Foam::FacePostProcessing::write() pointField uniquePoints(mesh.points(), uniqueMeshPointLabels); List allProcPoints(Pstream::nProcs()); - allProcPoints[procI].setSize(uniquePoints.size()); allProcPoints[procI] = uniquePoints; Pstream::gatherList(allProcPoints); - pointField allPoints - ( - ListListOps::combine - ( - allProcPoints, accessOp() - ) - ); faceList faces(fZone_().localFaces()); forAll(faces, i) @@ -126,20 +116,27 @@ void Foam::FacePostProcessing::write() inplaceRenumber(pointToGlobal, faces[i]); } List allProcFaces(Pstream::nProcs()); - allProcFaces[procI].setSize(faces.size()); allProcFaces[procI] = faces; Pstream::gatherList(allProcFaces); - faceList allFaces - ( - ListListOps::combine - ( - allProcFaces, accessOp() - ) - ); - if (Pstream::master()) { + pointField allPoints + ( + ListListOps::combine + ( + allProcPoints, accessOp() + ) + ); + + faceList allFaces + ( + ListListOps::combine + ( + allProcFaces, accessOp() + ) + ); + fileName outputDir = mesh.time().path(); if (Pstream::parRun()) @@ -165,7 +162,7 @@ void Foam::FacePostProcessing::write() allPoints, allFaces, "massTotal", - massTotal_, + allMass, false ); writer->write @@ -175,7 +172,7 @@ void Foam::FacePostProcessing::write() allPoints, allFaces, "massFlux", - massFlux_, + allMassFlux, false ); }