36 void Foam::slidingInterface::decoupleInterface
43 Pout<<
"void slidingInterface::decoupleInterface(" 44 <<
"polyTopoChange& ref) const : " 45 <<
"Decoupling sliding interface " <<
name() <<
endl;
52 Pout<<
"void slidingInterface::decoupleInterface(" 53 <<
"polyTopoChange& ref) const : " 54 <<
"Interface already decoupled." <<
endl;
64 const faceList& faces = mesh.faces();
65 const cellList& cells = mesh.cells();
68 const labelList& nei = mesh.faceNeighbour();
73 mesh.faceZones()[masterFaceZoneID_.
index()]();
76 mesh.faceZones()[masterFaceZoneID_.
index()];
79 mesh.faceZones()[masterFaceZoneID_.
index()].flipMap();
81 const labelList& masterFc = masterFaceCells();
85 forAll(masterPatchAddr, facei)
88 face newFace = faces[masterPatchAddr[facei]];
90 if (masterPatchFlip[facei])
100 masterPatchAddr[facei],
104 masterPatchID_.
index(),
106 masterFaceZoneID_.
index(),
122 mesh.faceZones()[slaveFaceZoneID_.
index()]();
125 mesh.faceZones()[slaveFaceZoneID_.
index()];
128 mesh.faceZones()[slaveFaceZoneID_.
index()].flipMap();
130 const labelList& slaveFc = slaveFaceCells();
133 const Map<label>& rpm = retiredPointMap();
137 forAll(slavePatchAddr, facei)
140 face newFace = faces[slavePatchAddr[facei]];
142 if (slavePatchFlip[facei])
151 if (rpmIter != rpm.end())
158 newFace[pointi] = rpmIter();
167 slavePatchAddr[facei],
171 slavePatchID_.
index(),
173 slaveFaceZoneID_.
index(),
182 const labelList& masterStickOuts = masterStickOutFaces();
184 forAll(masterStickOuts, facei)
188 const label curFaceID = masterStickOuts[facei];
190 const face& oldFace = faces[curFaceID];
192 DynamicList<label> newFaceLabels(oldFace.size());
194 bool changed =
false;
199 if (ref.pointRemoved(oldFace[pointi]))
206 newFaceLabels.append(oldFace[pointi]);
212 if (newFaceLabels.size() < 3)
215 <<
"Face " << curFaceID <<
" reduced to less than " 216 <<
"3 points. Topological/cutting error." <<
nl 217 <<
"Old face: " << oldFace <<
" new face: " << newFaceLabels
222 label modifiedFaceZone = mesh.faceZones().whichZone(curFaceID);
223 bool modifiedFaceZoneFlip =
false;
225 if (modifiedFaceZone >= 0)
227 modifiedFaceZoneFlip =
228 mesh.faceZones()[modifiedFaceZone].flipMap()
230 mesh.faceZones()[modifiedFaceZone].whichFace(curFaceID)
235 newFace.transfer(newFaceLabels);
252 mesh.boundaryMesh().whichPatch(curFaceID),
270 const labelList& curFaces = cells[slaveFc[facei]];
278 mesh.faceZones().whichZone(curFaces[facei])
279 != slaveFaceZoneID_.
index()
280 && !ref.faceRemoved(curFaces[facei])
284 slaveLayerCellFaceMap.insert(curFaces[facei]);
290 const labelList& slaveStickOuts = slaveStickOutFaces();
293 const Map<label>& masterPm = masterPatch.meshPointMap();
295 forAll(slaveStickOuts, facei)
299 const label curFaceID = slaveStickOuts[facei];
301 const face& oldFace = faces[curFaceID];
303 DynamicList<label> newFaceLabels(oldFace.size());
305 bool changed =
false;
310 if (rpm.found(oldFace[pointi]))
319 newFaceLabels.append(rpm.find(oldFace[pointi])());
321 else if (ref.pointRemoved(oldFace[pointi]))
326 else if (masterPm.found(oldFace[pointi]))
333 newFaceLabels.append(oldFace[pointi]);
339 if (newFaceLabels.size() < 3)
342 <<
"Face " << curFaceID <<
" reduced to less than " 343 <<
"3 points. Topological/cutting error." <<
nl 344 <<
"Old face: " << oldFace <<
" new face: " << newFaceLabels
349 label modifiedFaceZone = mesh.faceZones().whichZone(curFaceID);
350 bool modifiedFaceZoneFlip =
false;
352 if (modifiedFaceZone >= 0)
354 modifiedFaceZoneFlip =
355 mesh.faceZones()[modifiedFaceZone].flipMap()
357 mesh.faceZones()[modifiedFaceZone].whichFace(curFaceID)
362 newFace.transfer(newFaceLabels);
379 mesh.boundaryMesh().whichPatch(curFaceID),
392 mesh.faceZones()[slaveFaceZoneID_.
index()]().meshPoints();
394 forAll(slaveMeshPoints, pointi)
400 slaveMeshPoints[pointi],
401 points[slaveMeshPoints[pointi]],
403 mesh.pointZones().whichZone(slaveMeshPoints[pointi]),
410 retiredPointMapPtr_->
clear();
417 Pout<<
"void slidingInterface::coupleInterface(" 418 <<
"polyTopoChange& ref) const : " 419 <<
"Finished decoupling sliding interface " <<
name() <<
endl;
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
HashTable< label, label, Hash< label > >::const_iterator const_iterator
List< bool > boolList
Bool container classes.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
static const unsigned facesPerCell_
Estimated number of faces per cell.
vectorField pointField
pointField is a vectorField.
void clear()
Clear all entries from table.
List< label > labelList
A List of labels.
errorManip< error > abort(error &err)
label index() const
Return index of first matching zone.
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
Foam::primitiveFacePatch.
const polyTopoChanger & topoChanger() const
Return reference to morph engine.
prefixOSstream Pout(cout, "Pout")
const word & name() const
Return name of this modifier.
const polyMesh & mesh() const
Return the mesh reference.
List< cell > cellList
list of cells