Go to the documentation of this file.
28 #include "primitiveMesh.H"
66 Pout<<
"void attachDetach::detachInterface("
67 <<
"polyTopoChange& ref) const "
68 <<
" for object " <<
name() <<
" : "
69 <<
"Detaching interface" <<
endl;
80 const labelList& faceLabels = zoneMesh[faceZoneID_.index()];
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 "
110 const labelList& meshEdges = zoneMesh[faceZoneID_.index()].meshEdges();
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] =
173 const labelList& mf = zoneMesh[faceZoneID_.index()];
174 const boolList& mfFlip = zoneMesh[faceZoneID_.index()].flipMap();
183 const label curFaceID = mf[faceI];
186 const face oldFace = zoneFaces[faceI].reverseFace();
192 newFace[pointI] = addedPoints[oldFace[pointI]];
207 masterPatchID_.index(),
227 slavePatchID_.index(),
254 masterPatchID_.index(),
274 slavePatchID_.index(),
307 mesh.faceZones()[faceZoneID_.index()].masterCells();
320 if (zoneMesh.
whichZone(curFaces[faceI]) != faceZoneID_.index())
322 masterCellFaceMap.
insert(curFaces[faceI]);
346 const label ownCell = own[mcf[mcfI]];
348 if (!mcMap.
found(ownCell))
355 masterCellFaceMap.
insert(curFaces[faceI]);
360 if (
mesh.isInternalFace(mcf[mcfI]))
362 const label neiCell = nei[mcf[mcfI]];
364 if (!mcMap.
found(neiCell))
371 masterCellFaceMap.
insert(curFaces[faceI]);
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];
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;
const dimensionedScalar mp
Proton mass.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
List< Key > toc() const
Return the table of contents.
#define forAll(list, i)
Loop across all elements in list.
Direct mesh changes based on v1.3 polyTopoChange syntax.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Class describing modification of a face.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Mesh consisting of general polyhedral cells.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
void detachInterface(polyTopoChange &) const
Detach interface.
bool found(const Key &) const
Return true if hashedEntry is found in table.
errorManipArg< error, int > exit(error &err, const int errNo=1)
label nInternalEdges() const
Number of internal edges.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
prefixOSstream Pout(cout, "Pout")
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const dimensionedScalar e
Elementary charge.
bool insert(const Key &key)
Insert a new entry.
Class containing data for point addition.
A face addition data class. A face can be inflated either from a point or from another face and can e...
const List< Face > & localFaces() const
Return patch faces addressing into local point list.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
A cell is defined as a list of faces with extra functionality.
faceType reverseFace(const faceType &f)
reverse the face
word name(const complex &)
Return a string representation of a complex.
A list of faces which address into the list of points.