33 void Foam::decompositionInformation::populate
43 distrib_.resize_nocopy(nDomain);
47 subdist.resize_nocopy(nDomain);
52 const label numCells =
Foam::max(0, (xadj.size()-1));
54 for (label celli = 0; celli < numCells; ++celli)
56 const label ownProc = decomp[celli];
63 for (label i = xadj[celli]; i < xadj[celli+1]; ++i)
65 const label neiProc = decomp[adjncy[i]];
67 if (neiProc != ownProc)
83 const labelList& subdist = distrib_[ownProc];
85 cellsCount[ownProc] = subdist[ownProc];
89 const label
n = subdist[neiProc];
91 if (
n && ownProc != neiProc)
93 ++neighCount[ownProc];
94 facesCount[ownProc] +=
n;
99 const label n2 = (nDomains_ / 2);
102 cellsInfo_.min = cellsCount.first();
103 cellsInfo_.max = cellsCount.last();
104 cellsInfo_.median = cellsCount[n2];
107 neighInfo_.min = neighCount.first();
108 neighInfo_.max = neighCount.last();
109 neighInfo_.median = neighCount[n2];
112 facesInfo_.min = facesCount.first();
113 facesInfo_.max = facesCount.last();
114 facesInfo_.median = facesCount[n2];
120 Foam::decompositionInformation::decompositionInformation
131 populate(adjncy, xadj, decomp, nDomains);
135 Foam::decompositionInformation::decompositionInformation
145 populate(cellCells.
values(), cellCells.
offsets(), decomp, nDomains);
170 os <<
"Decomposition details with (proc faces) " 171 "for each processor connection" <<
nl <<
nl;
175 const labelList& subdist = distrib_[ownProc];
178 label neighCount = 0;
179 label facesCount = 0;
183 const label
n = subdist[neiProc];
185 if (
n && ownProc != neiProc)
192 os <<
"Part[" << ownProc <<
"] cells:" << subdist[ownProc]
193 <<
" neigh:" << neighCount
194 <<
" faces:" << facesCount;
203 const label
n = subdist[neiProc];
205 if (
n && ownProc != neiProc)
207 os <<
" (" << neiProc <<
' ' <<
n <<
')';
228 os <<
"min:" << this->
min 229 <<
" max:" << this->
max 230 <<
" median:" << this->median;
234 const scalar ratio = scalar(100*this->
max)/this->median;
236 os <<
" (" << ratio <<
"%)";
const labelList & offsets() const noexcept
Return the offset table (= size()+1)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Ostream & print(Ostream &os, UIntType value, char off='0', char on='1')
Print 0/1 bits in the (unsigned) integral type.
constexpr char nl
The newline '\n' character (0x0a)
void print(Ostream &os) const override
Print stream description.
UList< label > labelUList
A UList of labels.
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
void sort(UList< T > &list)
Sort the list.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
A packed storage of objects of type <T> using an offset table for access.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
const List< T > & values() const noexcept
Return the packed values.
List< label > labelList
A List of labels.