42bool 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;
84void Foam::layerAdditionRemoval::removeCellLayer
99 Pout<<
"Removing the cell layer for object " <<
name() <<
endl;
116 label slaveSideCell = own[ftc[facei]];
122 slaveSideCell = nei[ftc[facei]];
144 != faceZoneID_.index()
147 facesToRemoveMap.insert(curCell[facei]);
152 for (
const label facei : facesToRemoveMap)
158 for (
const label pointi : ptc)
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]];
A HashTable to objects of type <T> with a label key.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
A cell is defined as a list of faces with extra functionality.
A subset of mesh faces organised as a primitive patch.
A face is a list of labels corresponding to mesh vertices.
label whichPatch(const label meshFacei) const
Return patch index for a given mesh face index. Uses binary search.
const word & name() const
Return name of this modifier.
const polyTopoChanger & topoChanger() const
Return reference to morph engine.
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
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.
virtual const labelList & faceNeighbour() const
Return face neighbour.
Class describing modification of a face.
Class containing data for cell removal.
Class containing data for face removal.
Class containing data for point removal.
Direct mesh changes based on v1.3 polyTopoChange syntax.
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
Namespace for handling debugging switches.
bool returnReduceOr(const bool value, const int communicator=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
List< face > faceList
List of faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< cell > cellList
List of cell.
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.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.