45 label nGlobalInsert = 0;
71 label elem = listA[i];
73 if (elem != global0 && elem != global1)
90 result[resultI++] = global0;
94 result[resultI++] = global1;
101 label elem = listB[i];
103 if (elem != global0 && elem != global1)
105 result[resultI++] = elem;
113 label elem = listA[i];
115 if (elem != global0 && elem != global1)
119 result[resultI++] = elem;
124 if (resultI != result.size())
144 if (cCells[i] != globalI)
146 set.insert(cCells[i]);
152 if (pGlobals[i] != globalI)
154 set.insert(pGlobals[i]);
160 cCells[n++] = globalI;
164 cCells[n++] = iter.key();
179 if (pp.
coupled() || isA<emptyPolyPatch>(pp))
184 isValidBFace[bFacei++] =
false;
204 nCoupled += pp.size();
220 coupledFaces[nCoupled++] = facei++;
240 void Foam::cellToFaceStencil::unionEqOp::operator()
267 const label exclude0,
268 const label exclude1,
279 label facei = faceLabels[i];
282 if (globalOwn != exclude0 && globalOwn != exclude1)
284 globals.
insert(globalOwn);
287 if (
mesh().isInternalFace(facei))
290 if (globalNei != exclude0 && globalNei != exclude1)
292 globals.
insert(globalNei);
299 if (isValidBFace[bFacei])
307 if (globalI != exclude0 && globalI != exclude1)
335 return globals.
toc();
368 globalCellCells[own[facei]];
393 faceStencilSet.
clear();
395 const labelList& ownCCells = globalCellCells[own[facei]];
396 label globalOwn = ownCCells[0];
400 faceStencilSet.
insert(ownCCells[i]);
403 const labelList& neiCCells = globalCellCells[nei[facei]];
404 label globalNei = neiCCells[0];
408 faceStencilSet.
insert(neiCCells[i]);
414 faceStencil[facei][n++] = globalOwn;
415 faceStencil[facei][n++] = globalNei;
418 if (iter.key() != globalOwn && iter.key() != globalNei)
420 faceStencil[facei][n++] = iter.key();
435 faceStencilSet.
clear();
437 const labelList& ownCCells = globalCellCells[own[facei]];
438 label globalOwn = ownCCells[0];
441 faceStencilSet.
insert(ownCCells[i]);
447 label globalNei = neiCCells[0];
450 faceStencilSet.
insert(neiCCells[i]);
456 faceStencil[facei][n++] = globalOwn;
457 faceStencil[facei][n++] = globalNei;
460 if (iter.key() != globalOwn && iter.key() != globalNei)
462 faceStencil[facei][n++] = iter.key();
473 else if (!isA<emptyPolyPatch>(pp))
477 faceStencilSet.
clear();
479 const labelList& ownCCells = globalCellCells[own[facei]];
480 label globalOwn = ownCCells[0];
483 faceStencilSet.
insert(ownCCells[i]);
489 faceStencil[facei][n++] = globalOwn;
492 if (iter.key() != globalOwn)
494 faceStencil[facei][n++] = iter.key();
514 globalNumbering_(mesh_.nCells()+mesh_.nFaces()-mesh_.nInternalFaces())
const fvPatchList & patches
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
cellToFaceStencil(const polyMesh &)
Construct from mesh.
label findSortedIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element in sorted list and return index,.
void insertFaceCells(const label exclude0, const label exclude1, const boolList &nonEmptyFace, const labelList &faceLabels, labelHashSet &globals) const
Collect cell neighbours of faces in global numbering.
#define forAll(list, i)
Loop across all elements in list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
label nInternalFaces() const
virtual const labelList & faceNeighbour() const
Return face neighbour.
void size(const label)
Override size to be inconsistent with allocated storage.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
bool insert(const Key &key)
Insert a new entry.
label size() const
Return number of elements in table.
const globalIndex & globalNumbering() const
Global numbering for cells and boundary faces.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
void clear()
Clear all entries from table.
virtual const labelList & faceOwner() const
Return face owner.
errorManip< error > abort(error &err)
const polyMesh & mesh() const
void setSize(const label)
Reset size of List.
label toGlobal(const label i) const
From local to global.
label start() const
Return start label of this patch in the polyMesh face list.
void calcFaceStencil(const labelListList &globalCellCells, labelListList &faceStencil) const
Collect cell neighbours into extended stencil.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Mesh consisting of general polyhedral cells.
List< Key > toc() const
Return the table of contents.
A patch is a list of labels that address the faces in the global face list.
void validBoundaryFaces(boolList &isValidBFace) const
Valid boundary faces (not empty and not coupled)
labelList calcFaceCells(const boolList &nonEmptyFace, const labelList &faceLabels, labelHashSet &globals) const
Collect cell neighbours of faces in global numbering.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
static void merge(const label global0, const label global1, const labelList &listA, labelList &listB)
Merge two lists.
autoPtr< indirectPrimitivePatch > allCoupledFacesPatch() const
Return patch of all coupled faces.