100 label diff = neighbour[faceI] - owner[faceI];
118 Pout<<
"Determining cell order:" <<
endl;
122 label nRegions =
max(cellToRegion)+1;
128 forAll(regionToCells, regionI)
130 Pout<<
" region " << regionI <<
" starts at " << cellI <<
endl;
134 subsetter.setLargeCellSubset(cellToRegion, regionI);
135 const fvMesh& subMesh = subsetter.subMesh();
138 const labelList& cellMap = subsetter.cellMap();
142 cellOrder[cellI++] = cellMap[subCellOrder[i]];
160 Pout<<
"Determining face order:" <<
endl;
168 label prevRegion = -1;
170 forAll (cellOrder, newCellI)
172 label oldCellI = cellOrder[newCellI];
174 if (cellToRegion[oldCellI] != prevRegion)
176 prevRegion = cellToRegion[oldCellI];
177 Pout<<
" region " << prevRegion <<
" internal faces start at "
181 const cell& cFaces = mesh.
cells()[oldCellI];
187 label faceI = cFaces[i];
192 label nbrCellI = reverseCellOrder[mesh.
faceNeighbour()[faceI]];
193 if (nbrCellI == newCellI)
195 nbrCellI = reverseCellOrder[mesh.
faceOwner()[faceI]];
198 if (cellToRegion[oldCellI] != cellToRegion[cellOrder[nbrCellI]])
203 else if (newCellI < nbrCellI)
227 oldToNewFace[cFaces[nbr.indices()[i]]] = newFaceI++;
233 label nRegions =
max(cellToRegion)+1;
240 label ownRegion = cellToRegion[mesh.
faceOwner()[faceI]];
243 if (ownRegion != neiRegion)
246 min(ownRegion, neiRegion)*nRegions
247 +
max(ownRegion, neiRegion);
256 label key = sortKey[i];
265 Pout<<
" faces inbetween region " << key/nRegions
266 <<
" and " << key%nRegions
267 <<
" start at " << newFaceI <<
endl;
271 oldToNewFace[sortKey.indices()[i]] = newFaceI++;
276 for (label faceI = newFaceI; faceI < mesh.
nFaces(); faceI++)
278 oldToNewFace[faceI] = faceI;
283 forAll(oldToNewFace, faceI)
285 if (oldToNewFace[faceI] == -1)
289 "polyDualMesh::getFaceOrder"
290 "(const labelList&, const labelList&, const label) const"
291 ) <<
"Did not determine new position"
292 <<
" for face " << faceI
334 forAll(newNeighbour, faceI)
336 label own = newOwner[faceI];
337 label nei = newNeighbour[faceI];
341 newFaces[faceI] = newFaces[faceI].reverseFace();
342 Swap(newOwner[faceI], newNeighbour[faceI]);
353 patchSizes[patchI] = patches[patchI].
size();
354 patchStarts[patchI] = patches[patchI].start();
355 oldPatchNMeshPoints[patchI] = patches[patchI].nPoints();
407 int main(
int argc,
char *argv[])
419 runTime.functionObjects().off();
427 runTime.setTime(Times[
startTime], startTime);
435 Info<<
"Ordering cells into regions (using decomposition);"
436 <<
" ordering faces into region-internal and region-external." <<
nl
443 Info<<
"Ordering points into internal and boundary points." <<
nl
451 Info<<
"Writing renumber maps (new to old) to polyMesh." <<
nl
460 <<
"Band before renumbering: "
469 "cellProcAddressing",
482 "faceProcAddressing",
483 mesh.facesInstance(),
494 "pointProcAddressing",
495 mesh.pointsInstance(),
506 "boundaryProcAddressing",
507 mesh.pointsInstance(),
579 labelList cellToRegion(decomposePtr().decompose(mesh.cellCentres()));
596 zeroGradientFvPatchScalarField::typeName
599 forAll(cellToRegion, cellI)
601 cellDist[cellI] = cellToRegion[cellI];
606 Info<<
nl <<
"Written decomposition as volScalarField to "
607 << cellDist.name() <<
" for use in postprocessing."
613 labelList cellOrder(regionBandCompression(mesh, cellToRegion));
632 map = reorderMesh(mesh, cellOrder, faceOrder);
646 map = meshMod.changeMesh
657 mesh.updateMesh(map);
660 if (cellProcAddressing.headerOk())
662 Info<<
"Renumbering processor cell decomposition map "
663 << cellProcAddressing.name() <<
endl;
670 if (faceProcAddressing.headerOk())
672 Info<<
"Renumbering processor face decomposition map "
673 << faceProcAddressing.name() <<
endl;
680 if (pointProcAddressing.headerOk())
682 Info<<
"Renumbering processor point decomposition map "
683 << pointProcAddressing.name() <<
endl;
693 if (map().hasMotionPoints())
695 mesh.movePoints(map().preMotionPoints());
699 band = getBand(mesh.faceOwner(), mesh.faceNeighbour());
701 Info<<
"Band after renumbering: "
718 mesh.nInternalPoints(),
729 mesh.nInternalEdges(),
734 mesh.nInternal0Edges(),
739 mesh.nInternal1Edges(),
744 <<
" total : " << nTotPoints <<
nl
745 <<
" internal: " << nTotIntPoints <<
nl
746 <<
" boundary: " << nTotPoints-nTotIntPoints <<
nl
748 <<
" total : " << nTotEdges <<
nl
749 <<
" internal: " << nTotIntEdges <<
nl
750 <<
" internal using 0 boundary points: "
751 << nTotInt0Edges <<
nl
752 <<
" internal using 1 boundary points: "
753 << nTotInt1Edges-nTotInt0Edges <<
nl
754 <<
" internal using 2 boundary points: "
755 << nTotIntEdges-nTotInt1Edges <<
nl
756 <<
" boundary: " << nTotEdges-nTotIntEdges <<
nl
763 mesh.setInstance(oldInstance);
766 Info<<
"Writing mesh to " << mesh.facesInstance() <<
endl;
769 if (cellProcAddressing.headerOk())
771 cellProcAddressing.instance() = mesh.facesInstance();
772 cellProcAddressing.
write();
774 if (faceProcAddressing.headerOk())
776 faceProcAddressing.instance() = mesh.facesInstance();
777 faceProcAddressing.
write();
779 if (pointProcAddressing.headerOk())
781 pointProcAddressing.instance() = mesh.facesInstance();
782 pointProcAddressing.
write();
784 if (boundaryProcAddressing.headerOk())
786 boundaryProcAddressing.instance() = mesh.facesInstance();
787 boundaryProcAddressing.
write();
798 mesh.facesInstance(),
812 mesh.facesInstance(),
826 mesh.facesInstance(),