35void Foam::lduAddressing::calcLosort()
const
40 <<
"losort already calculated"
53 nNbrOfFace[nbr[nbrI]]++;
59 forAll(cellNbrFaces, celli)
61 cellNbrFaces[celli].setSize(nNbrOfFace[celli]);
70 cellNbrFaces[nbr[nbrI]][nNbrOfFace[nbr[nbrI]]] = nbrI;
72 nNbrOfFace[nbr[nbrI]]++;
76 losortPtr_ =
new labelList(nbr.size(), -1);
83 forAll(cellNbrFaces, celli)
85 const labelList& curNbr = cellNbrFaces[celli];
89 lst[lstI] = curNbr[curNbrI];
96void Foam::lduAddressing::calcOwnerStart()
const
101 <<
"owner start already calculated"
107 ownerStartPtr_ =
new labelList(size() + 1, own.size());
118 label curOwn = own[facei];
120 if (curOwn > nOwnStart)
124 ownStart[i++] = facei;
133void Foam::lduAddressing::calcLosortStart()
const
138 <<
"losort start already calculated"
152 label nLsrtStart = 0;
158 const label curNbr = nbr[lsrt[facei]];
160 if (curNbr > nLsrtStart)
164 lsrtStart[i++] = facei;
172 lsrtStart[size()] = nbr.size();
206 return *ownerStartPtr_;
212 if (!losortStartPtr_)
217 return *losortStartPtr_;
231 label own =
min(a,
b);
233 label nbr =
max(a,
b);
235 label startLabel = ownerStartAddr()[own];
237 label endLabel = ownerStartAddr()[own + 1];
241 for (label i=startLabel; i<endLabel; i++)
243 if (neighbour[i] == nbr)
252 <<
"neighbour " << nbr <<
" not found for owner " << own <<
". "
253 <<
"Problem with addressing"
269 label own = owner[facei];
270 label nei = neighbour[facei];
273 label
diff = nei-own;
274 cellBandwidth[nei] =
max(cellBandwidth[nei],
diff);
277 label bandwidth =
max(cellBandwidth);
280 scalar profile = 0.0;
281 forAll(cellBandwidth, celli)
283 profile += 1.0*cellBandwidth[celli];
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
const labelUList & ownerStartAddr() const
Return owner start addressing.
virtual ~lduAddressing()
Destructor.
const labelUList & losortStartAddr() const
Return losort start addressing.
Tuple2< label, scalar > band() const
Calculate bandwidth and profile of addressing.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
label size() const
Return number of equations.
const labelUList & losortAddr() const
Return losort addressing.
void clearOut()
Clear additional addressing.
label triIndex(const label a, const label b) const
Return off-diagonal index given owner and neighbour label.
Template functions to aid in the implementation of demand driven data.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< label > labelList
A List of labels.
List< labelList > labelListList
A List of labelList.
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0)
UList< label > labelUList
A UList of labels.
void deleteDemandDrivenData(DataPtr &dataPtr)
#define forAll(list, i)
Loop across all elements in list.