diff --git a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C index 6d1286a1b6a577c68f0c9a4f67652b5241bc07a0..ee0ea7c5fda6863f436d0a3abfd772c7a3dbbf0d 100644 --- a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C +++ b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C @@ -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 - ( - patchNames[p], - patchSizes[p], - patchStarts[p], - p, - pMesh.boundaryMesh() - ); + if (patchTypes[p] == processorPolyPatch::typeName) + { + patches[p] = new processorPolyPatch + ( + patchNames[p], + patchSizes[p], + patchStarts[p], + p, + 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; diff --git a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C index bc2d0f0043f8c269d62f974df73c8e121c6c409d..174c07d9b0852d7f9be0fe6677d8be9cb82a1f91 100644 --- a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C +++ b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C @@ -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);