39 void Foam::attachDetach::detachInterface
68 Pout<<
"void attachDetach::detachInterface("
69 <<
"polyTopoChange& ref) const "
70 <<
" for object " <<
name() <<
" : "
71 <<
"Detaching interface" <<
endl;
83 if (faceLabels.size() > 0)
85 for (label i = 1; i < faceLabels.size(); i++)
87 if (faceLabels[i] <= faceLabels[i-1])
90 <<
"faceZone " << zoneMesh[faceZoneID_.
index()].name()
91 <<
" does not have mesh face labels in"
92 <<
" increasing order." <<
endl
93 <<
"Face label " << faceLabels[i]
94 <<
" at position " << i
95 <<
" is smaller than the previous value "
109 const labelList&
mp = masterFaceLayer.meshPoints();
110 const edgeList& zoneLocalEdges = masterFaceLayer.edges();
112 const labelList& meshEdges = zoneMesh[faceZoneID_.
index()].meshEdges();
121 label nIntEdges = masterFaceLayer.nInternalEdges();
123 for (label curEdgeID = nIntEdges; curEdgeID < meshEdges.size(); curEdgeID++)
125 const labelList& curFaces = meshEdgeFaces[meshEdges[curEdgeID]];
127 bool edgeIsInternal =
true;
131 if (!
mesh.isInternalFace(curFaces[facei]))
134 edgeIsInternal =
false;
141 const edge&
e = zoneLocalEdges[curEdgeID];
144 addedPoints[
e.start()] =
mp[
e.start()];
145 addedPoints[
e.end()] =
mp[
e.end()];
151 forAll(addedPoints, pointi)
153 if (addedPoints[pointi] < 0)
155 addedPoints[pointi] =
176 const boolList& mfFlip = zoneMesh[faceZoneID_.
index()].flipMap();
177 const faceList& zoneFaces = masterFaceLayer.localFaces();
185 const label curFaceID = mf[facei];
188 const face oldFace = zoneFaces[facei].reverseFace();
190 face newFace(oldFace.size());
194 newFace[pointi] = addedPoints[oldFace[pointi]];
204 faces[curFaceID].reverseFace(),
209 masterPatchID_.
index(),
229 slavePatchID_.
index(),
256 masterPatchID_.
index(),
276 slavePatchID_.
index(),
309 mesh.faceZones()[faceZoneID_.
index()].masterCells();
322 if (zoneMesh.whichZone(curFaces[facei]) != faceZoneID_.
index())
324 masterCellFaceMap.insert(curFaces[facei]);
339 const labelList mcf = masterCellFaceMap.toc();
344 const label ownCell = own[mcf[mcfI]];
346 if (!mcMap.found(ownCell))
349 const cell& curFaces =
cells[ownCell];
350 masterCellFaceMap.insert(curFaces);
354 if (
mesh.isInternalFace(mcf[mcfI]))
356 const label neiCell = nei[mcf[mcfI]];
358 if (!mcMap.found(neiCell))
361 const cell& curFaces =
cells[neiCell];
362 masterCellFaceMap.insert(curFaces);
369 Map<label> masterLayerPointMap(2*
mp.size());
373 masterLayerPointMap.insert
381 const labelList masterCellFaces = masterCellFaceMap.toc();
383 forAll(masterCellFaces, facei)
388 const label curFaceID = masterCellFaces[facei];
390 const face& oldFace = faces[curFaceID];
392 face newFace(oldFace.size());
394 bool changed =
false;
398 if (masterLayerPointMap.found(oldFace[pointi]))
402 newFace[pointi] = masterLayerPointMap.find(oldFace[pointi])();
406 newFace[pointi] = oldFace[pointi];
413 if (
mesh.isInternalFace(curFaceID))
449 mesh.boundaryMesh().whichPatch(curFaceID),
469 Pout<<
"void attachDetach::detachInterface("
470 <<
"polyTopoChange& ref) const "
471 <<
" for object " <<
name() <<
" : "
472 <<
"Finished detaching interface" <<
endl;