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 " << zoneMesh[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 " 107 const labelList& mp = masterFaceLayer.meshPoints();
108 const edgeList& zoneLocalEdges = masterFaceLayer.edges();
110 const labelList& meshEdges = zoneMesh[faceZoneID_.
index()].meshEdges();
119 label nIntEdges = masterFaceLayer.nInternalEdges();
121 for (
label curEdgeID = nIntEdges; curEdgeID < meshEdges.size(); curEdgeID++)
123 const labelList& curFaces = meshEdgeFaces[meshEdges[curEdgeID]];
125 bool edgeIsInternal =
true;
129 if (!mesh.isInternalFace(curFaces[facei]))
132 edgeIsInternal =
false;
139 const edge& e = zoneLocalEdges[curEdgeID];
142 addedPoints[e.start()] = mp[e.start()];
143 addedPoints[e.end()] = mp[e.end()];
149 forAll(addedPoints, pointi)
151 if (addedPoints[pointi] < 0)
153 addedPoints[pointi] =
174 const boolList& mfFlip = zoneMesh[faceZoneID_.
index()].flipMap();
175 const faceList& zoneFaces = masterFaceLayer.localFaces();
177 const faceList& faces = mesh.faces();
179 const labelList& nei = mesh.faceNeighbour();
183 const label curFaceID = mf[facei];
186 const face oldFace = zoneFaces[facei].reverseFace();
188 face newFace(oldFace.size());
192 newFace[pointi] = addedPoints[oldFace[pointi]];
202 faces[curFaceID].reverseFace(),
207 masterPatchID_.
index(),
227 slavePatchID_.
index(),
254 masterPatchID_.
index(),
274 slavePatchID_.
index(),
307 mesh.faceZones()[faceZoneID_.
index()].masterCells();
311 const cellList& cells = mesh.cells();
315 const labelList& curFaces = cells[mc[celli]];
320 if (zoneMesh.whichZone(curFaces[facei]) != faceZoneID_.
index())
322 masterCellFaceMap.insert(curFaces[facei]);
335 mcMap.insert(mc[mcI]);
341 const labelList mcf = masterCellFaceMap.toc();
346 const label ownCell = own[mcf[mcfI]];
348 if (!mcMap.found(ownCell))
351 const cell& curFaces = cells[ownCell];
355 masterCellFaceMap.insert(curFaces[facei]);
360 if (mesh.isInternalFace(mcf[mcfI]))
362 const label neiCell = nei[mcf[mcfI]];
364 if (!mcMap.found(neiCell))
367 const cell& curFaces = cells[neiCell];
371 masterCellFaceMap.insert(curFaces[facei]);
379 Map<label> masterLayerPointMap(2*mp.size());
383 masterLayerPointMap.insert
391 const labelList masterCellFaces = masterCellFaceMap.toc();
393 forAll(masterCellFaces, facei)
398 const label curFaceID = masterCellFaces[facei];
400 const face& oldFace = faces[curFaceID];
402 face newFace(oldFace.size());
404 bool changed =
false;
408 if (masterLayerPointMap.found(oldFace[pointi]))
412 newFace[pointi] = masterLayerPointMap.find(oldFace[pointi])();
416 newFace[pointi] = oldFace[pointi];
423 if (mesh.isInternalFace(curFaceID))
459 mesh.boundaryMesh().whichPatch(curFaceID),
479 Pout<<
"void attachDetach::detachInterface(" 480 <<
"polyTopoChange& ref) const " 481 <<
" for object " <<
name() <<
" : " 482 <<
"Finished detaching interface" <<
endl;
List< labelList > labelListList
A List of labelList.
ZoneMesh< faceZone, polyMesh > faceZoneMesh
A ZoneMesh with the type faceZone.
#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.
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