35Foam::fvMeshPrimitiveLduAddressing::fvMeshPrimitiveLduAddressing
49 upperAddr_(
mesh.faceNeighbour()),
55Foam::fvMeshPrimitiveLduAddressing::fvMeshPrimitiveLduAddressing
65 lowerAddr_(std::move(lowerAddr)),
66 upperAddr_(std::move(upperAddr)),
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)
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);
156 localFaceCells[procI].setSize(nProcFaces[procI]);
157 remoteFaceCells[procI].setSize(nProcFaces[procI]);
161 nbrCellFaces.setSize(nbrCells.size());
166 faces.setSize(nbrs.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 setSize(label n)
Alias for resize().
A non-owning sub-view of a List (allocated or unallocated storage).
void size(const label n)
Older name for setAddressableSize.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Smooth ATC in cells next to a set of patches supplied by type.
virtual const labelUList & patchAddr(const label patchi) const
Return patch addressing for given patch.
static label triIndex(const lduAddressing &, const label, const label)
Return off-diagonal index given owner and neighbour label.
virtual const labelUList & lowerAddr() const noexcept
Return lower addressing (i.e. lower label = upper triangle).
virtual const lduSchedule & patchSchedule() const noexcept
Return patch field evaluation schedule.
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).
virtual const labelUList & upperAddr() const noexcept
Return upper addressing (i.e. upper label).
Mesh data needed to do the Finite Volume discretisation.
Calculates a non-overlapping list of offsets based on an input size (eg, number of cells) from differ...
label toLocal(const label proci, const label i) const
From global to local on proci.
label whichProcID(const label proci, const label i) const
Which processor does global id come from? Checks proci first (assumed to occur reasonably frequently)...
The class contains the addressing required by the lduMatrix: upper, lower and losort.
const labelUList & ownerStartAddr() const
Return owner start addressing.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
lduAddressing(const lduAddressing &)=delete
No copy construct.
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
label size() const noexcept
Return number of equations.
static labelList upperTriOrder(const label nCells, const labelUList &lower, const labelUList &upper)
Calculate upper-triangular order.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values within a list.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
List< lduScheduleEntry > lduSchedule
A List of lduSchedule entries.
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static constexpr const zero Zero
Global zero (0).
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.