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)
143 set.insert(cCells[i]);
149 if (pGlobals[i] != globalI)
151 set.insert(pGlobals[i]);
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();
213 label facei = pp.
start();
217 coupledFaces[nCoupled++] = facei++;
236 const label exclude0,
237 const label exclude1,
248 label facei = faceLabels[i];
250 label globalOwn = globalNumbering().toGlobal(own[facei]);
251 if (globalOwn != exclude0 && globalOwn != exclude1)
253 globals.
insert(globalOwn);
256 if (
mesh().isInternalFace(facei))
258 label globalNei = globalNumbering().toGlobal(nei[facei]);
259 if (globalNei != exclude0 && globalNei != exclude1)
261 globals.
insert(globalNei);
268 if (isValidBFace[bFacei])
270 label globalI = globalNumbering().toGlobal
276 if (globalI != exclude0 && globalI != exclude1)
304 return globals.
toc();
317 const label nBnd = mesh_.nBoundaryFaces();
318 const labelList& own = mesh_.faceOwner();
319 const labelList& nei = mesh_.faceNeighbour();
332 label facei = pp.
start();
336 neiGlobalCellCells[facei-mesh_.nInternalFaces()] =
337 globalCellCells[own[facei]];
356 faceStencil.
setSize(mesh_.nFaces());
360 for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
362 faceStencilSet.
clear();
364 const labelList& ownCCells = globalCellCells[own[facei]];
365 label globalOwn = ownCCells[0];
366 faceStencilSet.
insert(ownCCells);
368 const labelList& neiCCells = globalCellCells[nei[facei]];
369 label globalNei = neiCCells[0];
370 faceStencilSet.
insert(neiCCells);
375 faceStencil[facei][
n++] = globalOwn;
376 faceStencil[facei][
n++] = globalNei;
377 for (
const label stencili : faceStencilSet)
379 if (stencili != globalOwn && stencili != globalNei)
381 faceStencil[facei][
n++] = stencili;
390 label facei = pp.
start();
396 faceStencilSet.
clear();
398 const labelList& ownCCells = globalCellCells[own[facei]];
399 label globalOwn = ownCCells[0];
400 faceStencilSet.
insert(ownCCells);
404 neiGlobalCellCells[facei-mesh_.nInternalFaces()];
405 label globalNei = neiCCells[0];
406 faceStencilSet.
insert(neiCCells);
411 faceStencil[facei][
n++] = globalOwn;
412 faceStencil[facei][
n++] = globalNei;
413 for (
const label stencili : faceStencilSet)
415 if (stencili != globalOwn && stencili != globalNei)
417 faceStencil[facei][
n++] = stencili;
428 else if (!isA<emptyPolyPatch>(pp))
432 faceStencilSet.
clear();
434 const labelList& ownCCells = globalCellCells[own[facei]];
435 label globalOwn = ownCCells[0];
436 faceStencilSet.
insert(ownCCells);
441 faceStencil[facei][
n++] = globalOwn;
442 for (
const label stencili : faceStencilSet)
444 if (stencili != globalOwn)
446 faceStencil[facei][
n++] = stencili;
466 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)
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
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.
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.