Go to the documentation of this file.
48 label nGlobalInsert = 0;
72 for (
const label elem : listA)
74 if (elem != global0 && elem != global1)
84 labelList result(listB.size() + nGlobalInsert + nInsert);
91 result[resultI++] = global0;
95 result[resultI++] = global1;
100 for (
const label elem : listB)
102 if (elem != global0 && elem != global1)
104 result[resultI++] = elem;
110 for (
const label elem : listA)
112 if (elem != global0 && elem != global1)
116 result[resultI++] = elem;
121 if (resultI != result.size())
127 listB.transfer(result);
141 if (cCells[i] != globalI)
149 if (pGlobals[i] != globalI)
157 cCells[
n++] = globalI;
159 for (
const label seti : set)
170 isValidBFace.
setSize(
mesh().nBoundaryFaces(),
true);
176 if (pp.
coupled() || isA<emptyPolyPatch>(pp))
181 isValidBFace[bFacei++] =
false;
201 nCoupled += pp.size();
217 coupledFaces[nCoupled++] = facei++;
234 void Foam::cellToFaceStencil::unionEqOp::operator()
258 const label exclude0,
259 const label exclude1,
270 label facei = faceLabels[i];
272 label globalOwn = globalNumbering().toGlobal(own[facei]);
273 if (globalOwn != exclude0 && globalOwn != exclude1)
275 globals.
insert(globalOwn);
278 if (
mesh().isInternalFace(facei))
280 label globalNei = globalNumbering().toGlobal(nei[facei]);
281 if (globalNei != exclude0 && globalNei != exclude1)
283 globals.
insert(globalNei);
290 if (isValidBFace[bFacei])
292 label globalI = globalNumbering().toGlobal
298 if (globalI != exclude0 && globalI != exclude1)
326 return globals.
toc();
339 const label nBnd = mesh_.nBoundaryFaces();
340 const labelList& own = mesh_.faceOwner();
341 const labelList& nei = mesh_.faceNeighbour();
358 neiGlobalCellCells[facei-mesh_.nInternalFaces()] =
359 globalCellCells[own[facei]];
378 faceStencil.
setSize(mesh_.nFaces());
382 for (
label facei = 0; facei < mesh_.nInternalFaces(); facei++)
384 faceStencilSet.
clear();
386 const labelList& ownCCells = globalCellCells[own[facei]];
387 label globalOwn = ownCCells[0];
388 faceStencilSet.
insert(ownCCells);
390 const labelList& neiCCells = globalCellCells[nei[facei]];
391 label globalNei = neiCCells[0];
392 faceStencilSet.
insert(neiCCells);
397 faceStencil[facei][
n++] = globalOwn;
398 faceStencil[facei][
n++] = globalNei;
399 for (
const label stencili : faceStencilSet)
401 if (stencili != globalOwn && stencili != globalNei)
403 faceStencil[facei][
n++] = stencili;
418 faceStencilSet.
clear();
420 const labelList& ownCCells = globalCellCells[own[facei]];
421 label globalOwn = ownCCells[0];
422 faceStencilSet.
insert(ownCCells);
426 neiGlobalCellCells[facei-mesh_.nInternalFaces()];
427 label globalNei = neiCCells[0];
428 faceStencilSet.
insert(neiCCells);
433 faceStencil[facei][
n++] = globalOwn;
434 faceStencil[facei][
n++] = globalNei;
435 for (
const label stencili : faceStencilSet)
437 if (stencili != globalOwn && stencili != globalNei)
439 faceStencil[facei][
n++] = stencili;
450 else if (!isA<emptyPolyPatch>(pp))
454 faceStencilSet.
clear();
456 const labelList& ownCCells = globalCellCells[own[facei]];
457 label globalOwn = ownCCells[0];
458 faceStencilSet.
insert(ownCCells);
463 faceStencil[facei][
n++] = globalOwn;
464 for (
const label stencili : faceStencilSet)
466 if (stencili != globalOwn)
468 faceStencil[facei][
n++] = stencili;
488 globalNumbering_(mesh_.nCells()+mesh_.nBoundaryFaces())
cellToFaceStencil(const polyMesh &)
Construct from mesh.
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
label size() const noexcept
The number of elements in table.
void validBoundaryFaces(boolList &isValidBFace) const
Valid boundary faces (not empty and not coupled)
const polyMesh & mesh() const
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
List< Key > toc() const
The table of contents (the keys) in unsorted order.
label nInternalFaces() const
Number of internal faces.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A patch is a list of labels that address the faces in the global face list.
virtual const labelList & faceOwner() const
Return face owner.
A List with indirect addressing.
static void merge(const label global0, const label global1, const labelList &listA, labelList &listB)
Merge two lists.
label findSortedIndex(const ListType &input, typename ListType::const_reference val, const label start=0)
autoPtr< indirectPrimitivePatch > allCoupledFacesPatch() const
Return patch of all coupled faces.
void calcFaceStencil(const labelListList &globalCellCells, labelListList &faceStencil) const
Collect cell neighbours into extended stencil.
errorManip< error > abort(error &err)
label start() const
Return start label of this patch in the polyMesh face list.
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.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void clear()
Clear all entries from table.
labelList calcFaceCells(const boolList &nonEmptyFace, const labelList &faceLabels, labelHashSet &globals) const
Collect cell neighbours of faces in global numbering.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
const polyBoundaryMesh & patches
void setSize(const label newSize)
Alias for resize(const label)
virtual const labelList & faceNeighbour() const
Return face neighbour.