101 const labelList& faceOwner = mesh_.faceOwner();
102 const labelList& faceNeighbour = mesh_.faceNeighbour();
107 for (label facei = 0; facei < mesh_.nInternalFaces(); ++facei)
109 const label own = faceOwner[facei];
110 const label nei = faceNeighbour[facei];
112 if (!removedCell[own])
114 ++nCellsUsingFace[facei];
116 if (!removedCell[nei])
118 ++nCellsUsingFace[facei];
122 for (label facei = mesh_.nInternalFaces(); facei < mesh_.nFaces(); ++facei)
124 const label own = faceOwner[facei];
126 if (!removedCell[own])
128 ++nCellsUsingFace[facei];
139 mesh_.nBoundaryFaces(),
140 mesh_.nInternalFaces()
143 syncTools::syncBoundaryFaceList
164 for (label facei = 0; facei < mesh_.nInternalFaces(); ++facei)
166 if (nCellsUsingFace[facei] == 1)
168 exposedFaces.
append(facei);
178 label facei = pp.start();
182 const label own = faceOwner[facei];
184 if (nCellsUsingFace[facei] == 1 && !removedCell[own])
188 exposedFaces.
append(facei);
196 return exposedFaces.shrink();
202 const bitSet& removedCell,
210 if (exposedFaceLabels.
size() != exposedPatchIDs.
size())
213 <<
"Size of exposedFaceLabels " << exposedFaceLabels.
size()
214 <<
" differs from size of exposedPatchIDs "
215 << exposedPatchIDs.
size()
220 labelList newPatchID(mesh_.nFaces(), -1);
222 forAll(exposedFaceLabels, i)
224 const label facei = exposedFaceLabels[i];
225 const label patchi = exposedPatchIDs[i];
227 if (patchi < 0 || patchi >=
patches.size())
230 <<
"Invalid patch " << patchi
231 <<
" for exposed face " << facei <<
nl
232 <<
"Valid patches 0.." <<
patches.size()-1
239 <<
"Trying to put exposed face " << facei
240 <<
" into a coupled patch : " <<
patches[patchi].name()
242 <<
"This is illegal."
246 newPatchID[facei] = patchi;
251 for (
const label celli : removedCell)
263 const faceList& faces = mesh_.faces();
264 const labelList& faceOwner = mesh_.faceOwner();
265 const labelList& faceNeighbour = mesh_.faceNeighbour();
272 for (
const face&
f : faces)
274 incrCount(
f, nFacesUsingPoint);
278 for (label facei = 0; facei < mesh_.nInternalFaces(); ++facei)
280 const face&
f = faces[facei];
281 const label own = faceOwner[facei];
282 const label nei = faceNeighbour[facei];
284 if (removedCell[own])
286 if (removedCell[nei])
293 decrCount(
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;
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;
387 label facei = pp.start();
391 if (newPatchID[facei] != -1)
398 bool zoneFlip =
false;
422 else if (removedCell[faceOwner[facei]])
430 decrCount(faces[facei], nFacesUsingPoint);
438 label facei = pp.start();
442 if (newPatchID[facei] != -1)
445 <<
"new patchID provided for boundary face " << facei
446 <<
" even though it is not on a coupled face."
450 if (removedCell[faceOwner[facei]])
458 decrCount(faces[facei], nFacesUsingPoint);
470 forAll(nFacesUsingPoint, pointi)
472 if (nFacesUsingPoint[pointi] == 0)
479 else if (nFacesUsingPoint[pointi] == 1)
482 <<
"point " << pointi <<
" at coordinate "
483 << mesh_.points()[pointi]
484 <<
" is only used by 1 face after removing cells."
485 <<
" This probably results in an illegal mesh."
497 bitSet removeCell(mesh_.nCells(), cellsToRemove);
499 return getExposedFaces(removeCell);
511 bitSet removedCell(mesh_.nCells(), cellsToRemove);