Go to the documentation of this file.
44 const label localSize,
52 reset(localSize, tag, comm, parallel);
64 offsets_(std::move(offsets))
72 return offsets_.empty() || offsets_.last() == 0;
90 return offsets_.empty() ? 0 : offsets_.last();
102 return offsets_[proci];
108 return offsets_[proci];
120 return offsets_[proci+1] - offsets_[proci];
132 return labelRange(offsets_[proci], offsets_[proci+1] - offsets_[proci]);
144 return i >= offsets_[proci] && i < offsets_[proci+1];
160 return i + offsets_[proci];
177 inplaceToGlobal(proci, result);
198 const label off = offsets_[proci];
200 for (label& val : labels)
216 const label locali = i - offsets_[proci];
218 if (locali < 0 || i >= offsets_[proci+1])
221 <<
"Global " << i <<
" does not belong on processor "
222 << proci <<
nl <<
"Offsets:" << offsets_
237 if (i < 0 || i >= size())
240 <<
"Global " << i <<
" does not belong on any processor."
241 <<
" Offsets:" << offsets_
label localStart() const
My local start.
labelRange range() const
Return start/size range of local processor data.
label localSize() const
My local size.
bool isLocal(const label i) const
Is on local processor.
void inplaceToGlobal(labelList &labels) const
From local to global index (inplace)
bool empty() const
Check for null constructed or global sum == 0.
label findLower(const ListType &input, const T &val, const label start, const ComparePredicate &comp)
const labelList & offsets() const
Const-access to the offsets.
A range or interval of labels defined by a start and a size.
errorManip< error > abort(error &err)
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
void reset(const label localSize)
Reset from local size.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
label toLocal(const label i) const
From global to local on current processor.
static int & msgType()
Message tag of standard messages.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label size() const
Global sum of localSizes.
label whichProcID(const label i) const
Which processor does global come from? Binary search.
globalIndex()=default
Construct null.
label offset(const label proci) const
Start of proci data.
Various functions to operate on Lists.
label toGlobal(const label i) const
From local to global index.