Commit 94934018 authored by graham's avatar graham
Browse files

ENH: Allow restart from processor internalDelaunay vertices.

parent 90427eb2
......@@ -1014,7 +1014,7 @@ Foam::backgroundMeshDecomposition::distribute
newCellI = cellSearch.findNearestCell(v);
Pout<< newCellI << endl;
// Pout<< newCellI << endl;
}
newCellVertices[newCellI].append(v);
......
......@@ -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;
......
Supports Markdown
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