39void Foam::attachDetach::detachInterface
68 Pout<<
"void attachDetach::detachInterface("
69 <<
"polyTopoChange& ref) const "
70 <<
" for object " <<
name() <<
" : "
71 <<
"Detaching interface" <<
endl;
90 <<
"faceZone " << zoneMesh[faceZoneID_.index()].name()
91 <<
" does not have mesh face labels in"
92 <<
" increasing order." <<
endl
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] =
175 const labelList& mf = zoneMesh[faceZoneID_.index()];
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(mp, addedPoints);
373 const labelList masterCellFaces = masterCellFaceMap.toc();
375 forAll(masterCellFaces, facei)
380 const label curFaceID = masterCellFaces[facei];
382 const face& oldFace = faces[curFaceID];
384 face newFace(oldFace.size());
386 bool changed =
false;
390 if (masterLayerPointMap.found(oldFace[pointi]))
394 newFace[pointi] = masterLayerPointMap.find(oldFace[pointi])();
398 newFace[pointi] = oldFace[pointi];
405 if (
mesh.isInternalFace(curFaceID))
441 mesh.boundaryMesh().whichPatch(curFaceID),
461 Pout<<
"void attachDetach::detachInterface("
462 <<
"polyTopoChange& ref) const "
463 <<
" for object " <<
name() <<
" : "
464 <<
"Finished detaching interface" <<
endl;
labelList faceLabels(nFaceLabels)
const word & name() const
Return name of this modifier.
const polyTopoChanger & topoChanger() const
Return reference to morph engine.
const polyMesh & mesh() const
Return the mesh reference.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const dimensionedScalar mp
Proton mass.
List< edge > edgeList
List of edge.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
ZoneMesh< faceZone, polyMesh > faceZoneMesh
A ZoneMesh with faceZone content on a polyMesh.
List< face > faceList
List of faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
A PrimitivePatch with List storage for the faces, const reference for the point field.
List< cell > cellList
List of cell.
List< bool > boolList
A List of bools.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
vectorField pointField
pointField is a vectorField.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.