diff --git a/src/mesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C b/src/mesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C index cec7ec75b7e2704bb8ccdabcbbc2c401d6a7bd5c..ed340fd7209febe3d87db3aeb6f808ffd7408221 100644 --- a/src/mesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C +++ b/src/mesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C @@ -1014,7 +1014,7 @@ Foam::backgroundMeshDecomposition::distribute newCellI = cellSearch.findNearestCell(v); - Pout<< newCellI << endl; + // Pout<< newCellI << endl; } newCellVertices[newCellI].append(v); diff --git a/src/mesh/conformalVoronoiMesh/initialPointsMethod/pointFile/pointFile.C b/src/mesh/conformalVoronoiMesh/initialPointsMethod/pointFile/pointFile.C index 81d001618a5b2392077e10c5024b3ec26befd864..fe56a5aa14d2aed473f1bd058db153490059c659 100644 --- a/src/mesh/conformalVoronoiMesh/initialPointsMethod/pointFile/pointFile.C +++ b/src/mesh/conformalVoronoiMesh/initialPointsMethod/pointFile/pointFile.C @@ -74,42 +74,55 @@ std::list<Vb::Point> pointFile::initialPoints() const << exit(FatalError) << endl; } - // Filter the points to be only those on this processor - boolList procPt(cvMesh_.positionOnThisProc(points)); - if (Pstream::parRun()) { - List<boolList> allProcPt(Pstream::nProcs()); + if (points.path().find("processor") != string::npos) + { + // Testing filePath to see if the file originated in a processor + // directory, if so, assume that the points in each processor file + // are unique. They are unlikely to belong on the current + // processor as the background mesh is unlikely to be the same. - allProcPt[Pstream::myProcNo()] = procPt; + cvMesh_.decomposition().distributePoints(points); + } + else + { + // Otherwise, this is assumed to be points covering the whole + // domain, so filter the points to be only those on this processor + boolList procPt(cvMesh_.positionOnThisProc(points)); - Pstream::gatherList(allProcPt); + List<boolList> allProcPt(Pstream::nProcs()); - Pstream::scatterList(allProcPt); + allProcPt[Pstream::myProcNo()] = procPt; - forAll(procPt, ptI) - { - bool foundAlready = false; + Pstream::gatherList(allProcPt); + + Pstream::scatterList(allProcPt); - forAll(allProcPt, procI) + forAll(procPt, ptI) { - // If a processor with a lower index has found this point to - // insert already, defer to it and don't insert. - if (foundAlready) - { - allProcPt[procI][ptI] = false; - } - else if (allProcPt[procI][ptI]) + bool foundAlready = false; + + forAll(allProcPt, procI) { - foundAlready = true; + // If a processor with a lower index has found this point + // to insert already, defer to it and don't insert. + if (foundAlready) + { + allProcPt[procI][ptI] = false; + } + else if (allProcPt[procI][ptI]) + { + foundAlready = true; + } } } - } - procPt = allProcPt[Pstream::myProcNo()]; - } + procPt = allProcPt[Pstream::myProcNo()]; - inplaceSubset(procPt, points); + inplaceSubset(procPt, points); + } + } std::list<Vb::Point> initialPoints;