Go to the documentation of this file.
46 label nGlobalInsert = 0;
72 label elem = listA[i];
74 if (elem != global0 && elem != global1)
91 result[resultI++] = global0;
95 result[resultI++] = global1;
102 label elem = listB[i];
104 if (elem != global0 && elem != global1)
106 result[resultI++] = elem;
114 label elem = listA[i];
116 if (elem != global0 && elem != global1)
120 result[resultI++] = elem;
125 if (resultI != result.
size())
146 if (cCells[i] != globalI)
154 if (pGlobals[i] != globalI)
162 cCells[
n++] = globalI;
166 cCells[
n++] = iter.key();
181 if (pp.
coupled() || isA<emptyPolyPatch>(pp))
186 isValidBFace[bFaceI++] =
false;
206 nCoupled += pp.size();
222 coupledFaces[nCoupled++] = faceI++;
242 void Foam::cellToFaceStencil::unionEqOp::operator()
269 const label exclude0,
270 const label exclude1,
281 label faceI = faceLabels[i];
283 label globalOwn = globalNumbering().toGlobal(own[faceI]);
284 if (globalOwn != exclude0 && globalOwn != exclude1)
286 globals.
insert(globalOwn);
289 if (
mesh().isInternalFace(faceI))
291 label globalNei = globalNumbering().toGlobal(nei[faceI]);
292 if (globalNei != exclude0 && globalNei != exclude1)
294 globals.
insert(globalNei);
301 if (isValidBFace[bFaceI])
303 label globalI = globalNumbering().toGlobal
309 if (globalI != exclude0 && globalI != exclude1)
337 return globals.
toc();
349 const label nBnd = mesh_.nFaces()-mesh_.nInternalFaces();
350 const labelList& own = mesh_.faceOwner();
351 const labelList& nei = mesh_.faceNeighbour();
368 neiGlobalCellCells[faceI-mesh_.nInternalFaces()] =
369 globalCellCells[own[faceI]];
388 faceStencil.
setSize(mesh_.nFaces());
392 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
394 faceStencilSet.
clear();
396 const labelList& ownCCells = globalCellCells[own[faceI]];
397 label globalOwn = ownCCells[0];
401 faceStencilSet.
insert(ownCCells[i]);
404 const labelList& neiCCells = globalCellCells[nei[faceI]];
405 label globalNei = neiCCells[0];
409 faceStencilSet.
insert(neiCCells[i]);
415 faceStencil[faceI][
n++] = globalOwn;
416 faceStencil[faceI][
n++] = globalNei;
419 if (iter.key() != globalOwn && iter.key() != globalNei)
421 faceStencil[faceI][
n++] = iter.key();
436 faceStencilSet.
clear();
438 const labelList& ownCCells = globalCellCells[own[faceI]];
439 label globalOwn = ownCCells[0];
442 faceStencilSet.
insert(ownCCells[i]);
447 neiGlobalCellCells[faceI-mesh_.nInternalFaces()];
448 label globalNei = neiCCells[0];
451 faceStencilSet.
insert(neiCCells[i]);
457 faceStencil[faceI][
n++] = globalOwn;
458 faceStencil[faceI][
n++] = globalNei;
461 if (iter.key() != globalOwn && iter.key() != globalNei)
463 faceStencil[faceI][
n++] = iter.key();
474 else if (!isA<emptyPolyPatch>(pp))
478 faceStencilSet.
clear();
480 const labelList& ownCCells = globalCellCells[own[faceI]];
481 label globalOwn = ownCCells[0];
484 faceStencilSet.
insert(ownCCells[i]);
490 faceStencil[faceI][
n++] = globalOwn;
493 if (iter.key() != globalOwn)
495 faceStencil[faceI][
n++] = iter.key();
515 globalNumbering_(mesh_.nCells()+mesh_.nFaces()-mesh_.nInternalFaces())
cellToFaceStencil(const polyMesh &)
Construct from mesh.
void validBoundaryFaces(boolList &isValidBFace) const
Valid boundary faces (not empty and not coupled)
const polyMesh & mesh() const
List< Key > toc() const
Return the table of contents.
#define forAll(list, i)
Loop across all elements in list.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Mesh consisting of general polyhedral cells.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
label findSortedIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element in sorted list and return index,.
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, const label, const labelList &, labelList &)
Merge two lists.
label size() const
Return number of elements in table.
label nInternalFaces() const
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.
void setSize(const label)
Reset size of List.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void clear()
Clear all entries from table.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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.
void size(const label)
Override size to be inconsistent with allocated storage.
virtual const labelList & faceNeighbour() const
Return face neighbour.
A list of faces which address into the list of points.