37 void Foam::attachDetach::detachInterface
66 Pout<<
"void attachDetach::detachInterface(" 67 <<
"polyTopoChange& ref) const " 68 <<
" for object " <<
name() <<
" : " 69 <<
"Detaching interface" <<
endl;
81 if (faceLabels.size() > 0)
83 for (
label i = 1; i < faceLabels.size(); i++)
85 if (faceLabels[i] <= faceLabels[i-1])
88 <<
"faceZone " << meshZones[faceZoneID_.
index()].name()
89 <<
" does not have mesh face labels in" 90 <<
" increasing order." <<
endl 91 <<
"Face label " << faceLabels[i]
92 <<
" at position " << i
93 <<
" is smaller than the previous value " 104 meshZones[faceZoneID_.
index()]();
108 const labelList& mp = masterFaceLayer.meshPoints();
109 const edgeList& zoneLocalEdges = masterFaceLayer.edges();
111 const labelList& meshEdges = meshZones[faceZoneID_.
index()].meshEdges();
120 label nIntEdges = masterFaceLayer.nInternalEdges();
122 for (
label curEdgeID = nIntEdges; curEdgeID < meshEdges.size(); curEdgeID++)
124 const labelList& curFaces = meshEdgeFaces[meshEdges[curEdgeID]];
126 bool edgeIsInternal =
true;
130 if (!mesh.isInternalFace(curFaces[facei]))
133 edgeIsInternal =
false;
140 const edge& e = zoneLocalEdges[curEdgeID];
143 addedPoints[e.start()] = mp[e.start()];
144 addedPoints[e.end()] = mp[e.end()];
150 forAll(addedPoints, pointi)
152 if (addedPoints[pointi] < 0)
154 addedPoints[pointi] =
175 const boolList& mfFlip = meshZones[faceZoneID_.
index()].flipMap();
176 const faceList& zoneFaces = masterFaceLayer.localFaces();
178 const faceList& faces = mesh.faces();
180 const labelList& nei = mesh.faceNeighbour();
184 const label curFaceID = mf[facei];
187 const face oldFace = zoneFaces[facei].reverseFace();
189 face newFace(oldFace.size());
193 newFace[pointi] = addedPoints[oldFace[pointi]];
203 faces[curFaceID].reverseFace(),
208 masterPatchID_.
index(),
228 slavePatchID_.
index(),
255 masterPatchID_.
index(),
275 slavePatchID_.
index(),
308 mesh.faceZones()[faceZoneID_.
index()].masterCells();
312 const cellList& cells = mesh.cells();
316 const labelList& curFaces = cells[mc[celli]];
321 if (meshZones.whichZone(curFaces[facei]) != faceZoneID_.
index())
323 masterCellFaceMap.insert(curFaces[facei]);
336 mcMap.insert(mc[mcI]);
342 const labelList mcf = masterCellFaceMap.toc();
347 const label ownCell = own[mcf[mcfI]];
349 if (!mcMap.found(ownCell))
352 const cell& curFaces = cells[ownCell];
356 masterCellFaceMap.insert(curFaces[facei]);
361 if (mesh.isInternalFace(mcf[mcfI]))
363 const label neiCell = nei[mcf[mcfI]];
365 if (!mcMap.found(neiCell))
368 const cell& curFaces = cells[neiCell];
372 masterCellFaceMap.insert(curFaces[facei]);
380 Map<label> masterLayerPointMap(2*mp.size());
384 masterLayerPointMap.insert
392 const labelList masterCellFaces = masterCellFaceMap.toc();
394 forAll(masterCellFaces, facei)
399 const label curFaceID = masterCellFaces[facei];
401 const face& oldFace = faces[curFaceID];
403 face newFace(oldFace.size());
405 bool changed =
false;
409 if (masterLayerPointMap.found(oldFace[pointi]))
413 newFace[pointi] = masterLayerPointMap.find(oldFace[pointi])();
417 newFace[pointi] = oldFace[pointi];
424 if (mesh.isInternalFace(curFaceID))
460 mesh.boundaryMesh().whichPatch(curFaceID),
480 Pout<<
"void attachDetach::detachInterface(" 481 <<
"polyTopoChange& ref) const " 482 <<
" for object " <<
name() <<
" : " 483 <<
"Finished detaching interface" <<
endl;
List< labelList > labelListList
A List of labelList.
#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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< bool > boolList
Bool container classes.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
vectorField pointField
pointField is a vectorField.
List< label > labelList
A List of labels.
label index() const
Return index of first matching zone.
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
Foam::primitiveFacePatch.
MeshZones< faceZone, polyMesh > meshFaceZones
A MeshZones with the type faceZone.
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