Go to the documentation of this file.
41 void Foam::globalIndex::bin
62 const label
id = bins.
m()[0];
68 for (label i = 1; i < order.size(); i++)
70 const label
id = bins.
m()[i];
72 if (
id < offsets[proci+1])
79 label oldProci = proci;
83 for (label j = oldProci+1; j < proci; ++j)
85 binOffsets[j] = binOffsets[oldProci]+binSize;
87 binOffsets[proci] = i;
93 for (label j = proci+1; j < binOffsets.size(); ++j)
95 binOffsets[j] = binOffsets[proci]+binSize;
103 const label localSize,
124 const label oldOffset = offset;
125 offset += localSizes[proci];
127 if (offset < oldOffset)
130 <<
"Overflow : sum of sizes " << localSizes
131 <<
" exceeds capability of label (" <<
labelMax
132 <<
"). Please recompile with larger datatype for label."
135 offsets_[proci+1] = offset;
144 const label len = (offsets_.size() - 1);
153 for (label proci=0; proci < len; ++proci)
155 values[proci] = offsets_[proci+1] - offsets_[proci];
166 return is >> gi.offsets_;
172 return os << gi.offsets_;
const List< label > & offsets() const
Return the offset table (= size()+1)
const List< T > & m() const
Return the packed matrix of data.
static constexpr const zero Zero
Global zero (0)
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
A packed storage unstructured matrix of objects of type <T> using an offset table for access.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
labelList sizes() const
The local sizes.
Istream & operator>>(Istream &, directionInfo &)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
label findLower(const ListType &input, const T &val, const label start, const ComparePredicate &comp)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
void clear()
Clear the addressed list, i.e. set the size to zero.
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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
globalIndex()=default
Construct null.
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
A List with indirect addressing.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void setSize(const label newSize)
Alias for resize(const label)