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;
List< labelList > labelListList
A List of labelList.
ZoneMesh< faceZone, polyMesh > faceZoneMesh
A ZoneMesh with the type faceZone.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< face > faceList
A List of faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
#define forAll(list, i)
Loop across all elements in list.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
List< edge > edgeList
A List of edges.
label index() const
The index of the first matching items, -1 if no matches.
int debug
Static debugging option.
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
A PrimitivePatch with List storage for the faces, const reference for the point field.
const polyTopoChanger & topoChanger() const
Return reference to morph engine.
const word & name() const
Return name of this modifier.
List< label > labelList
A List of labels.
const polyMesh & mesh() const
Return the mesh reference.
List< bool > boolList
A List of bools.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
List< cell > cellList
A List of cells.
const dimensionedScalar mp
Proton mass.