ENH: Patches for mesh quality eval are now proc patches.

Forcing empty patches to write in parallel.
This commit is contained in:
graham
2011-04-21 18:02:40 +01:00
parent a3417e4596
commit a803f9ea2c
2 changed files with 35 additions and 21 deletions

View File

@ -1421,7 +1421,6 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
timeCheck("Start of checkPolyMeshQuality");
Info<< nl << "Creating polyMesh to assess quality" << endl;
Info<< nl << "THIS NEEDS TO USE PARALLEL EVALUATION OF QUALITY" << endl;
createFacesOwnerNeighbourAndPatches
(
@ -1458,21 +1457,38 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
List<polyPatch*> patches(patchStarts.size());
forAll (patches, p)
forAll(patches, p)
{
patches[p] = new polyPatch
if (patchTypes[p] == processorPolyPatch::typeName)
{
patches[p] = new processorPolyPatch
(
patchNames[p],
patchSizes[p],
patchStarts[p],
p,
pMesh.boundaryMesh()
pMesh.boundaryMesh(),
Pstream::myProcNo(),
procNeighbours[p]
);
}
else
{
patches[p] = polyPatch::New
(
patchTypes[p],
patchNames[p],
patchSizes[p],
patchStarts[p],
p,
pMesh.boundaryMesh()
).ptr();
}
}
pMesh.addPatches(patches);
// mesh.overrideCellCentres(cellCentres);
// pMesh.overrideCellCentres(cellCentres);
timeCheck("polyMesh created, checking quality");
@ -2018,7 +2034,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
procNeighbours,
patchFaces,
patchOwners,
false
includeEmptyPatches
);
}
@ -2161,9 +2177,6 @@ void Foam::conformalVoronoiMesh::sortProcPatches
return;
}
Info<< "PROC PATCH SORT IS WRONG, OWNER PATCH CELL INDEX IS NOT UNIQUE"
<< endl;
forAll(patchSortingIndices, patchI)
{
faceList& faces = patchFaces[patchI];
@ -2290,6 +2303,12 @@ void Foam::conformalVoronoiMesh::addPatches
bool includeEmptyPatches
) const
{
// Always write out all patches in parallel
if (Pstream::parRun())
{
includeEmptyPatches = true;
}
label nTotalPatches = patchNames.size();
label nValidPatches = 0;

View File

@ -360,11 +360,7 @@ void Foam::conformalVoronoiMesh::writeMesh
}
}
Info<< "addPatches(patches, false); FALSE REQUIRED TO AVOID MEMORY CRASH"
<< endl;
// mesh.addPatches(patches);
mesh.addPatches(patches, false);
mesh.addPatches(patches);
if (!mesh.write())
{
@ -394,7 +390,6 @@ void Foam::conformalVoronoiMesh::writeMesh
// cellCs.write();
Info<< "DISABLED WRITING OF CELL SIZE AND PROTRUSION SET" << endl;
// writeCellSizes(mesh);