32 void Foam::lduAddressing::calcLosort()
const
37 <<
"losort already calculated"
50 nNbrOfFace[nbr[nbrI]]++;
56 forAll(cellNbrFaces, celli)
58 cellNbrFaces[celli].setSize(nNbrOfFace[celli]);
67 cellNbrFaces[nbr[nbrI]][nNbrOfFace[nbr[nbrI]]] = nbrI;
69 nNbrOfFace[nbr[nbrI]]++;
73 losortPtr_ =
new labelList(nbr.size(), -1);
80 forAll(cellNbrFaces, celli)
82 const labelList& curNbr = cellNbrFaces[celli];
86 lst[lstI] = curNbr[curNbrI];
93 void Foam::lduAddressing::calcOwnerStart()
const
98 <<
"owner start already calculated"
104 ownerStartPtr_ =
new labelList(size() + 1, own.size());
115 label curOwn = own[facei];
117 if (curOwn > nOwnStart)
121 ownStart[i++] = facei;
130 void Foam::lduAddressing::calcLosortStart()
const
135 <<
"losort start already calculated"
139 losortStartPtr_ =
new labelList(size() + 1, 0);
149 label nLsrtStart = 0;
155 const label curNbr = nbr[lsrt[facei]];
157 if (curNbr > nLsrtStart)
161 lsrtStart[i++] = facei;
169 lsrtStart[size()] = nbr.size();
203 return *ownerStartPtr_;
209 if (!losortStartPtr_)
214 return *losortStartPtr_;
224 label startLabel = ownerStartAddr()[own];
226 label endLabel = ownerStartAddr()[own + 1];
230 for (
label i=startLabel; i<endLabel; i++)
232 if (neighbour[i] == nbr)
241 <<
"neighbour " << nbr <<
" not found for owner " << own <<
". "
242 <<
"Problem with addressing"
258 label own = owner[facei];
259 label nei = neighbour[facei];
263 cellBandwidth[nei] =
max(cellBandwidth[nei],
diff);
266 label bandwidth =
max(cellBandwidth);
269 scalar profile = 0.0;
270 forAll(cellBandwidth, celli)
272 profile += 1.0*cellBandwidth[celli];
#define forAll(list, i)
Loop across all elements in list.
A 2-tuple for storing two objects of different types.
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.
label size() const
Return number of equations.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
const labelUList & losortAddr() const
Return losort 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.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void deleteDemandDrivenData(DataType *&dataPtr)
errorManip< error > abort(error &err)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
List< labelList > labelListList
A List of labelList.
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
UList< label > labelUList