42bool Foam::layerAdditionRemoval::validCollapse()
const
49 Pout<<
"Checking layer collapse for object " <<
name() <<
endl;
58 label nBoundaryHits = 0;
75 Pout<<
"Finished checking layer collapse for object "
76 <<
name() <<
". Number of boundary-on-boundary hits: "
77 << nBoundaryHits <<
endl;
91void 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]];
label index() const
The index of the first matching items, -1 if no matches.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
const word & name() const
Return name of this modifier.
const polyTopoChanger & topoChanger() const
Return reference to morph engine.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const labelList & faceNeighbour() const
Return face neighbour.
const polyMesh & mesh() const
Return the mesh reference.
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
label nInternalFaces() const noexcept
Number of internal faces.
static const unsigned facesPerPoint_
Estimated number of faces per point.
const labelListList & pointFaces() const
static const unsigned facesPerCell_
Estimated number of faces per cell.
const cellList & cells() const
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< label > labelList
A List of labels.
List< cell > cellList
A List of cells.
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< labelList > labelListList
A List of labelList.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
List< bool > boolList
A List of bools.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
List< face > faceList
A List of faces.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.