42void Foam::domainDecomposition::addInterProcFace
45 const label ownerProc,
48 List<Map<label>>& nbrToInterPatch,
49 List<DynamicList<DynamicList<label>>>& interPatchFaces
53 const label ownerIndex = facei+1;
54 const label nbrIndex = -(facei+1);
56 const auto patchiter = nbrToInterPatch[ownerProc].cfind(nbrProc);
61 const label toNbrProcPatchi = *patchiter;
62 interPatchFaces[ownerProc][toNbrProcPatchi].append(ownerIndex);
66 label toOwnerProcPatchi = nbrToInterPatch[nbrProc][ownerProc];
67 interPatchFaces[nbrProc][toOwnerProcPatchi].append(nbrIndex);
73 const label toNbrProcPatchi = nbrToInterPatch[ownerProc].size();
74 nbrToInterPatch[ownerProc].insert(nbrProc, toNbrProcPatchi);
76 DynamicList<label> oneFace;
77 oneFace.append(ownerIndex);
78 interPatchFaces[ownerProc].append(oneFace);
82 label toOwnerProcPatchi = nbrToInterPatch[nbrProc].size();
83 nbrToInterPatch[nbrProc].insert(ownerProc, toOwnerProcPatchi);
85 oneFace.append(nbrIndex);
86 interPatchFaces[nbrProc].append(oneFace);
100 Info<<
"\nCalculating original mesh data" <<
endl;
106 const labelList& neighbour = faceNeighbour();
111 Info<<
"\nDistributing cells to processors" <<
endl;
116 Info<<
"\nDistributing faces to processors" <<
endl;
123 procFaceAddressing_.setSize(nProcs_);
128 if (cellToProc_[owner[facei]] == cellToProc_[neighbour[facei]])
131 procFaceAddressing_[cellToProc_[owner[facei]]].append(facei+1);
137 forAll(procPatchSize_, proci)
140 procPatchStartIndex_[proci].setSize(
patches.
size());
146 forAll(procPatchSize_, proci)
148 procPatchSize_[proci][patchi] = 0;
149 procPatchStartIndex_[proci][patchi] =
150 procFaceAddressing_[proci].size();
163 forAll(patchFaceCells, facei)
165 const label curProc = cellToProc_[patchFaceCells[facei]];
168 procFaceAddressing_[curProc].append(patchStart+facei+1);
171 procPatchSize_[curProc][patchi]++;
184 pp.neighbPatch().faceCells();
186 forAll(patchFaceCells, facei)
188 const label curProc = cellToProc_[patchFaceCells[facei]];
189 const label nbrProc = cellToProc_[nbrPatchFaceCells[facei]];
190 if (curProc == nbrProc)
193 procFaceAddressing_[curProc].append(patchStart+facei+1);
195 procPatchSize_[curProc][patchi]++;
215 label ownerProc = cellToProc_[owner[facei]];
216 label nbrProc = cellToProc_[neighbour[facei]];
218 if (ownerProc != nbrProc)
237 forAll(interPatchFaces, proci)
239 label nInterfaces = interPatchFaces[proci].size();
241 subPatchIDs[proci].setSize(nInterfaces,
labelList(1, label(-1)));
242 subPatchStarts[proci].setSize(nInterfaces,
labelList(1,
Zero));
316 forAll(procNbrToInterPatch, proci)
318 label nInterfaces = procNbrToInterPatch[proci].size();
320 procNeighbourProcessors_[proci].setSize(nInterfaces);
321 procProcessorPatchSize_[proci].setSize(nInterfaces);
322 procProcessorPatchStartIndex_[proci].setSize(nInterfaces);
323 procProcessorPatchSubPatchIDs_[proci].setSize(nInterfaces);
324 procProcessorPatchSubPatchStarts_[proci].setSize(nInterfaces);
329 const Map<label>& curNbrToInterPatch = procNbrToInterPatch[proci];
330 labelList nbrs = curNbrToInterPatch.toc();
335 interPatchFaces[proci];
339 const label nbrProc = nbrs[i];
340 const label interPatch = curNbrToInterPatch[nbrProc];
342 procNeighbourProcessors_[proci][i] = nbrProc;
343 procProcessorPatchSize_[proci][i] =
344 curInterPatchFaces[interPatch].
size();
345 procProcessorPatchStartIndex_[proci][i] =
346 procFaceAddressing_[proci].size();
349 subPatchStarts[proci][interPatch].append
351 curInterPatchFaces[interPatch].size()
353 procProcessorPatchSubPatchIDs_[proci][i].transfer
355 subPatchIDs[proci][interPatch]
357 procProcessorPatchSubPatchStarts_[proci][i].transfer
359 subPatchStarts[proci][interPatch]
375 curInterPatchFaces[interPatch];
377 forAll(interPatchFaces, j)
379 procFaceAddressing_[proci].
append(interPatchFaces[j]);
381 interPatchFaces.clearStorage();
383 curInterPatchFaces.clearStorage();
384 procFaceAddressing_[proci].shrink();
431 Info<<
"\nDistributing points to processors" <<
endl;
437 forAll(procPointAddressing_, proci)
442 for (
const label facei : procFaceAddressing_[proci])
448 pointsInUse.set(facePoints);
451 procPointAddressing_[proci] = pointsInUse.sortedToc();
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A HashTable to objects of type <T> with a label key.
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The number of entries in the list.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
void decomposeMesh()
Decompose mesh.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
UPtrList< const labelUList > faceCells() const
Return a list of faceCells for each patch.
label start() const noexcept
The start label of boundary faces in the polyMesh face list.
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
const polyBoundaryMesh & patches
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
List< face > faceList
List of faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
static constexpr const zero Zero
Global zero (0).
labelListList invertOneToMany(const label len, const labelUList &map)
Invert one-to-many map. Unmapped elements will be size 0.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.