41 const label nLocalCoarse,
73 const label own = agglom[faceOwner[facei]];
74 const label nei = agglom[faceNeigh[facei]];
82 if (
pp.coupled() && (
parallel || !isA<processorPolyPatch>(
pp)))
86 for (
const label facei :
pp.range())
88 const label own = agglom[faceOwner[facei]];
89 const label globalNei = globalNeighbour[bFacei];
93 !globalAgglom.
isLocal(myProci, globalNei)
94 || globalAgglom.
toLocal(myProci, globalNei) != own
119 const label own = agglom[faceOwner[facei]];
120 const label nei = agglom[faceNeigh[facei]];
122 const label ownIndex = offsets[own] + nFacesPerCell[own]++;
123 const label neiIndex = offsets[nei] + nFacesPerCell[nei]++;
125 m[ownIndex] = globalAgglom.
toGlobal(myProci, nei);
126 m[neiIndex] = globalAgglom.
toGlobal(myProci, own);
132 if (
pp.coupled() && (
parallel || !isA<processorPolyPatch>(
pp)))
136 for (
const label facei :
pp.range())
138 const label own = agglom[faceOwner[facei]];
139 const label globalNei = globalNeighbour[bFacei];
143 !globalAgglom.
isLocal(myProci, globalNei)
144 || globalAgglom.
toLocal(myProci, globalNei) != own
147 const label ownIndex = offsets[own] + nFacesPerCell[own]++;
149 m[ownIndex] = globalNei;
165 if (!cellCells.
empty())
173 label startIndex = offsets[0];
175 const label nCellCells = cellCells.
size();
177 for (label celli = 0; celli < nCellCells; ++celli)
183 const label
self = globalAgglom.
toGlobal(myProci, celli);
188 const label endIndex = offsets[celli+1];
190 for (label i = startIndex; i < endIndex; ++i)
192 if (nbrCells.
insert(m[i]))
198 startIndex = endIndex;
199 offsets[celli+1] = newIndex;
226 const label nLocalCoarse,
259 const label own = agglom[faceOwner[facei]];
260 const label nei = agglom[faceNeigh[facei]];
262 ++nFacesPerCell[own];
263 ++nFacesPerCell[nei];
266 for (
const polyPatch&
pp :
pbm)
268 if (
pp.coupled() && (parallel || !isA<processorPolyPatch>(
pp)))
272 for (
const label facei :
pp.range())
274 const label own = agglom[faceOwner[facei]];
275 const label globalNei = globalNeighbour[bFacei];
279 !globalAgglom.
isLocal(myProci, globalNei)
280 || globalAgglom.
toLocal(myProci, globalNei) != own
283 ++nFacesPerCell[own];
307 const label own = agglom[faceOwner[facei]];
308 const label nei = agglom[faceNeigh[facei]];
310 const label ownIndex = offsets[own] + nFacesPerCell[own]++;
311 const label neiIndex = offsets[nei] + nFacesPerCell[nei]++;
313 m[ownIndex] = globalAgglom.
toGlobal(myProci, nei);
314 m[neiIndex] = globalAgglom.
toGlobal(myProci, own);
317 w[neiIndex] = w[ownIndex];
321 for (
const polyPatch&
pp :
pbm)
323 if (
pp.coupled() && (parallel || !isA<processorPolyPatch>(
pp)))
327 for (
const label facei :
pp.range())
329 const label own = agglom[faceOwner[facei]];
330 const label globalNei = globalNeighbour[bFacei];
334 !globalAgglom.
isLocal(myProci, globalNei)
335 || globalAgglom.
toLocal(myProci, globalNei) != own
338 const label ownIndex = offsets[own] + nFacesPerCell[own]++;
340 m[ownIndex] = globalNei;
357 if (!cellCells.
empty())
366 label startIndex = offsets[0];
368 const label nCellCells = cellCells.
size();
370 for (label celli = 0; celli < nCellCells; ++celli)
372 const label
self = globalAgglom.
toGlobal(myProci, celli);
375 nbrCells.insert(
self);
377 const label endIndex = offsets[celli+1];
379 for (label i = startIndex; i < endIndex; ++i)
381 if (nbrCells.insert(m[i]))
388 startIndex = endIndex;
389 offsets[celli+1] = newIndex;
label toLocal(const label proci, const label i) const
From global to local on proci.
List< scalar > scalarList
List of scalar.
const polyBoundaryMesh & pbm
const labelList & offsets() const noexcept
Return the offset table (= size()+1)
bool empty() const noexcept
True if the number of rows/sublists is zero.
label size() const noexcept
The primary size (the number of rows/sublists)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void resize(const label len)
Adjust allocated size of list.
virtual const labelList & faceNeighbour() const
Return face neighbour.
static void calcCellCells(const polyMesh &mesh, const labelList &agglom, const label nLocalCoarse, const bool parallel, CompactListList< label > &cellCells)
Determine (local or global) cellCells from mesh agglomeration.
bool parallel() const noexcept
Does the mesh contain processor patches? (also valid when not running parallel)
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
void inplaceToGlobal(const label proci, labelUList &labels) const
From local to global index on proci (inplace)
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
void clear()
Remove all entries from table.
virtual const labelList & faceOwner() const
Return face owner.
label nInternalFaces() const noexcept
Number of internal faces.
bool isLocal(const label proci, const label i) const
Is on processor proci.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
A packed storage of objects of type <T> using an offset table for access.
label toGlobal(const label proci, const label i) const
From local to global on proci.
const vectorField & faceAreas() const
const List< T > & values() const noexcept
Return the packed values.
void resize_nocopy(const label mRows, const label nVals)
Redimension without preserving existing content.
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
A patch is a list of labels that address the faces in the global face list.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const polyMesh & mesh() const noexcept
Return the mesh reference.
const labelList::subList faceOwner() const
Return face owner for the entire boundary.
static constexpr const zero Zero
Global zero (0)