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;
84 void Foam::layerAdditionRemoval::removeCellLayer
99 Pout<<
"Removing the cell layer for object " <<
name() <<
endl;
102 const polyMesh&
mesh = topoChanger().mesh();
116 label slaveSideCell = own[ftc[facei]];
122 slaveSideCell = nei[ftc[facei]];
125 ref.setAction(polyRemoveCell(mc[facei], slaveSideCell));
136 const cell& curCell =
cells[mc[celli]];
144 != faceZoneID_.index()
147 facesToRemoveMap.insert(curCell[facei]);
152 for (
const label facei : facesToRemoveMap)
154 ref.setAction(polyRemoveFace(facei));
158 for (
const label pointi : ptc)
160 ref.setAction(polyRemovePoint(pointi));
173 Map<label> removedPointMap(ptc, meshPoints);
184 const labelList& curFaces = pf[ptc[pointi]];
188 if (!facesToRemoveMap.found(curFaces[facei]))
190 facesToModify.insert(curFaces[facei]);
199 Pout<<
"faces to modify: " << ftm <<
endl;
207 label curFaceID = ftm[facei];
209 face newFace(faces[curFaceID]);
213 const auto rpmIter = removedPointMap.cfind(newFace[pointi]);
218 newFace[pointi] = rpmIter();
224 Pout<<
"face label: " << curFaceID
225 <<
" old face: " << faces[curFaceID]
226 <<
" new face: " << newFace <<
endl;
231 bool modifiedFaceZoneFlip =
false;
233 if (modifiedFaceZone >= 0)
236 modifiedFaceZoneFlip = fz.flipMap()[fz.whichFace(curFaceID)];
239 label newNeighbour = -1;
243 newNeighbour = nei[curFaceID];
273 label masterSideCell = own[mf[facei]];
275 if (masterSideCell == mc[facei])
281 masterSideCell = nei[mf[facei]];
289 label slaveSideCell = own[ftc[facei]];
291 if (slaveSideCell == mc[facei])
297 slaveSideCell = nei[ftc[facei]];
307 label newNeighbour = -1;
308 bool flipFace =
false;
309 label newPatchID = -1;
310 label newZoneID = -1;
319 newOwner = slaveSideCell;
328 newOwner = slaveSideCell;
332 if (own[mf[facei]] == slaveSideCell)
350 newOwner =
min(masterSideCell, slaveSideCell);
351 newNeighbour =
max(masterSideCell, slaveSideCell);
353 if (newOwner == own[mf[facei]] || newNeighbour == nei[mf[facei]])
369 face newFace = faces[mf[facei]];
370 bool zoneFlip = mfFlip[facei];
375 zoneFlip = !zoneFlip;
380 Pout<<
"Modifying face " << mf[facei]
381 <<
" newFace: " << newFace <<
nl 382 <<
" newOwner: " << newOwner
383 <<
" newNeighbour: " << newNeighbour
384 <<
" flipFace: " << flipFace
385 <<
" newPatchID: " << newPatchID
386 <<
" newZoneID: " << newZoneID <<
nl 387 <<
" oldOwn: " << own[mf[facei]];
388 if (newPatchID == -1)
390 Pout<<
" oldNei: " << nei[mf[facei]];
List< cell > cellList
List of cell.
virtual const labelList & faceNeighbour() const
Return face neighbour.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const cellList & cells() const
List< labelList > labelListList
List of labelList.
static const unsigned facesPerPoint_
Estimated number of faces per point.
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
#define forAll(list, i)
Loop across all elements in list.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
List< face > faceList
List of faces.
static const unsigned facesPerCell_
Estimated number of faces per cell.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
virtual const labelList & faceOwner() const
Return face owner.
label nInternalFaces() const noexcept
Number of internal faces.
virtual const faceList & faces() const
Return raw faces.
label whichPatch(const label meshFacei) const
Return patch index for a given mesh face index. Uses binary search.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
label index() const
The index of the first matching items, -1 if no matches.
int debug
Static debugging option.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
const polyTopoChanger & topoChanger() const
Return reference to morph engine.
const word & name() const
Return name of this modifier.
const labelListList & pointFaces() const
List< label > labelList
A List of labels.
const polyMesh & mesh() const
Return the mesh reference.
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
List< bool > boolList
A List of bools.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.