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())
104 currentCell = nextCell.removeHead();
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());
138 nextCell.append(nbrs[i]);
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())
229 currentCell = nextCell.removeHead();
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]);
263 nextCell.append(nbrs[i]);
#define forAll(list, i)
Loop across all elements in list.
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
Template class for non-intrusive linked lists.
void size(const label)
Override size to be inconsistent with allocated storage.
Various functions to operate on Lists.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
The bandCompression function renumbers the addressing such that the band of the matrix is reduced...
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
static const label labelMax
labelList bandCompression(const labelListList &addressing)
Renumbers the addressing to reduce the band of the matrix.
void clear()
Clear the addressed list, i.e. set the size to zero.
Non-intrusive singly-linked list.