28 #include "primitiveMesh.H"
61 Pout<<
"void attachDetach::attachInterface("
62 <<
"polyTopoChange& ref) const "
63 <<
" for object " <<
name() <<
" : "
64 <<
"Attaching interface" <<
endl;
72 const polyPatch& masterPatch =
mesh.boundaryMesh()[masterPatchID_.index()];
73 const polyPatch& slavePatch =
mesh.boundaryMesh()[slavePatchID_.index()];
75 const label masterPatchStart = masterPatch.
start();
76 const label slavePatchStart = slavePatch.
start();
80 const Map<label>& removedPointMap = pointMatchMap();
82 const labelList removedPoints = removedPointMap.toc();
84 forAll(removedPoints, pointI)
113 const boolList& mfFlip =
mesh.faceZones()[faceZoneID_.index()].flipMap();
115 forAll(masterFaceCells, faceI)
119 if (masterFaceCells[faceI] < slaveFaceCells[faceI])
125 faces[masterPatchStart + faceI],
126 masterPatchStart + faceI,
127 masterFaceCells[faceI],
128 slaveFaceCells[faceI],
145 masterPatchStart + faceI,
146 slaveFaceCells[faceI],
147 masterFaceCells[faceI],
163 slaveMeshPoints.
size()*primitiveMesh::facesPerPoint_
170 forAll(slaveMeshPoints, pointI)
172 const labelList& curFaces = pf[slaveMeshPoints[pointI]];
178 facesToModifyMap.
insert(curFaces[faceI]);
191 label curFaceID = ftm[faceI];
193 face newFace(faces[curFaceID]);
198 removedPointMap.find(newFace[pointI]);
200 if (rpmIter != removedPointMap.end())
203 newFace[pointI] = rpmIter();
213 label modifiedFaceZone =
mesh.faceZones().whichZone(curFaceID);
214 bool modifiedFaceZoneFlip =
false;
216 if (modifiedFaceZone >= 0)
218 modifiedFaceZoneFlip =
219 mesh.faceZones()[modifiedFaceZone].flipMap()
221 mesh.faceZones()[modifiedFaceZone].whichFace(curFaceID)
226 label patchID =
mesh.boundaryMesh().whichPatch(curFaceID);
230 neiCell = nei[curFaceID];
258 Pout<<
"void attachDetach::attachInterface("
259 <<
"polyTopoChange& ref) const "
260 <<
" for object " <<
name() <<
" : "
261 <<
"Finished attaching interface" <<
endl;
271 const Map<label>& removedPointMap = pointMatchMap();
273 const labelList removedPoints = removedPointMap.toc();
277 Pout<<
"void attachDetach::modifyMotionPoints("
278 <<
"pointField& motionPoints) const "
279 <<
" for object " <<
name() <<
" : "
280 <<
"Adjusting motion points." <<
endl;
283 scalar pointDiff = 0;
285 forAll(removedPoints, pointI)
290 motionPoints[removedPoints[pointI]]
291 - motionPoints[removedPointMap.find(removedPoints[pointI])()]
295 if (pointDiff > removedPoints.
size()*positionDifference_)
297 Pout<<
"Point motion difference = " << pointDiff <<
endl;
302 forAll(removedPoints, pointI)
304 motionPoints[removedPoints[pointI]] =
305 motionPoints[removedPointMap.find(removedPoints[pointI])()];