Go to the documentation of this file.
40 <<
"Cannot gather values for non-contiguous types" <<
endl
47 const label nproc = (UPstream::parRun() ? UPstream::nProcs(comm) : 1);
51 if (UPstream::master(comm))
58 reinterpret_cast<const char*
>(&localValue),
60 allValues.data_bytes(),
69 allValues[0] = localValue;
86 <<
"Cannot scatter values for non-contiguous types" <<
endl
91 const label nproc = (UPstream::parRun() ? UPstream::nProcs(comm) : 1);
97 if (UPstream::master(comm) && allValues.
size() < nproc)
100 <<
"Attempting to send " << allValues.
size()
101 <<
" values to " << nproc <<
" processors" <<
endl
109 reinterpret_cast<char*
>(&localValue),
118 if (allValues.
empty())
124 localValue = allValues[0];
const char * cdata_bytes() const noexcept
Return pointer to the underlying array serving as data storage,.
void resize(const label len)
Adjust allocated size of list.
static constexpr const zero Zero
Global zero (0)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static T listScatterValues(const UList< T > &allValues, const label communicator=worldComm)
Individual values into list locations.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
errorManip< error > abort(error &err)
static List< T > listGatherValues(const T &localValue, const label communicator=worldComm)
Individual values into list locations.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
A template class to specify that a data type can be considered as being contiguous in memory.