ENH: Allow restart from processor internalDelaunay vertices.

This commit is contained in:
graham
2011-06-21 16:41:18 +01:00
parent 90427eb2f3
commit 949340181f
2 changed files with 40 additions and 27 deletions

View File

@ -1014,7 +1014,7 @@ Foam::backgroundMeshDecomposition::distribute
newCellI = cellSearch.findNearestCell(v);
Pout<< newCellI << endl;
// Pout<< newCellI << endl;
}
newCellVertices[newCellI].append(v);

View File

@ -74,43 +74,56 @@ 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());
allProcPt[Pstream::myProcNo()] = procPt;
Pstream::gatherList(allProcPt);
Pstream::scatterList(allProcPt);
forAll(procPt, ptI)
if (points.path().find("processor") != string::npos)
{
bool foundAlready = false;
// 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.
forAll(allProcPt, procI)
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));
List<boolList> allProcPt(Pstream::nProcs());
allProcPt[Pstream::myProcNo()] = procPt;
Pstream::gatherList(allProcPt);
Pstream::scatterList(allProcPt);
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)
bool foundAlready = false;
forAll(allProcPt, procI)
{
allProcPt[procI][ptI] = false;
}
else if (allProcPt[procI][ptI])
{
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()];
inplaceSubset(procPt, points);
}
procPt = allProcPt[Pstream::myProcNo()];
}
inplaceSubset(procPt, points);
std::list<Vb::Point> initialPoints;
Field<bool> insidePoints = cvMesh_.geometryToConformTo().wellInside