39 void Foam::slidingInterface::decoupleInterface
47 <<
": Decoupling sliding interface " <<
name() <<
endl;
55 <<
": Interface already decoupled." <<
endl;
75 faceZones[masterFaceZoneID_.
index()]();
78 faceZones[masterFaceZoneID_.
index()];
81 faceZones[masterFaceZoneID_.
index()].flipMap();
83 const labelList& masterFc = masterFaceCells();
87 forAll(masterPatchAddr, facei)
90 face newFace = faces[masterPatchAddr[facei]];
92 if (masterPatchFlip[facei])
102 masterPatchAddr[facei],
106 masterPatchID_.
index(),
108 masterFaceZoneID_.
index(),
124 faceZones[slaveFaceZoneID_.
index()]();
127 faceZones[slaveFaceZoneID_.
index()];
130 faceZones[slaveFaceZoneID_.
index()].flipMap();
132 const labelList& slaveFc = slaveFaceCells();
135 const Map<label>& rpm = retiredPointMap();
139 forAll(slavePatchAddr, facei)
142 face newFace = faces[slavePatchAddr[facei]];
144 if (slavePatchFlip[facei])
152 newFace[pointi] = rpm.lookup(newFace[pointi], newFace[pointi]);
160 slavePatchAddr[facei],
164 slavePatchID_.
index(),
166 slaveFaceZoneID_.
index(),
175 const labelList& masterStickOuts = masterStickOutFaces();
177 for (
const label curFaceID : masterStickOuts)
181 const face& oldFace = faces[curFaceID];
183 DynamicList<label> newFaceLabels(oldFace.size());
185 bool changed =
false;
190 if (
ref.pointRemoved(oldFace[pointi]))
197 newFaceLabels.append(oldFace[pointi]);
203 if (newFaceLabels.size() < 3)
206 <<
"Face " << curFaceID <<
" reduced to less than " 207 <<
"3 points. Topological/cutting error." <<
nl 208 <<
"Old face: " << oldFace <<
" new face: " << newFaceLabels
213 const label modifiedFaceZone = faceZones.whichZone(curFaceID);
215 const bool modifiedFaceZoneFlip =
217 modifiedFaceZone >= 0
219 faceZones[modifiedFaceZone].flipMap()
221 faceZones[modifiedFaceZone].whichFace(curFaceID)
227 newFace.transfer(newFaceLabels);
244 mesh.boundaryMesh().whichPatch(curFaceID),
260 for (
const label slaveFci : slaveFc)
264 for (
const label facei : curFaces)
270 faceZones.whichZone(facei)
271 != slaveFaceZoneID_.
index()
272 && !
ref.faceRemoved(facei)
275 slaveLayerCellFaceMap.insert(facei);
281 const labelList& slaveStickOuts = slaveStickOutFaces();
284 const Map<label>& masterPm = masterPatch.meshPointMap();
286 for (
const label curFaceID : slaveStickOuts)
290 const face& oldFace = faces[curFaceID];
292 DynamicList<label> newFaceLabels(oldFace.size());
294 bool changed =
false;
300 const label retiredPointi = rpm.lookup(oldFace[pointi], -1);
302 if (retiredPointi != -1)
311 newFaceLabels.append(retiredPointi);
313 else if (
ref.pointRemoved(oldFace[pointi]))
318 else if (masterPm.found(oldFace[pointi]))
325 newFaceLabels.append(oldFace[pointi]);
331 if (newFaceLabels.size() < 3)
334 <<
"Face " << curFaceID <<
" reduced to less than " 335 <<
"3 points. Topological/cutting error." <<
nl 336 <<
"Old face: " << oldFace <<
" new face: " << newFaceLabels
341 const label modifiedFaceZone =
342 faceZones.whichZone(curFaceID);
344 const bool modifiedFaceZoneFlip =
346 modifiedFaceZone >= 0
348 faceZones[modifiedFaceZone].flipMap()
350 faceZones[modifiedFaceZone].whichFace(curFaceID)
356 newFace.transfer(newFaceLabels);
373 mesh.boundaryMesh().whichPatch(curFaceID),
384 faceZones[slaveFaceZoneID_.
index()]().meshPoints();
386 for (
const label slavePointi : slaveMeshPoints)
395 mesh.pointZones().whichZone(slavePointi),
402 retiredPointMapPtr_->clear();
410 <<
": Finished decoupling sliding interface " <<
name() <<
endl;
ZoneMesh< faceZone, polyMesh > faceZoneMesh
A ZoneMesh with the type faceZone.
List< cell > cellList
List of cell.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
#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.
vectorField pointField
pointField is a vectorField.
errorManip< error > abort(error &err)
label index() const
The index of the first matching items, -1 if no matches.
int debug
Static debugging option.
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
A PrimitivePatch with List storage for the faces, const reference for the point field.
const polyTopoChanger & topoChanger() const
Return reference to morph engine.
const word & name() const
Return name of this modifier.
List< label > labelList
A List of labels.
const polyMesh & mesh() const
Return the mesh reference.
List< bool > boolList
A List of bools.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.