51 label cellInOrder = 0;
68 label currentCell = -1;
76 if (cellCellAddressing[celli].size() < minWeight)
78 minWeight = cellCellAddressing[celli].
size();
85 if (currentCell == -1)
95 nextCell.
append(currentCell);
102 while (nextCell.size())
106 if (!visited[currentCell])
108 visited[currentCell] = 1;
111 newOrder[cellInOrder] = currentCell;
115 const labelList& neighbours = cellCellAddressing[currentCell];
125 label nbr = neighbours[nI];
130 weights.
append(cellCellAddressing[nbr].size());
158 label start = offsets[celli];
159 label end = offsets[celli+1];
161 for (
label facei = start; facei < end; facei++)
164 numNbrs[cellCells[facei]]++;
176 label cellInOrder = 0;
193 label currentCell = -1;
201 if (numNbrs[celli] < minWeight)
203 minWeight = numNbrs[celli];
210 if (currentCell == -1)
220 nextCell.
append(currentCell);
227 while (nextCell.size())
231 if (!visited[currentCell])
233 visited[currentCell] = 1;
236 newOrder[cellInOrder] = currentCell;
245 label start = offsets[currentCell];
246 label end = offsets[currentCell+1];
248 for (
label facei = start; facei < end; facei++)
250 label nbr = cellCells[facei];
255 weights.
append(numNbrs[nbr]);
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Various functions to operate on Lists.
Non-intrusive singly-linked list.
#define forAll(list, i)
Loop across all elements in list.
The bandCompression function renumbers the addressing such that the band of the matrix is reduced....
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
void clear()
Clear the addressed list, i.e. set the size to zero.
Template class for non-intrusive linked lists.
T removeHead()
Remove and return head.
void append(const T &a)
Add at tail of list.
void size(const label)
Override size to be inconsistent with allocated storage.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
int order(const scalar s)
labelList bandCompression(const labelListList &addressing)
Renumbers the addressing to reduce the band of the matrix.
static const label labelMax
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.