35 Foam::fvMeshPrimitiveLduAddressing::fvMeshPrimitiveLduAddressing
49 upperAddr_(
mesh.faceNeighbour()),
51 patchSchedule_(
mesh.globalData().patchSchedule())
55 Foam::fvMeshPrimitiveLduAddressing::fvMeshPrimitiveLduAddressing
65 lowerAddr_(
std::move(lowerAddr)),
66 upperAddr_(
std::move(upperAddr)),
67 patchAddr_(patchAddr),
81 const label own =
min(a,
b);
82 const label nbr =
max(a,
b);
89 for (label i = begLabel; i < endLabel; ++i)
91 if (neighbour[i] == nbr)
102 const lduAddressing& addr,
108 const globalIndex& globalNumbering,
114 label nCells = addr.
size();
115 label nFaces = addr.upperAddr().size();
125 if (nbrs[nbrI] < nCells)
128 if (triIndex(addr, cellI, nbrs[nbrI]) == -1)
135 label globalNbr = globalCellIDs[nbrs[nbrI]];
136 label procI = globalNumbering.whichProcID(globalNbr);
143 newLowerAddr.setSize(nFaces + nExtraFaces);
144 newUpperAddr.setSize(nFaces + nExtraFaces);
147 SubList<label>(newLowerAddr, nFaces) = addr.lowerAddr();
148 SubList<label>(newUpperAddr, nFaces) = addr.upperAddr();
156 localFaceCells[procI].setSize(nProcFaces[procI]);
157 remoteFaceCells[procI].setSize(nProcFaces[procI]);
161 nbrCellFaces.setSize(nbrCells.size());
170 label nbrCellI = nbrs[nbrI];
172 if (nbrCellI < nCells)
175 label faceI = triIndex(addr, cellI, nbrCellI);
179 newLowerAddr[faceI] =
min(cellI, nbrCellI);
180 newUpperAddr[faceI] =
max(cellI, nbrCellI);
189 label globalNbr = globalCellIDs[nbrCellI];
190 label procI = globalNumbering.whichProcID(globalNbr);
191 label remoteCellI = globalNumbering.toLocal(procI, globalNbr);
193 label procFaceI = nProcFaces[procI]++;
194 localFaceCells[procI][procFaceI] = cellI;
195 remoteFaceCells[procI][procFaceI] = remoteCellI;
215 forAll(nbrCellFaces, cellI)
void size(const label n)
Older name for setAddressableSize.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
static label triIndex(const lduAddressing &, const label, const label)
Return off-diagonal index given owner and neighbour label.
Smooth ATC in cells next to a set of patches supplied by type.
List< labelList > labelListList
List of labelList.
#define forAll(list, i)
Loop across all elements in list.
static labelList addAddressing(const lduAddressing &addr, const labelListList &nbrCells, label &nExtraFaces, labelList &lower, labelList &upper, labelListList &nbrCellFaces, const globalIndex &, const labelList &globalCellIDs, labelListList &localFaceCells, labelListList &remoteFaceCells)
Given additional addressing (in the form of additional neighbour cells, i.e. like cellCells) ...
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
void setSize(const label n)
Alias for resize()
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
virtual const labelUList & upperAddr() const =0
Return upper addressing.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
Mesh data needed to do the Finite Volume discretisation.
The class contains the addressing required by the lduMatrix: upper, lower and losort.
List< label > labelList
A List of labels.
const labelUList & ownerStartAddr() const
Return owner start addressing.
static labelList upperTriOrder(const label nCells, const labelUList &lower, const labelUList &upper)
Calculate upper-triangular order.
static constexpr const zero Zero
Global zero (0)