Skip to content
Snippets Groups Projects
Commit ccd2321a authored by andy's avatar andy
Browse files

BUG: Corrected parallel behaviour of cloud FacePostProcessing model

parent d88d92ed
Branches
Tags
No related merge requests found
...@@ -66,10 +66,9 @@ void Foam::FacePostProcessing<CloudType>::write() ...@@ -66,10 +66,9 @@ void Foam::FacePostProcessing<CloudType>::write()
const label procI = Pstream::myProcNo(); const label procI = Pstream::myProcNo();
scalarListList allProcMass(Pstream::nProcs()); scalarListList allProcMass(Pstream::nProcs());
allProcMass[procI].setSize(massTotal_.size());
allProcMass[procI] = massTotal_; allProcMass[procI] = massTotal_;
Pstream::gatherList(allProcMass); Pstream::gatherList(allProcMass);
scalarList allMass scalarField allMass
( (
ListListOps::combine<scalarList> ListListOps::combine<scalarList>
( (
...@@ -78,10 +77,9 @@ void Foam::FacePostProcessing<CloudType>::write() ...@@ -78,10 +77,9 @@ void Foam::FacePostProcessing<CloudType>::write()
); );
scalarListList allProcMassFlux(Pstream::nProcs()); scalarListList allProcMassFlux(Pstream::nProcs());
allProcMassFlux[procI].setSize(massFlux_.size());
allProcMassFlux[procI] = massFlux_; allProcMassFlux[procI] = massFlux_;
Pstream::gatherList(allProcMassFlux); Pstream::gatherList(allProcMassFlux);
scalarList allMassFlux scalarField allMassFlux
( (
ListListOps::combine<scalarList> ListListOps::combine<scalarList>
( (
...@@ -109,16 +107,8 @@ void Foam::FacePostProcessing<CloudType>::write() ...@@ -109,16 +107,8 @@ void Foam::FacePostProcessing<CloudType>::write()
pointField uniquePoints(mesh.points(), uniqueMeshPointLabels); pointField uniquePoints(mesh.points(), uniqueMeshPointLabels);
List<pointField> allProcPoints(Pstream::nProcs()); List<pointField> allProcPoints(Pstream::nProcs());
allProcPoints[procI].setSize(uniquePoints.size());
allProcPoints[procI] = uniquePoints; allProcPoints[procI] = uniquePoints;
Pstream::gatherList(allProcPoints); Pstream::gatherList(allProcPoints);
pointField allPoints
(
ListListOps::combine<pointField>
(
allProcPoints, accessOp<pointField>()
)
);
faceList faces(fZone_().localFaces()); faceList faces(fZone_().localFaces());
forAll(faces, i) forAll(faces, i)
...@@ -126,20 +116,27 @@ void Foam::FacePostProcessing<CloudType>::write() ...@@ -126,20 +116,27 @@ void Foam::FacePostProcessing<CloudType>::write()
inplaceRenumber(pointToGlobal, faces[i]); inplaceRenumber(pointToGlobal, faces[i]);
} }
List<faceList> allProcFaces(Pstream::nProcs()); List<faceList> allProcFaces(Pstream::nProcs());
allProcFaces[procI].setSize(faces.size());
allProcFaces[procI] = faces; allProcFaces[procI] = faces;
Pstream::gatherList(allProcFaces); Pstream::gatherList(allProcFaces);
faceList allFaces
(
ListListOps::combine<faceList>
(
allProcFaces, accessOp<faceList>()
)
);
if (Pstream::master()) if (Pstream::master())
{ {
pointField allPoints
(
ListListOps::combine<pointField>
(
allProcPoints, accessOp<pointField>()
)
);
faceList allFaces
(
ListListOps::combine<faceList>
(
allProcFaces, accessOp<faceList>()
)
);
fileName outputDir = mesh.time().path(); fileName outputDir = mesh.time().path();
if (Pstream::parRun()) if (Pstream::parRun())
...@@ -165,7 +162,7 @@ void Foam::FacePostProcessing<CloudType>::write() ...@@ -165,7 +162,7 @@ void Foam::FacePostProcessing<CloudType>::write()
allPoints, allPoints,
allFaces, allFaces,
"massTotal", "massTotal",
massTotal_, allMass,
false false
); );
writer->write writer->write
...@@ -175,7 +172,7 @@ void Foam::FacePostProcessing<CloudType>::write() ...@@ -175,7 +172,7 @@ void Foam::FacePostProcessing<CloudType>::write()
allPoints, allPoints,
allFaces, allFaces,
"massFlux", "massFlux",
massFlux_, allMassFlux,
false false
); );
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment