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)
152 if (pGlobals[i] != globalI)
160 cCells[
n++] = globalI;
164 cCells[
n++] = iter.key();
173 isValidBFace.
setSize(mesh().nFaces()-mesh().nInternalFaces(),
true);
179 if (pp.
coupled() || isA<emptyPolyPatch>(pp))
181 label bFacei = pp.
start()-mesh().nInternalFaces();
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,
274 const labelList& own = mesh().faceOwner();
275 const labelList& nei = mesh().faceNeighbour();
279 label facei = faceLabels[i];
281 label globalOwn = globalNumbering().toGlobal(own[facei]);
282 if (globalOwn != exclude0 && globalOwn != exclude1)
284 globals.
insert(globalOwn);
287 if (mesh().isInternalFace(facei))
289 label globalNei = globalNumbering().toGlobal(nei[facei]);
290 if (globalNei != exclude0 && globalNei != exclude1)
292 globals.
insert(globalNei);
297 label bFacei = facei-mesh().nInternalFaces();
299 if (isValidBFace[bFacei])
301 label globalI = globalNumbering().toGlobal
307 if (globalI != exclude0 && globalI != exclude1)
335 return globals.
toc();
348 const label nBnd = mesh_.nFaces()-mesh_.nInternalFaces();
349 const labelList& own = mesh_.faceOwner();
350 const labelList& nei = mesh_.faceNeighbour();
367 neiGlobalCellCells[facei-mesh_.nInternalFaces()] =
368 globalCellCells[own[facei]];
387 faceStencil.
setSize(mesh_.nFaces());
391 for (
label facei = 0; facei < mesh_.nInternalFaces(); 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]);
446 neiGlobalCellCells[facei-mesh_.nInternalFaces()];
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())
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
bool insert(const Key &key)
Insert a new entry.
List< Key > toc() const
Return the table of contents.
label size() const
Return number of elements in table.
void clear()
Clear all entries from table.
A List with indirect addressing.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
label size() const
Return the number of elements in the UList.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
cellToFaceStencil(const polyMesh &)
Construct from mesh.
autoPtr< indirectPrimitivePatch > allCoupledFacesPatch() const
Return patch of all coupled faces.
void calcFaceStencil(const labelListList &globalCellCells, labelListList &faceStencil) const
Collect cell neighbours into extended stencil.
void validBoundaryFaces(boolList &isValidBFace) const
Valid boundary faces (not empty and not coupled)
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.
static void merge(const label global0, const label global1, const labelList &listA, labelList &listB)
Merge two lists.
labelList calcFaceCells(const boolList &nonEmptyFace, const labelList &faceLabels, labelHashSet &globals) const
Collect cell neighbours of faces in global numbering.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
label start() const
Return start label of this patch in the polyMesh face list.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const fvPatchList & patches
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManip< error > abort(error &err)
label findSortedIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element in sorted list and return index,.