Go to the documentation of this file.
33 void Foam::decompositionInformation::populate
44 distrib_.setSize(nDomain);
49 subdist.setSize(nDomain,
Zero);
52 const label nCells = xadj.size()-1;
53 for (
label celli = 0; celli < nCells; ++celli)
55 const label ownProc = decomp[celli];
62 for (
label i = xadj[celli]; i < xadj[celli+1]; ++i)
64 const label neiProc = decomp[adjncy[i]];
66 if (neiProc != ownProc)
82 const labelList& subdist = distrib_[ownProc];
84 cellsCount[ownProc] = subdist[ownProc];
88 const label n = subdist[neiProc];
90 if (
n && ownProc != neiProc)
92 ++neighCount[ownProc];
93 facesCount[ownProc] +=
n;
98 const label n2 = (nDomains_ / 2);
101 cellsInfo_.min = cellsCount.first();
102 cellsInfo_.max = cellsCount.last();
103 cellsInfo_.median = cellsCount[n2];
106 neighInfo_.min = neighCount.first();
107 neighInfo_.max = neighCount.last();
108 neighInfo_.median = neighCount[n2];
111 facesInfo_.min = facesCount.first();
112 facesInfo_.max = facesCount.last();
113 facesInfo_.median = facesCount[n2];
119 Foam::decompositionInformation::decompositionInformation
130 populate(adjncy, xadj, decomp, nDomains);
134 Foam::decompositionInformation::decompositionInformation
144 populate(cellCells.
m(), cellCells.
offsets(), decomp, nDomains);
161 os <<
"Cells "; cellsInfo_.
print(os) <<
nl;
162 os <<
"Neigh "; neighInfo_.
print(os)<<
nl;
163 os <<
"Faces "; facesInfo_.
print(os)<<
nl;
169 os <<
"Decomposition details with (proc faces) "
170 "for each processor connection"<<
nl <<
nl;
174 const labelList& subdist = distrib_[ownProc];
177 label neighCount = 0;
178 label facesCount = 0;
182 const label n = subdist[neiProc];
184 if (
n && ownProc != neiProc)
191 os <<
"Part[" << ownProc <<
"] cells:" << subdist[ownProc]
192 <<
" neigh:" << neighCount
193 <<
" faces:" << facesCount;
202 const label n = subdist[neiProc];
204 if (
n && ownProc != neiProc)
206 os <<
" (" << neiProc <<
" " <<
n <<
")";
227 os <<
"min:" << this->
min
228 <<
" max:" << this->
max
229 <<
" median:" << this->median;
233 const scalar ratio = scalar(100*this->
max)/this->median;
235 os <<
" (" << ratio <<
"%)";
const List< label > & offsets() const
Return the offset table (= size()+1)
List< label > labelList
A List of labels.
const List< T > & m() const
Return the packed matrix of data.
static constexpr const zero Zero
Global zero.
A packed storage unstructured matrix of objects of type <T> using an offset table for access.
virtual void print(Ostream &os) const
Print description of IOstream to Ostream.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
messageStream Info
Information stream (uses stdout - output is on the master only)
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.
void clear()
Clear the list, i.e. set size to zero.
Various functions to operate on Lists.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
UList< label > labelUList
A UList of labels.
void setSize(const label newSize)
Alias for resize(const label)