42 bool Foam::layerAdditionRemoval::validCollapse()
const
49 Pout<<
"Checking layer collapse for object " <<
name() <<
endl;
58 label nBoundaryHits = 0;
64 !
mesh.isInternalFace(mf[facei])
65 && !
mesh.isInternalFace(ftc[facei])
75 Pout<<
"Finished checking layer collapse for object "
76 <<
name() <<
". Number of boundary-on-boundary hits: "
77 << nBoundaryHits <<
endl;
91 void Foam::layerAdditionRemoval::removeCellLayer
106 Pout<<
"Removing the cell layer for object " <<
name() <<
endl;
109 const polyMesh&
mesh = topoChanger().mesh();
123 label slaveSideCell = own[ftc[facei]];
129 slaveSideCell = nei[ftc[facei]];
132 ref.setAction(polyRemoveCell(mc[facei], slaveSideCell));
143 const cell& curCell =
cells[mc[celli]];
151 != faceZoneID_.index()
154 facesToRemoveMap.insert(curCell[facei]);
159 for (
const label facei : facesToRemoveMap)
161 ref.setAction(polyRemoveFace(facei));
167 ref.setAction(polyRemovePoint(ptc[pointi]));
177 Map<label> removedPointMap(2*ptc.size());
184 removedPointMap.insert(ptc[pointi], meshPoints[pointi]);
196 const labelList& curFaces = pf[ptc[pointi]];
200 if (!facesToRemoveMap.found(curFaces[facei]))
202 facesToModify.insert(curFaces[facei]);
211 Pout<<
"faces to modify: " << ftm <<
endl;
219 label curFaceID = ftm[facei];
221 face newFace(faces[curFaceID]);
225 const auto rpmIter = removedPointMap.cfind(newFace[pointi]);
230 newFace[pointi] = rpmIter();
236 Pout<<
"face label: " << curFaceID
237 <<
" old face: " << faces[curFaceID]
238 <<
" new face: " << newFace <<
endl;
243 bool modifiedFaceZoneFlip =
false;
245 if (modifiedFaceZone >= 0)
248 modifiedFaceZoneFlip = fz.flipMap()[fz.whichFace(curFaceID)];
251 label newNeighbour = -1;
255 newNeighbour = nei[curFaceID];
285 label masterSideCell = own[mf[facei]];
287 if (masterSideCell == mc[facei])
293 masterSideCell = nei[mf[facei]];
301 label slaveSideCell = own[ftc[facei]];
303 if (slaveSideCell == mc[facei])
309 slaveSideCell = nei[ftc[facei]];
319 label newNeighbour = -1;
320 bool flipFace =
false;
321 label newPatchID = -1;
322 label newZoneID = -1;
331 newOwner = slaveSideCell;
340 newOwner = slaveSideCell;
344 if (own[mf[facei]] == slaveSideCell)
362 newOwner =
min(masterSideCell, slaveSideCell);
363 newNeighbour =
max(masterSideCell, slaveSideCell);
365 if (newOwner == own[mf[facei]] || newNeighbour == nei[mf[facei]])
381 face newFace = faces[mf[facei]];
382 bool zoneFlip = mfFlip[facei];
387 zoneFlip = !zoneFlip;
392 Pout<<
"Modifying face " << mf[facei]
393 <<
" newFace: " << newFace <<
nl
394 <<
" newOwner: " << newOwner
395 <<
" newNeighbour: " << newNeighbour
396 <<
" flipFace: " << flipFace
397 <<
" newPatchID: " << newPatchID
398 <<
" newZoneID: " << newZoneID <<
nl
399 <<
" oldOwn: " << own[mf[facei]];
400 if (newPatchID == -1)
402 Pout<<
" oldNei: " << nei[mf[facei]];