78 boolList removedCell(mesh_.nCells(),
false);
83 removedCell[cellLabels[i]] =
true;
87 const labelList& faceOwner = mesh_.faceOwner();
88 const labelList& faceNeighbour = mesh_.faceNeighbour();
91 labelList nCellsUsingFace(mesh_.nFaces(), 0);
93 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
95 label own = faceOwner[faceI];
96 label nei = faceNeighbour[faceI];
98 if (!removedCell[own])
100 nCellsUsingFace[faceI]++;
102 if (!removedCell[nei])
104 nCellsUsingFace[faceI]++;
108 for (
label faceI = mesh_.nInternalFaces(); faceI < mesh_.nFaces(); faceI++)
110 label own = faceOwner[faceI];
112 if (!removedCell[own])
114 nCellsUsingFace[faceI]++;
125 mesh_.nFaces()-mesh_.nInternalFaces(),
126 mesh_.nInternalFaces()
129 syncTools::syncBoundaryFaceList
150 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
152 if (nCellsUsingFace[faceI] == 1)
154 exposedFaces.
append(faceI);
170 label own = faceOwner[faceI];
172 if (nCellsUsingFace[faceI] == 1 && !removedCell[own])
176 exposedFaces.
append(faceI);
184 return exposedFaces.
shrink();
198 if (exposedFaceLabels.
size() != exposedPatchIDs.
size())
201 <<
"Size of exposedFaceLabels " << exposedFaceLabels.
size()
202 <<
" differs from size of exposedPatchIDs "
203 << exposedPatchIDs.
size()
208 labelList newPatchID(mesh_.nFaces(), -1);
210 forAll(exposedFaceLabels, i)
212 label patchI = exposedPatchIDs[i];
214 if (patchI < 0 || patchI >=
patches.size())
217 <<
"Invalid patch " << patchI
218 <<
" for exposed face " << exposedFaceLabels[i] <<
endl
219 <<
"Valid patches 0.." <<
patches.size()-1
226 <<
"Trying to put exposed face " << exposedFaceLabels[i]
227 <<
" into a coupled patch : " <<
patches[patchI].name()
229 <<
"This is illegal."
233 newPatchID[exposedFaceLabels[i]] = patchI;
238 boolList removedCell(mesh_.nCells(),
false);
244 label cellI = cellLabels[i];
246 removedCell[cellI] =
true;
258 const faceList& faces = mesh_.faces();
259 const labelList& faceOwner = mesh_.faceOwner();
260 const labelList& faceNeighbour = mesh_.faceNeighbour();
265 labelList nFacesUsingPoint(mesh_.nPoints(), 0);
269 const face&
f = faces[faceI];
273 nFacesUsingPoint[
f[fp]]++;
278 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
280 const face&
f = faces[faceI];
281 label own = faceOwner[faceI];
282 label nei = faceNeighbour[faceI];
284 if (removedCell[own])
286 if (removedCell[nei])
293 uncount(
f, nFacesUsingPoint);
297 if (newPatchID[faceI] == -1)
300 <<
"No patchID provided for exposed face " << faceI
301 <<
" on cell " << nei <<
nl
302 <<
"Did you provide patch IDs for all exposed faces?"
309 bool zoneFlip =
false;
313 const faceZone& fZone = faceZones[zoneID];
340 else if (removedCell[nei])
342 if (newPatchID[faceI] == -1)
345 <<
"No patchID provided for exposed face " << faceI
346 <<
" on cell " << own <<
nl
347 <<
"Did you provide patch IDs for all exposed faces?"
357 bool zoneFlip =
false;
361 const faceZone& fZone = faceZones[zoneID];
393 if (newPatchID[faceI] != -1)
400 bool zoneFlip =
false;
404 const faceZone& fZone = faceZones[zoneID];
424 else if (removedCell[faceOwner[faceI]])
432 uncount(faces[faceI], nFacesUsingPoint);
444 if (newPatchID[faceI] != -1)
447 <<
"new patchID provided for boundary face " << faceI
448 <<
" even though it is not on a coupled face."
452 if (removedCell[faceOwner[faceI]])
460 uncount(faces[faceI], nFacesUsingPoint);
472 forAll(nFacesUsingPoint, pointI)
474 if (nFacesUsingPoint[pointI] == 0)
481 else if (nFacesUsingPoint[pointI] == 1)
484 <<
"point " << pointI <<
" at coordinate "
485 << mesh_.points()[pointI]
486 <<
" is only used by 1 face after removing cells."
487 <<
" This probably results in an illegal mesh."