33void Foam::decompositionInformation::populate
35 const labelUList& adjncy,
36 const labelUList& xadj,
37 const labelUList& decomp,
44 distrib_.resize(nDomain);
49 subdist.resize(nDomain,
Zero);
53 const label numCells =
max(0, (xadj.size()-1));
55 for (label celli = 0; celli < numCells; ++celli)
57 const label ownProc = decomp[celli];
64 for (label i = xadj[celli]; i < xadj[celli+1]; ++i)
66 const label neiProc = decomp[adjncy[i]];
68 if (neiProc != ownProc)
84 const labelList& subdist = distrib_[ownProc];
86 cellsCount[ownProc] = subdist[ownProc];
90 const label
n = subdist[neiProc];
92 if (
n && ownProc != neiProc)
94 ++neighCount[ownProc];
95 facesCount[ownProc] +=
n;
100 const label n2 = (nDomains_ / 2);
103 cellsInfo_.min = cellsCount.first();
104 cellsInfo_.max = cellsCount.last();
105 cellsInfo_.median = cellsCount[n2];
108 neighInfo_.min = neighCount.first();
109 neighInfo_.max = neighCount.last();
110 neighInfo_.median = neighCount[n2];
113 facesInfo_.min = facesCount.first();
114 facesInfo_.max = facesCount.last();
115 facesInfo_.median = facesCount[n2];
132 populate(adjncy, xadj, decomp,
nDomains);
171 os <<
"Decomposition details with (proc faces) "
172 "for each processor connection" <<
nl <<
nl;
176 const labelList& subdist = distrib_[ownProc];
179 label neighCount = 0;
180 label facesCount = 0;
184 const label
n = subdist[neiProc];
186 if (
n && ownProc != neiProc)
193 os <<
"Part[" << ownProc <<
"] cells:" << subdist[ownProc]
194 <<
" neigh:" << neighCount
195 <<
" faces:" << facesCount;
204 const label
n = subdist[neiProc];
206 if (
n && ownProc != neiProc)
208 os <<
" (" << neiProc <<
' ' <<
n <<
')';
229 os <<
"min:" << this->
min
230 <<
" max:" << this->
max
231 <<
" median:" << this->median;
235 const scalar ratio = scalar(100*this->
max)/this->median;
237 os <<
" (" << ratio <<
"%)";
Various functions to operate on Lists.
A packed storage unstructured matrix of objects of type <T> using an offset table for access.
const List< T > & values() const noexcept
Return the packed matrix of values.
const labelList & offsets() const noexcept
Return the offset table (= size()+1)
void resize(const label len)
Adjust allocated size of list.
void clear()
Clear the list, i.e. set size to zero.
void print(Ostream &os) const
Print stream description.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
scalar print()
Print to screen.
OBJstream os(runTime.globalPath()/outputName)
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.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
void sort(UList< T > &list)
Sort the list.
static constexpr const zero Zero
Global zero (0)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.