33 #include "indirectPrimitivePatch.H"
67 const face&
f = mesh_.faces()[faceI];
68 label zoneID = mesh_.faceZones().whichZone(faceI);
69 bool zoneFlip =
false;
73 const faceZone& fZone = mesh_.faceZones()[zoneID];
83 mesh_.faceOwner()[faceI],
96 if (mesh_.isInternalFace(faceI))
101 <<
"No neighbour patch for internal face " << faceI
102 <<
" fc:" << mesh_.faceCentres()[faceI]
106 bool reverseFlip =
false;
109 reverseFlip = !zoneFlip;
117 mesh_.faceNeighbour()[faceI],
183 if (debug&OBJINTERSECTIONS)
190 mesh_.time().path()/
timeName()/
"intersections.obj"
194 Pout<<
"getIntersections : Writing surface intersections to file "
195 << str().name() <<
nl <<
endl;
199 globalRegion1.
setSize(mesh_.nFaces());
201 globalRegion2.
setSize(mesh_.nFaces());
234 surfaces_.findNearestIntersection
252 label faceI = testFaces[i];
254 if (hit1[i].hit() && hit2[i].hit())
258 str().write(
linePointRef(start[i], hit1[i].rawPoint()));
267 globalRegion1[faceI] =
268 surfaces_.globalRegion(surface1[i], region1[i]);
269 globalRegion2[faceI] =
270 surfaces_.globalRegion(surface2[i], region2[i]);
272 if (globalRegion1[faceI] == -1 || globalRegion2[faceI] == -1)
368 const labelList testFaces(intersectedFaces());
374 surfaceZonesInfo::getUnnamedSurfaces(surfaces_.surfZones()),
383 syncTools::swapBoundaryCellList(mesh_, cellToZone, neiCellZone);
396 ownPatch.
setSize(mesh_.nFaces());
398 neiPatch.
setSize(mesh_.nFaces());
402 label faceI = testFaces[i];
404 if (globalRegion1[faceI] != -1 || globalRegion2[faceI] != -1)
406 label ownMasterPatch = -1;
407 if (globalRegion1[faceI] != -1)
409 ownMasterPatch = globalToMasterPatch[globalRegion1[faceI]];
411 label neiMasterPatch = -1;
412 if (globalRegion2[faceI] != -1)
414 neiMasterPatch = globalToMasterPatch[globalRegion2[faceI]];
418 label ownZone = cellToZone[mesh_.faceOwner()[faceI]];
421 if (mesh_.isInternalFace(faceI))
423 neiZone = cellToZone[mesh_.faceNeighbour()[faceI]];
427 neiZone = neiCellZone[faceI-mesh_.nInternalFaces()];
435 ownPatch[faceI] = ownMasterPatch;
436 neiPatch[faceI] = neiMasterPatch;
439 else if (neiZone == -2)
441 ownPatch[faceI] = ownMasterPatch;
442 neiPatch[faceI] = neiMasterPatch;
444 else if (ownZone == neiZone)
447 ownPatch[faceI] = ownMasterPatch;
448 neiPatch[faceI] = neiMasterPatch;
468 const bool allowBoundary,
480 const word& faceZoneName = surfZones[surfI].faceZoneName();
482 if (faceZoneName.size())
487 const faceZone& fZone = fZones[zoneI];
490 label globalRegionI = surfaces_.globalRegion(surfI, 0);
493 globalToMasterPatch[globalRegionI],
494 globalToSlavePatch[globalRegionI]
497 Info<<
"For zone " << fZone.
name() <<
" found patches "
498 << mesh_.boundaryMesh()[zPatches[0]].name() <<
" and "
499 << mesh_.boundaryMesh()[zPatches[1]].name()
504 label faceI = fZone[i];
506 if (allowBoundary || mesh_.isInternalFace(faceI))
514 if (!bafflePatch.insert(faceI,
patches))
518 <<
" fc:" << mesh_.faceCentres()[faceI]
519 <<
" in zone " << fZone.
name()
520 <<
" is in multiple zones!"
539 ownPatch.
size() != mesh_.nFaces()
540 || neiPatch.
size() != mesh_.nFaces()
545 <<
" ownPatch:" << ownPatch.
size()
546 <<
" neiPatch:" << neiPatch.
size()
547 <<
". Should be number of faces:" << mesh_.nFaces()
558 forAll(syncedOwnPatch, faceI)
562 (ownPatch[faceI] == -1 && syncedOwnPatch[faceI] != -1)
563 || (neiPatch[faceI] == -1 && syncedNeiPatch[faceI] != -1)
567 <<
"Non synchronised at face:" << faceI
568 <<
" on patch:" << mesh_.boundaryMesh().whichPatch(faceI)
569 <<
" fc:" << mesh_.faceCentres()[faceI] <<
endl
570 <<
"ownPatch:" << ownPatch[faceI]
571 <<
" syncedOwnPatch:" << syncedOwnPatch[faceI]
572 <<
" neiPatch:" << neiPatch[faceI]
573 <<
" syncedNeiPatch:" << syncedNeiPatch[faceI]
584 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
586 if (ownPatch[faceI] != -1)
606 label coupledPatchI = -1;
610 && !refCast<const coupledPolyPatch>(pp).separated()
613 coupledPatchI = patchI;
620 if (ownPatch[faceI] != -1)
630 if (coupledPatchI != -1)
632 faceToCoupledPatch_.insert(faceI, coupledPatchI);
648 mesh_.updateMesh(map);
651 if (map().hasMotionPoints())
653 mesh_.movePoints(map().preMotionPoints());
667 faceSet baffledFacesSet(mesh_,
"baffledFacesSet", 2*nBaffles);
669 const labelList& reverseFaceMap = map().reverseFaceMap();
673 forAll(ownPatch, oldFaceI)
675 label faceI = reverseFaceMap[oldFaceI];
677 if (ownPatch[oldFaceI] != -1 && faceI >= 0)
679 const cell& ownFaces = mesh_.cells()[mesh_.faceOwner()[faceI]];
683 baffledFacesSet.
insert(ownFaces[i]);
692 if (oldFaceI >= 0 && reverseFaceMap[oldFaceI] != faceI)
694 const cell& ownFaces = mesh_.cells()[mesh_.faceOwner()[faceI]];
698 baffledFacesSet.
insert(ownFaces[i]);
702 baffledFacesSet.
sync(mesh_);
704 updateMesh(map, baffledFacesSet.
toc());
722 const faceZone& fZone = faceZones[zoneI];
726 bool hasInfo = getFaceZoneInfo(fZone.
name(), mpI, spI, fzType);
728 if (hasInfo &&
findIndex(fzTypes, fzType) != -1)
752 label zoneID = zoneIDs[i];
762 if (faceToZone[
p[0]] != -1 && (faceToZone[
p[0]] == faceToZone[
p[1]]))
781 if (zoneIDs.
size() > 0)
786 Info<<
"Converting zoned faces into baffles ..." <<
endl;
797 label zoneI = zoneIDs[j];
799 const faceZone& fz = faceZones[zoneI];
801 const word& masterName = faceZoneToMasterPatch_[fz.
name()];
802 label masterPatchI = mesh_.boundaryMesh().findPatchID(masterName);
803 const word& slaveName = faceZoneToSlavePatch_[fz.
name()];
804 label slavePatchI = mesh_.boundaryMesh().findPatchID(slaveName);
806 if (masterPatchI == -1 || slavePatchI == -1)
809 <<
"Problem: masterPatchI:" << masterPatchI
816 if (mesh_.isInternalFace(faceI))
820 ownPatch[faceI] = slavePatchI;
821 neiPatch[faceI] = masterPatchI;
825 ownPatch[faceI] = masterPatchI;
826 neiPatch[faceI] = slavePatchI;
835 label nLocalBaffles =
sum(nBaffles);
840 if (nTotalBaffles > 0)
843 Pstream::listCombineScatter(nBaffles);
846 <<
setf(ios_base::left)
847 <<
setw(30) <<
"FaceZone"
848 <<
setw(10) <<
"FaceType"
849 <<
setw(10) <<
"nBaffles"
851 <<
setw(30) <<
"--------"
852 <<
setw(10) <<
"--------"
853 <<
setw(10) <<
"--------"
858 label zoneI = zoneIDs[j];
859 const faceZone& fz = faceZones[zoneI];
863 bool hasInfo = getFaceZoneInfo(fz.
name(), mpI, spI, fzType);
870 << surfaceZonesInfo::faceZoneTypeNames[fzType]
871 <<
setw(10) << nBaffles[j]
878 map = createBaffles(ownPatch, neiPatch);
884 baffles.
setSize(nLocalBaffles);
885 originatingFaceZone.
setSize(nLocalBaffles);
889 const labelList& reverseFaceMap = map().reverseFaceMap();
893 label faceI = mesh_.nInternalFaces();
894 faceI < mesh_.nFaces();
899 label masterFaceI = reverseFaceMap[oldFaceI];
900 if (masterFaceI != faceI && ownPatch[oldFaceI] != -1)
902 baffles[baffleI] =
labelPair(masterFaceI, faceI);
903 originatingFaceZone[baffleI] =
faceZoneID[oldFaceI];
908 if (baffleI != baffles.
size())
911 <<
"Had " << baffles.
size() <<
" baffles to create "
912 <<
" but encountered " << baffleI
913 <<
" slave faces originating from patcheable faces."
919 const_cast<Time&
>(mesh_.time())++;
920 Pout<<
"Writing zone-baffled mesh to time " <<
timeName()
926 mesh_.time().path()/
"baffles"
930 Info<<
"Created " << nTotalBaffles <<
" baffles in = "
931 << mesh_.time().cpuTimeIncrement() <<
" s\n" <<
nl <<
endl;
936 originatingFaceZone.
clear();
946 const scalar planarAngle
956 labelList nBafflesPerEdge(mesh_.nEdges(), 0);
973 const label baffleValue = 1000000;
992 const labelList& fEdges = mesh_.faceEdges(faceI);
996 nBafflesPerEdge[fEdges[fEdgeI]]++;
1014 label f0 = couples[i].first();
1015 const labelList& fEdges0 = mesh_.faceEdges(f0, fe0);
1018 nBafflesPerEdge[fEdges0[fEdgeI]] += baffleValue;
1023 label f1 = couples[i].second();
1024 const labelList& fEdges1 = mesh_.faceEdges(
f1, fe1);
1027 nBafflesPerEdge[fEdges1[fEdgeI]] += baffleValue;
1033 syncTools::syncEdgeList
1063 label edgeI = fEdges[fEdgeI];
1065 if (nBafflesPerEdge[edgeI] == 2*baffleValue+2*1)
1067 filteredCouples[filterI++] = couple;
1073 filteredCouples.
setSize(filterI);
1078 Info<<
"freeStandingBaffles : detected "
1080 <<
" free-standing baffles out of "
1093 const pointField& cellCentres = mesh_.cellCentres();
1095 forAll(filteredCouples, i)
1097 const labelPair& couple = filteredCouples[i];
1098 start[i] = cellCentres[mesh_.faceOwner()[couple.
first()]];
1099 end[i] = cellCentres[mesh_.faceOwner()[couple.
second()]];
1104 const vectorField smallVec(ROOTSMALL*(end-start));
1122 surfaces_.findNearestIntersection
1124 identity(surfaces_.surfaces().size()),
1148 forAll(filteredCouples, i)
1150 const labelPair& couple = filteredCouples[i];
1164 &&
mag(hit1[i].hitPoint()-hit2[i].hitPoint()) > mergeDistance_
1175 if ((normal1[i]&normal2[i]) > planarAngleCos)
1179 scalar magN =
mag(
n);
1182 filteredCouples[filterI++] = couple;
1186 else if (hit1[i].hit() || hit2[i].hit())
1192 filteredCouples.
setSize(filterI);
1194 Info<<
"freeStandingBaffles : detected "
1196 <<
" planar (within " << planarAngle
1197 <<
" degrees) free-standing baffles out of "
1202 return filteredCouples;
1219 const faceList& faces = mesh_.faces();
1220 const labelList& faceOwner = mesh_.faceOwner();
1225 label face0 = couples[i].first();
1226 label face1 = couples[i].second();
1231 label own0 = faceOwner[face0];
1232 label own1 = faceOwner[face1];
1234 if (face1 < 0 || own0 < own1)
1238 bool zoneFlip =
false;
1242 const faceZone& fZone = faceZones[zoneID];
1246 label nei = (face1 < 0 ? -1 : own1);
1269 bool zoneFlip =
false;
1273 const faceZone& fZone = faceZones[zoneID];
1298 label faceI = iter.key();
1299 label patchI = iter();
1301 if (!mesh_.isInternalFace(faceI))
1304 <<
"problem: face:" << faceI
1305 <<
" at:" << mesh_.faceCentres()[faceI]
1306 <<
"(wanted patch:" << patchI
1311 bool zoneFlip =
false;
1315 const faceZone& fZone = faceZones[zoneID];
1338 map = meshMod.
changeMesh(mesh_,
false,
true);
1341 mesh_.updateMesh(map);
1344 if (map().hasMotionPoints())
1346 mesh_.movePoints(map().preMotionPoints());
1365 label newFace0 = map().reverseFaceMap()[couples[i].first()];
1368 newExposedFaces[newI++] = newFace0;
1371 label newFace1 = map().reverseFaceMap()[couples[i].second()];
1374 newExposedFaces[newI++] = newFace1;
1377 newExposedFaces.
setSize(newI);
1378 updateMesh(map, newExposedFaces);
1387 const bool doInternalZones,
1388 const bool doBaffleZones
1394 if (doInternalZones)
1396 fzTypes.
append(surfaceZonesInfo::INTERNAL);
1400 fzTypes.
append(surfaceZonesInfo::BAFFLE);
1402 zoneIDs = getZones(fzTypes);
1411 localPointRegion::findDuplicateFacePairs(mesh_)
1418 mapPtr = mergeBaffles(zoneBaffles,
Map<label>(0));
1435 const pointField& cellCentres = mesh_.cellCentres();
1436 const labelList& faceOwner = mesh_.faceOwner();
1437 const labelList& faceNeighbour = mesh_.faceNeighbour();
1441 surfaces_.findInside
1443 closedNamedSurfaces,
1448 forAll(insideSurfaces, cellI)
1450 label surfI = insideSurfaces[cellI];
1454 if (cellToZone[cellI] == -2)
1456 cellToZone[cellI] = surfaceToCellZone[surfI];
1458 else if (cellToZone[cellI] == -1)
1463 cellToZone[cellI] = surfaceToCellZone[surfI];
1476 label nCandidates = 0;
1477 forAll(namedSurfaceIndex, faceI)
1479 label surfI = namedSurfaceIndex[faceI];
1483 if (mesh_.isInternalFace(faceI))
1497 forAll(namedSurfaceIndex, faceI)
1499 label surfI = namedSurfaceIndex[faceI];
1503 label own = faceOwner[faceI];
1504 const point& ownCc = cellCentres[own];
1506 if (mesh_.isInternalFace(faceI))
1508 label nei = faceNeighbour[faceI];
1509 const point& neiCc = cellCentres[nei];
1511 const vector d = 1
e-4*(neiCc - ownCc);
1512 candidatePoints[nCandidates++] = ownCc-d;
1513 candidatePoints[nCandidates++] = neiCc+d;
1518 const point& neiFc = neiCc[faceI-mesh_.nInternalFaces()];
1521 const vector d = 1
e-4*(neiFc - ownCc);
1522 candidatePoints[nCandidates++] = ownCc-d;
1530 surfaces_.findInside
1532 closedNamedSurfaces,
1541 forAll(namedSurfaceIndex, faceI)
1543 label surfI = namedSurfaceIndex[faceI];
1547 label own = faceOwner[faceI];
1549 if (mesh_.isInternalFace(faceI))
1551 label ownSurfI = insideSurfaces[nCandidates++];
1554 cellToZone[own] = surfaceToCellZone[ownSurfI];
1557 label neiSurfI = insideSurfaces[nCandidates++];
1560 label nei = faceNeighbour[faceI];
1562 cellToZone[nei] = surfaceToCellZone[neiSurfI];
1567 label ownSurfI = insideSurfaces[nCandidates++];
1570 cellToZone[own] = surfaceToCellZone[ownSurfI];
1581 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
1583 label ownZone = cellToZone[mesh_.faceOwner()[faceI]];
1584 label neiZone = cellToZone[mesh_.faceNeighbour()[faceI]];
1586 if (namedSurfaceIndex[faceI] == -1 && (ownZone != neiZone))
1596 else if (neiZone == -1)
1602 minZone =
min(ownZone, neiZone);
1608 if (geomSurfI != -1)
1610 namedSurfaceIndex[faceI] = geomSurfI;
1616 syncTools::swapBoundaryCellList(mesh_, cellToZone, neiCellZone);
1629 label ownZone = cellToZone[mesh_.faceOwner()[faceI]];
1630 label neiZone = neiCellZone[faceI-mesh_.nInternalFaces()];
1632 if (namedSurfaceIndex[faceI] == -1 && (ownZone != neiZone))
1640 else if (neiZone == -1)
1646 minZone =
min(ownZone, neiZone);
1652 if (geomSurfI != -1)
1654 namedSurfaceIndex[faceI] = geomSurfI;
1662 syncTools::syncFaceList(mesh_, namedSurfaceIndex,
maxEqOp<label>());
1676 boolList blockedFace(mesh_.nFaces());
1679 forAll(blockedFace, faceI)
1681 if (faceToZone[faceI] == -1)
1683 blockedFace[faceI] =
false;
1687 blockedFace[faceI] =
true;
1694 blockedFace.
clear();
1702 (void)mesh_.tetBasePtIs();
1705 forAll(locationsInMesh, i)
1708 const point& insidePoint = locationsInMesh[i];
1709 label zoneID = zonesInMesh[i];
1712 label keepRegionI = findRegion
1716 mergeDistance_*
vector(1,1,1),
1720 Info<<
"For cellZone "
1724 : mesh_.cellZones()[zoneID].name()
1726 <<
" found point " << insidePoint
1727 <<
" in global region " << keepRegionI
1728 <<
" out of " << cellRegion.
nRegions() <<
" regions." <<
endl;
1730 if (keepRegionI == -1)
1733 <<
"Point " << insidePoint
1734 <<
" is not inside the mesh." <<
nl
1735 <<
"Bounding box of the mesh:" << mesh_.bounds()
1741 regionToZone[keepRegionI] = zoneID;
1747 label nWarnings = 0;
1749 forAll(cellRegion, cellI)
1751 if (cellRegion[cellI] == keepRegionI)
1753 if (cellToZone[cellI] == -2)
1756 cellToZone[cellI] = zoneID;
1758 else if (cellToZone[cellI] != zoneID)
1764 <<
" at " << mesh_.cellCentres()[cellI]
1765 <<
" is inside cellZone "
1769 : mesh_.cellZones()[zoneID].name()
1771 <<
" from locationInMesh " << insidePoint
1772 <<
" but already marked as being in zone "
1773 << mesh_.cellZones()[cellToZone[cellI]].name()
1775 <<
"This can happen if your surfaces are not"
1776 <<
" (sufficiently) closed."
1799 forAll(zoneNamesInMesh, i)
1801 zoneIDs[i] = czs.
findZoneID(zoneNamesInMesh[i]);
1803 findCellZoneInsideWalk
1815 const label surfZoneI,
1816 const label ownRegion,
1817 const label neiRegion,
1822 bool changed =
false;
1825 if (ownRegion != neiRegion)
1832 if (regionToCellZone[ownRegion] == -2)
1834 if (regionToCellZone[neiRegion] == surfZoneI)
1838 regionToCellZone[ownRegion] = -1;
1841 else if (regionToCellZone[neiRegion] != -2)
1845 regionToCellZone[ownRegion] = surfZoneI;
1849 else if (regionToCellZone[neiRegion] == -2)
1851 if (regionToCellZone[ownRegion] == surfZoneI)
1855 regionToCellZone[neiRegion] = -1;
1858 else if (regionToCellZone[ownRegion] != -2)
1862 regionToCellZone[neiRegion] = surfZoneI;
1886 boolList blockedFace(mesh_.nFaces());
1888 forAll(allSurfaceIndex, faceI)
1890 if (allSurfaceIndex[faceI] == -1)
1892 blockedFace[faceI] =
false;
1896 blockedFace[faceI] =
true;
1903 blockedFace.
clear();
1914 forAll(cellToZone, cellI)
1916 label regionI = cellRegion[cellI];
1917 if (cellToZone[cellI] != -2 && regionToCellZone[regionI] == -2)
1919 regionToCellZone[regionI] = cellToZone[cellI];
1929 Pstream::listCombineScatter(regionToCellZone);
1933 forAll(locationsInMesh, i)
1935 const point& keepPoint = locationsInMesh[i];
1936 label keepRegionI = findRegion
1940 mergeDistance_*
vector(1,1,1),
1944 Info<<
"Found point " << keepPoint
1945 <<
" in global region " << keepRegionI
1946 <<
" out of " << cellRegion.
nRegions() <<
" regions." <<
endl;
1948 if (keepRegionI == -1)
1951 <<
"Point " << keepPoint
1952 <<
" is not inside the mesh." <<
nl
1953 <<
"Bounding box of the mesh:" << mesh_.bounds()
1961 if (regionToCellZone[keepRegionI] == -2)
1963 regionToCellZone[keepRegionI] = -1;
1980 Pstream::listCombineScatter(regionToCellZone);
1983 bool changed =
false;
1987 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
1989 label surfI = namedSurfaceIndex[faceI];
1996 bool changedCell = calcRegionToZone
1998 surfaceToCellZone[surfI],
1999 cellRegion[mesh_.faceOwner()[faceI]],
2000 cellRegion[mesh_.faceNeighbour()[faceI]],
2004 changed = changed | changedCell;
2014 syncTools::swapBoundaryCellList(mesh_, cellRegion, neiCellRegion);
2028 label surfI = namedSurfaceIndex[faceI];
2033 bool changedCell = calcRegionToZone
2035 surfaceToCellZone[surfI],
2036 cellRegion[mesh_.faceOwner()[faceI]],
2037 neiCellRegion[faceI-mesh_.nInternalFaces()],
2041 changed = changed | changedCell;
2056 forAll(regionToCellZone, regionI)
2058 Pout<<
"Region " << regionI
2059 <<
" becomes cellZone:" << regionToCellZone[regionI]
2065 forAll(cellToZone, cellI)
2067 label regionI = cellRegion[cellI];
2068 if (cellToZone[cellI] == -2 && regionToCellZone[regionI] != -2)
2070 cellToZone[cellI] = regionToCellZone[regionI];
2091 const labelList& faceOwner = mesh_.faceOwner();
2092 const labelList& faceNeighbour = mesh_.faceNeighbour();
2094 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
2096 label ownZone = cellToZone[faceOwner[faceI]];
2097 label neiZone = cellToZone[faceNeighbour[faceI]];
2102 && namedSurfaceIndex[faceI] != -1
2103 && surfaceMap[namedSurfaceIndex[faceI]] == -1
2106 namedSurfaceIndex[faceI] = -1;
2114 syncTools::swapBoundaryCellList(mesh_, cellToZone, neiCellZone);
2127 label ownZone = cellToZone[faceOwner[faceI]];
2128 label neiZone = neiCellZone[faceI-mesh_.nInternalFaces()];
2133 && namedSurfaceIndex[faceI] != -1
2134 && surfaceMap[namedSurfaceIndex[faceI]] == -1
2137 namedSurfaceIndex[faceI] = -1;
2150 namedSurfaceIndex[faceI] != -1
2151 && surfaceMap[namedSurfaceIndex[faceI]] == -1
2154 namedSurfaceIndex[faceI] = -1;
2172 const pointField& cellCentres = mesh_.cellCentres();
2173 const labelList& faceOwner = mesh_.faceOwner();
2174 const labelList& faceNeighbour = mesh_.faceNeighbour();
2176 namedSurfaceIndex.
setSize(mesh_.nFaces());
2177 namedSurfaceIndex = -1;
2179 posOrientation.
setSize(mesh_.nFaces());
2180 posOrientation =
false;
2183 labelList nSurfFaces(surfaces_.surfZones().size(), 0);
2193 label faceI = testFaces[i];
2195 if (mesh_.isInternalFace(faceI))
2197 start[i] = cellCentres[faceOwner[faceI]];
2198 end[i] = cellCentres[faceNeighbour[faceI]];
2202 start[i] = cellCentres[faceOwner[faceI]];
2203 end[i] = neiCc[faceI-mesh_.nInternalFaces()];
2209 const vectorField smallVec(ROOTSMALL*(end-start));
2229 surfaces_.findNearestIntersection
2249 label faceI = testFaces[i];
2250 const vector& area = mesh_.faceAreas()[faceI];
2252 if (surface1[i] != -1)
2259 magSqr(hit2[i].hitPoint())
2260 <
magSqr(hit1[i].hitPoint())
2264 namedSurfaceIndex[faceI] = surface2[i];
2265 posOrientation[faceI] = ((area&normal2[i]) > 0);
2266 nSurfFaces[surface2[i]]++;
2270 namedSurfaceIndex[faceI] = surface1[i];
2271 posOrientation[faceI] = ((area&normal1[i]) > 0);
2272 nSurfFaces[surface1[i]]++;
2275 else if (surface2[i] != -1)
2277 namedSurfaceIndex[faceI] = surface2[i];
2278 posOrientation[faceI] = ((area&normal2[i]) > 0);
2279 nSurfFaces[surface2[i]]++;
2288 syncTools::syncFaceList
2298 forAll(nSurfFaces, surfI)
2301 << surfaces_.names()[surfI]
2302 <<
" nZoneFaces:" << nSurfFaces[surfI] <<
nl;
2311 const bool allowFreeStandingZoneFaces,
2333 labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces());
2334 pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
2335 calcNeighbourData(neiLevel, neiCc);
2338 labelList namedSurfaces(surfaceZonesInfo::getNamedSurfaces(surfZones));
2342 if (namedSurfaces.
size())
2345 surfaceToCellZone = surfaceZonesInfo::addCellZonesToMesh
2354 cellToZone.
setSize(mesh_.nCells());
2357 namedSurfaceIndex.
clear();
2358 posOrientation.
clear();
2368 identity(surfaces_.surfaces().size()),
2375 if (namedSurfaces.
size())
2390 if (locationsInMesh.size())
2392 Info<<
"Setting cellZones according to locationsInMesh:" <<
endl;
2395 forAll(locationsInMesh, i)
2399 Info<<
"Location : " << locationsInMesh[i] <<
nl
2404 label zoneID = mesh_.cellZones().findZoneID(
name);
2409 locationsZoneIDs[i] = zoneID;
2416 findCellZoneInsideWalk
2431 surfaceZonesInfo::getInsidePointNamedSurfaces(surfZones)
2434 if (locationSurfaces.
size())
2436 Info<<
"Found " << locationSurfaces.
size()
2437 <<
" named surfaces with a provided inside point."
2438 <<
" Assigning cells inside these surfaces"
2439 <<
" to the corresponding cellZone."
2444 labelList insidePointCellZoneIDs(locationSurfaces.
size(), -1);
2445 forAll(locationSurfaces, i)
2447 label surfI = locationSurfaces[i];
2450 const word&
name = surfZones[surfI].cellZoneName();
2453 label zoneID = mesh_.cellZones().findZoneID(
name);
2460 insidePointCellZoneIDs[i] = zoneID;
2464 findCellZoneInsideWalk
2467 insidePointCellZoneIDs,
2480 surfaceZonesInfo::getClosedNamedSurfaces
2483 surfaces_.geometry(),
2484 surfaces_.surfaces()
2488 if (closedNamedSurfaces.
size())
2490 Info<<
"Found " << closedNamedSurfaces.
size()
2491 <<
" closed, named surfaces. Assigning cells in/outside"
2492 <<
" these surfaces to the corresponding cellZone."
2495 findCellZoneGeometric
2498 closedNamedSurfaces,
2509 if (namedSurfaces.
size())
2511 Info<<
"Walking from known cellZones; crossing a faceZone "
2512 <<
"face changes cellZone" <<
nl <<
endl;
2524 if (!allowFreeStandingZoneFaces)
2526 Info<<
"Only keeping zone faces inbetween different cellZones."
2532 surfaceZonesInfo::getStandaloneNamedSurfaces
2541 forAll(standaloneNamedSurfaces, i)
2543 surfaceMap[standaloneNamedSurfaces[i]] = i;
2546 makeConsistentFaceIndex
2561 label nUnvisited = 0;
2562 label nBackgroundCells = 0;
2564 forAll(cellToZone, cellI)
2566 label zoneI = cellToZone[cellI];
2569 nZoneCells[zoneI]++;
2571 else if (zoneI == -1)
2575 else if (zoneI == -2)
2587 forAll(nZoneCells, zoneI)
2591 Info<<
"nUnvisited :" << nUnvisited <<
endl;
2592 Info<<
"nBackgroundCells:" << nBackgroundCells <<
endl;
2593 Info<<
"nZoneCells :" << nZoneCells <<
endl;
2597 Pout<<
"Writing cell zone allocation on mesh to time "
2607 IOobject::AUTO_WRITE,
2612 zeroGradientFvPatchScalarField::typeName
2615 forAll(cellToZone, cellI)
2617 volCellToZone[cellI] = cellToZone[cellI];
2619 volCellToZone.write();
2627 const bool useTopologicalSnapDetection,
2628 const bool removeEdgeConnectedCells,
2637 <<
"Introducing baffles to block off problem cells" <<
nl
2638 <<
"----------------------------------------------" <<
nl
2642 if (useTopologicalSnapDetection)
2644 facePatch = markFacesOnProblemCells
2647 removeEdgeConnectedCells,
2654 facePatch = markFacesOnProblemCellsGeometric
2658 globalToMasterPatch,
2662 Info<<
"Analyzed problem cells in = "
2667 faceSet problemFaces(mesh_,
"problemFaces", mesh_.nFaces()/100);
2671 if (facePatch[faceI] != -1)
2673 problemFaces.
insert(faceI);
2677 Pout<<
"Dumping " << problemFaces.
size()
2679 problemFaces.
write();
2682 Info<<
"Introducing baffles to delete problem cells." <<
nl <<
endl;
2690 createBaffles(facePatch, facePatch);
2697 Info<<
"Created baffles in = "
2700 printMeshInfo(debug,
"After introducing baffles");
2704 Pout<<
"Writing extra baffled mesh to time "
2710 runTime.
path()/
"extraBaffles"
2712 Pout<<
"Dumped debug data in = "
2726 const labelList& faceOwner = mesh_.faceOwner();
2727 const labelList& faceNeighbour = mesh_.faceNeighbour();
2746 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
2748 if (faceToZone[faceI] != -1)
2751 label ownZone = cellToZone[faceOwner[faceI]];
2752 label neiZone = cellToZone[faceNeighbour[faceI]];
2753 if (ownZone == neiZone)
2755 faceLabels.
append(faceI);
2766 if (faceToZone[faceI] != -1)
2769 label ownZone = cellToZone[faceOwner[faceI]];
2770 label neiZone = neiCellZone[faceI-mesh_.nInternalFaces()];
2771 if (ownZone == neiZone)
2773 faceLabels.
append(faceI);
2778 return faceLabels.
shrink();
2791 nMasterFacesPerEdge = 0;
2793 forAll(patch.addressing(), faceI)
2795 const label meshFaceI = patch.addressing()[faceI];
2797 if (isMasterFace[meshFaceI])
2802 nMasterFacesPerEdge[fEdges[fEdgeI]]++;
2807 syncTools::syncEdgeList
2810 patch.
meshEdges(mesh_.edges(), mesh_.pointEdges()),
2811 nMasterFacesPerEdge,
2831 label nProtected = 0;
2833 forAll(nMasterFacesPerEdge, edgeI)
2835 if (nMasterFacesPerEdge[edgeI] > 2)
2837 allEdgeInfo[edgeI] = -2;
2856 >::propagationTol();
2864 label currentZoneI = 0;
2870 for (; faceI < allFaceInfo.
size(); faceI++)
2872 if (!allFaceInfo[faceI].valid(dummyTrackData))
2874 globalSeed = globalFaces.
toGlobal(faceI);
2887 label seedFaceI = globalFaces.
toLocal(procI, globalSeed);
2893 if (procI == Pstream::myProcNo())
2899 faceInfo = currentZoneI;
2905 label edgeI = fEdges[fEdgeI];
2923 changedEdges.
append(edgeI);
2924 changedInfo.
append(edgeInfo);
2956 faceToZone.
setSize(patch.size());
2957 forAll(allFaceInfo, faceI)
2959 if (!allFaceInfo[faceI].valid(dummyTrackData))
2962 <<
"Problem: unvisited face " << faceI
2966 faceToZone[faceI] = allFaceInfo[faceI].region();
2969 return currentZoneI;
2993 label nProtected = 0;
2995 forAll(patch.addressing(), faceI)
2997 const label meshFaceI = patch.addressing()[faceI];
3003 && bm[patchI].coupled()
3004 && !isMasterFace[meshFaceI]
3008 allFaceInfo[faceI] = orientedSurface::NOFLIP;
3017 label nProtected = 0;
3019 forAll(nMasterFacesPerEdge, edgeI)
3021 if (nMasterFacesPerEdge[edgeI] > 2)
3023 allEdgeInfo[edgeI] = orientedSurface::NOFLIP;
3028 Info<<
"Protected from visiting "
3030 <<
" non-manifold edges" <<
nl <<
endl;
3042 >::propagationTol();
3052 forAll(allFaceInfo, faceI)
3054 if (allFaceInfo[faceI] == orientedSurface::UNVISITED)
3056 globalSeed = globalFaces.
toGlobal(faceI);
3069 label seedFaceI = globalFaces.
toLocal(procI, globalSeed);
3074 if (procI == Pstream::myProcNo())
3081 faceInfo = orientedSurface::NOFLIP;
3083 if (zoneToOrientation[faceToZone[seedFaceI]] < 0)
3092 label edgeI = fEdges[fEdgeI];
3110 changedEdges.
append(edgeI);
3111 changedInfo.
append(edgeInfo);
3146 mesh_.nFaces()-mesh_.nInternalFaces(),
3147 orientedSurface::UNVISITED
3150 forAll(patch.addressing(), i)
3152 const label meshFaceI = patch.addressing()[i];
3153 if (!mesh_.isInternalFace(meshFaceI))
3155 neiStatus[meshFaceI-mesh_.nInternalFaces()] =
3156 allFaceInfo[i].flipStatus();
3159 syncTools::swapBoundaryFaceList(mesh_, neiStatus);
3161 forAll(patch.addressing(), i)
3163 const label meshFaceI = patch.addressing()[i];
3169 && bm[patchI].coupled()
3170 && !isMasterFace[meshFaceI]
3174 label bFaceI = meshFaceI-mesh_.nInternalFaces();
3176 if (neiStatus[bFaceI] == orientedSurface::NOFLIP)
3178 allFaceInfo[i] = orientedSurface::FLIP;
3180 else if (neiStatus[bFaceI] == orientedSurface::FLIP)
3182 allFaceInfo[i] = orientedSurface::NOFLIP;
3187 <<
"Incorrect status for face " << meshFaceI
3197 meshFlipMap.
setSize(mesh_.nFaces());
3198 meshFlipMap =
false;
3200 forAll(allFaceInfo, faceI)
3202 label meshFaceI = patch.addressing()[faceI];
3204 if (allFaceInfo[faceI] == orientedSurface::NOFLIP)
3206 meshFlipMap[meshFaceI] =
false;
3208 else if (allFaceInfo[faceI] == orientedSurface::FLIP)
3210 meshFlipMap[meshFaceI] =
true;
3215 <<
"Problem : unvisited face " << faceI
3216 <<
" centre:" << mesh_.faceCentres()[meshFaceI]
3234 const labelList& faceOwner = mesh_.faceOwner();
3235 const labelList& faceNeighbour = mesh_.faceNeighbour();
3237 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
3239 label faceZoneI = faceToZone[faceI];
3241 if (faceZoneI != -1)
3247 label ownZone = cellToZone[faceOwner[faceI]];
3248 label neiZone = cellToZone[faceNeighbour[faceI]];
3252 if (ownZone == neiZone)
3255 flip = meshFlipMap[faceI];
3262 || (neiZone != -1 && ownZone > neiZone)
3270 mesh_.faces()[faceI],
3273 faceNeighbour[faceI],
3296 label faceZoneI = faceToZone[faceI];
3298 if (faceZoneI != -1)
3300 label ownZone = cellToZone[faceOwner[faceI]];
3301 label neiZone = neiCellZone[faceI-mesh_.nInternalFaces()];
3305 if (ownZone == neiZone)
3308 flip = meshFlipMap[faceI];
3315 || (neiZone != -1 && ownZone > neiZone)
3323 mesh_.faces()[faceI],
3343 forAll(cellToZone, cellI)
3345 label zoneI = cellToZone[cellI];
3365 const label ownZone,
3366 const label neiZone,
3373 if (ownZone != neiZone)
3380 || (neiZone != -1 && ownZone > neiZone)
3391 const_iterator zoneFnd = zoneIDsToFaceZone.
find
3396 if (zoneFnd == zoneIDsToFaceZone.end())
3399 const word ownZoneName =
3402 ? cellZones[ownZone].name()
3405 const word neiZoneName =
3408 ? cellZones[neiZone].name()
3413 Pair<word> wordKey(ownZoneName, neiZoneName);
3421 zoneIDsToFaceZone.insert(key, fzName);
3422 zonesToFaceZone.
insert(wordKey, fzName);
3432 const bool doHandleSnapProblems,
3434 const bool useTopologicalSnapDetection,
3435 const bool removeEdgeConnectedCells,
3453 Info<<
"Introducing baffles for "
3455 <<
" faces that are intersected by the surface." <<
nl <<
endl;
3458 labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces());
3459 pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
3460 calcNeighbourData(neiLevel, neiCc);
3465 globalToMasterPatch,
3477 createBaffles(ownPatch, neiPatch);
3485 Info<<
"Created baffles in = "
3488 printMeshInfo(debug,
"After introducing baffles");
3498 runTime.
path()/
"baffles"
3500 Pout<<
"Dumped debug data in = "
3510 if (doHandleSnapProblems)
3515 useTopologicalSnapDetection,
3516 removeEdgeConnectedCells,
3520 globalToMasterPatch,
3528 neiLevel.
setSize(mesh_.nFaces()-mesh_.nInternalFaces());
3529 neiCc.setSize(mesh_.nFaces()-mesh_.nInternalFaces());
3530 calcNeighbourData(neiLevel, neiCc);
3535 globalToMasterPatch,
3547 createBaffles(ownPatch, neiPatch);
3562 <<
"Remove unreachable sections of mesh" <<
nl
3563 <<
"-----------------------------------" <<
nl
3573 globalToMasterPatch,
3576 locationsOutsideMesh
3584 Info<<
"Split mesh in = "
3587 printMeshInfo(debug,
"After subsetting");
3599 Pout<<
"Dumped debug data in = "
3608 const bool useTopologicalSnapDetection,
3609 const bool removeEdgeConnectedCells,
3611 const scalar planarAngle,
3624 <<
"Merge free-standing baffles" <<
nl
3625 <<
"---------------------------" <<
nl
3634 localPointRegion::findDuplicateFacePairs(mesh_),
3642 Info<<
"Detected free-standing baffles : " << nCouples <<
endl;
3656 useTopologicalSnapDetection,
3657 removeEdgeConnectedCells,
3661 globalToMasterPatch,
3669 <<
"Remove unreachable sections of mesh" <<
nl
3670 <<
"-----------------------------------" <<
nl
3680 globalToMasterPatch,
3683 locationsOutsideMesh
3693 Info<<
"Merged free-standing baffles in = "
3700 const label nBufferLayers,
3713 labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces());
3714 pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
3715 calcNeighbourData(neiLevel, neiCc);
3721 globalToMasterPatch,
3734 boolList blockedFace(mesh_.nFaces(),
false);
3738 if (ownPatch[faceI] != -1 || neiPatch[faceI] != -1)
3740 blockedFace[faceI] =
true;
3743 syncTools::syncFaceList(mesh_, blockedFace,
orEqOp<bool>());
3747 blockedFace.
clear();
3753 mergeDistance_*
vector(1,1,1),
3755 locationsOutsideMesh,
3767 const labelList& faceOwner = mesh_.faceOwner();
3768 const labelList& faceNeighbour = mesh_.faceNeighbour();
3771 label defaultPatch = 0;
3772 if (globalToMasterPatch.
size())
3774 defaultPatch = globalToMasterPatch[0];
3777 for (
label i = 0; i < nBufferLayers; i++)
3781 labelList pointBaffle(mesh_.nPoints(), -1);
3783 forAll(faceNeighbour, faceI)
3785 const face&
f = mesh_.faces()[faceI];
3787 label ownRegion = cellRegion[faceOwner[faceI]];
3788 label neiRegion = cellRegion[faceNeighbour[faceI]];
3790 if (ownRegion == -1 && neiRegion != -1)
3797 pointBaffle[
f[fp]] =
max(defaultPatch, ownPatch[faceI]);
3800 else if (ownRegion != -1 && neiRegion == -1)
3802 label newPatchI = neiPatch[faceI];
3803 if (newPatchI == -1)
3805 newPatchI =
max(defaultPatch, ownPatch[faceI]);
3809 pointBaffle[
f[fp]] = newPatchI;
3815 label faceI = mesh_.nInternalFaces();
3816 faceI < mesh_.nFaces();
3820 const face&
f = mesh_.faces()[faceI];
3822 label ownRegion = cellRegion[faceOwner[faceI]];
3824 if (ownRegion == -1)
3828 pointBaffle[
f[fp]] =
max(defaultPatch, ownPatch[faceI]);
3834 syncTools::syncPointList
3847 forAll(pointFaces, pointI)
3849 if (pointBaffle[pointI] != -1)
3857 if (ownPatch[faceI] == -1)
3859 ownPatch[faceI] = pointBaffle[pointI];
3873 if (ownPatch[faceI] != -1)
3875 label own = faceOwner[faceI];
3877 if (cellRegion[own] == -1)
3881 const cell& ownFaces = mesh_.cells()[own];
3884 if (ownPatch[ownFaces[j]] == -1)
3886 newOwnPatch[ownFaces[j]] = ownPatch[faceI];
3890 if (mesh_.isInternalFace(faceI))
3892 label nei = faceNeighbour[faceI];
3894 if (cellRegion[nei] == -1)
3898 const cell& neiFaces = mesh_.cells()[nei];
3901 if (ownPatch[neiFaces[j]] == -1)
3903 newOwnPatch[neiFaces[j]] = ownPatch[faceI];
3923 forAll(cellRegion, cellI)
3925 if (cellRegion[cellI] == -1)
3927 cellsToRemove.
append(cellI);
3932 label nCellsToKeep = mesh_.nCells() - cellsToRemove.size();
3935 Info<<
"Keeping all cells containing points " << locationsInMesh <<
endl
3936 <<
"Selected for keeping : " << nCellsToKeep <<
" cells." <<
endl;
3948 label faceI = exposedFaces[i];
3950 if (ownPatch[faceI] != -1)
3952 exposedPatches[i] = ownPatch[faceI];
3957 <<
"For exposed face " << faceI
3958 <<
" fc:" << mesh_.faceCentres()[faceI]
3959 <<
" found no patch." <<
endl
3960 <<
" Taking patch " << defaultPatch
3961 <<
" instead." <<
endl;
3962 exposedPatches[i] = defaultPatch;
3966 return doRemoveCells
3990 Info<<
"dupNonManifoldPoints : Found : " << nNonManifPoints
3991 <<
" non-manifold points (out of "
3992 << mesh_.globalData().nTotalPoints()
3998 if (nNonManifPoints)
4007 map = meshMod.
changeMesh(mesh_,
false,
true);
4010 mesh_.updateMesh(map);
4013 if (map().hasMotionPoints())
4015 mesh_.movePoints(map().preMotionPoints());
4049 label nPointPairs = 0;
4050 forAll(pointToDuplicate, pointI)
4052 label otherPointI = pointToDuplicate[pointI];
4053 if (otherPointI != -1)
4064 forAll(pointToDuplicate, pointI)
4066 label otherPointI = pointToDuplicate[pointI];
4067 if (otherPointI != -1)
4070 pointToMaster.insert(pointI, otherPointI);
4081 map = meshMod.
changeMesh(mesh_,
false,
true);
4084 mesh_.updateMesh(map);
4087 if (map().hasMotionPoints())
4089 mesh_.movePoints(map().preMotionPoints());
4131 internalOrBaffleFaceZones = getZones(fzTypes);
4141 forAll(boundaryFaceZones, j)
4143 const faceZone& fZone = mesh_.faceZones()[boundaryFaceZones[j]];
4146 const face&
f = mesh_.faces()[fZone[i]];
4149 pointStatus[
f[fp]] =
max(pointStatus[
f[fp]], 1u);
4153 forAll(internalOrBaffleFaceZones, j)
4155 const faceZone& fZone = mesh_.faceZones()[internalOrBaffleFaceZones[j]];
4158 const face&
f = mesh_.faces()[fZone[i]];
4161 pointStatus[
f[fp]] =
max(pointStatus[
f[fp]], 2u);
4176 forAll(pointStatus, pointI)
4178 if (pointStatus[pointI] == 1u)
4185 Info<<
"Duplicating " << globalNPoints <<
" points on"
4186 <<
" faceZones of type "
4196 forAll(pointStatus, pointI)
4198 if (pointStatus[pointI] == 1u)
4200 candidatePoints[
n++] = pointI;
4213 const bool allowFreeStandingZoneFaces,
4219 if (locationsInMesh.size() != zonesInMesh.
size())
4229 labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces());
4230 pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
4231 calcNeighbourData(neiLevel, neiCc);
4240 if (namedSurfaces.
size())
4242 Info<<
"Setting cellZones according to named surfaces:" <<
endl;
4245 label surfI = namedSurfaces[i];
4247 Info<<
"Surface : " << surfaces_.names()[surfI] <<
nl
4248 <<
" faceZone : " << surfZones[surfI].faceZoneName() <<
nl
4249 <<
" cellZone : " << surfZones[surfI].cellZoneName() <<
endl;
4285 allowFreeStandingZoneFaces,
4299 labelList faceToZone(mesh_.nFaces(), -1);
4301 forAll(namedSurfaceIndex, faceI)
4303 label surfI = namedSurfaceIndex[faceI];
4306 faceToZone[faceI] = surfaceToFaceZone[surfI];
4320 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
4322 if (faceToZone[faceI] == -1)
4327 allocateInterRegionFaceZone
4329 cellToZone[mesh_.faceOwner()[faceI]],
4330 cellToZone[mesh_.faceNeighbour()[faceI]],
4340 forAll(neiCellZone, bFaceI)
4342 label faceI = bFaceI + mesh_.nInternalFaces();
4343 if (faceToZone[faceI] == -1)
4345 allocateInterRegionFaceZone
4347 cellToZone[mesh_.faceOwner()[faceI]],
4348 neiCellZone[bFaceI],
4367 Info<<
"Setting faceZones according to neighbouring cellZones:"
4373 zonesToFaceZone.
size()
4384 const word& fzName = zonesToFaceZone[cz];
4387 << cz[0] <<
' ' << cz[1] <<
nl
4388 <<
" faceZone : " << fzName <<
endl;
4409 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
4411 if (faceToZone[faceI] == -1)
4417 label ownZone = cellToZone[mesh_.faceOwner()[faceI]];
4418 label neiZone = cellToZone[mesh_.faceNeighbour()[faceI]];
4419 if (ownZone != neiZone)
4424 || (neiZone != -1 && ownZone > neiZone)
4431 faceToZone[faceI] = fZoneLookup[key];
4435 forAll(neiCellZone, bFaceI)
4437 label faceI = bFaceI + mesh_.nInternalFaces();
4438 if (faceToZone[faceI] == -1)
4440 label ownZone = cellToZone[mesh_.faceOwner()[faceI]];
4441 label neiZone = neiCellZone[bFaceI];
4442 if (ownZone != neiZone)
4447 || (neiZone != -1 && ownZone > neiZone)
4454 faceToZone[faceI] = fZoneLookup[key];
4473 label bFaceI = pp.
start()-mesh_.nInternalFaces();
4476 neiCellZone[bFaceI++] = -1;
4505 freeStandingBaffleFaces
4516 if (nFreeStanding > 0)
4518 Info<<
"Detected " << nFreeStanding <<
" free-standing zone faces"
4523 OBJstream str(mesh_.time().path()/
"freeStanding.obj");
4530 calcPatchNumMasterFaces(isMasterFace, patch, nMasterFacesPerEdge);
4535 const label nZones = markPatchZones
4538 nMasterFacesPerEdge,
4543 for (
label zoneI = 0; zoneI < nZones; zoneI++)
4545 nPosOrientation.insert(zoneI, 0);
4551 consistentOrientation
4555 nMasterFacesPerEdge,
4556 faceToConnectedZone,
4564 forAll(patch.addressing(), faceI)
4566 label meshFaceI = patch.addressing()[faceI];
4568 if (isMasterFace[meshFaceI])
4573 bool(posOrientation[meshFaceI])
4574 == meshFlipMap[meshFaceI]
4580 nPosOrientation.find(faceToConnectedZone[faceI])() +=
n;
4587 Info<<
"Split " << nFreeStanding <<
" free-standing zone faces"
4588 <<
" into " << nZones <<
" disconnected regions with size"
4589 <<
" (negative denotes wrong orientation) :"
4592 for (
label zoneI = 0; zoneI < nZones; zoneI++)
4594 Info<<
" " << zoneI <<
"\t" << nPosOrientation[zoneI]
4602 consistentOrientation
4606 nMasterFacesPerEdge,
4607 faceToConnectedZone,
4636 mesh_.updateMesh(map);
4639 if (map().hasMotionPoints())
4641 mesh_.movePoints(map().preMotionPoints());
4653 if (mesh_.cellZones().size() > 0)
4656 forAll(mesh_.cellZones(), zoneI)
4658 const cellZone& cz = mesh_.cellZones()[zoneI];
4665 if (mesh_.faceZones().size() > 0)
4668 forAll(mesh_.faceZones(), zoneI)
4670 const faceZone& fz = mesh_.faceZones()[zoneI];