50 return offsets_[procI];
56 return offsets_[procI+1] - offsets_[procI];
68 return offsets_.
last();
78 return i + offsets_[procI];
91 return i >= offsets_[procI] && i < offsets_[procI+1];
104 label localI = i - offsets_[procI];
106 if (localI < 0 || i >= offsets_[procI+1])
108 FatalErrorIn(
"globalIndex::toLocal(const label, const label)")
109 <<
"Global " << i <<
" does not belong on processor " 110 << procI <<
endl <<
"Offsets:" << offsets_
125 if (i < 0 || i >=
size())
128 <<
"Global " << i <<
" does not belong on any processor." 129 <<
" Offsets:" << offsets_
label size() const
Global sum of localSizes.
bool isLocal(const label i) const
Is on local processor.
label localSize() const
My local size.
T & last()
Return the last element of the list.
A simple container for copying or transferring objects of type <T>.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Various functions to operate on Lists.
Ostream & endl(Ostream &os)
Add newline and flush stream.
globalIndex()
Construct null.
label offset(const label procI) const
Start of procI data.
label findLower(const ListType &, typename ListType::const_reference, const label stary, const BinaryOp &bop)
Find last element < given value in sorted list and return index,.
errorManip< error > abort(error &err)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
label toGlobal(const label i) const
From local to global.
label toLocal(const label i) const
From global to local on current processor.
labelList & offsets()
Change after construction.
label whichProcID(const label i) const
Which processor does global come from? Binary search.