62 resizeBuf(receiveBuf_, nBytes);
74 resizeBuf(sendBuf_, nBytes);
77 static_cast<void*
>(sendBuf_.
data()),
f.
cdata(), nBytes
93 <<
"Unsupported communications type " << int(commsType)
132 <<
"Unsupported communications type " << int(commsType)
146 receive(commsType, tfld.ref());
160 static const label nCmpts =
sizeof(Type)/
sizeof(scalar);
161 label nm1 = (
f.
size() - 1)*nCmpts;
162 label nlast =
sizeof(Type)/
sizeof(
float);
163 label nFloats = nm1 + nlast;
164 label nBytes = nFloats*
sizeof(float);
166 const scalar *sArray =
reinterpret_cast<const scalar*
>(
f.
cdata());
167 const scalar *slast = &sArray[nm1];
168 resizeBuf(sendBuf_, nBytes);
169 float *fArray =
reinterpret_cast<float*
>(sendBuf_.data());
171 for (label i=0; i<nm1; i++)
173 fArray[i] = sArray[i] - slast[i%nCmpts];
176 reinterpret_cast<Type&
>(fArray[nm1]) =
f.
last();
196 resizeBuf(receiveBuf_, nBytes);
221 <<
"Unsupported communications type " << int(commsType)
227 this->send(commsType,
f);
241 static const label nCmpts =
sizeof(Type)/
sizeof(scalar);
242 label nm1 = (
f.
size() - 1)*nCmpts;
243 label nlast =
sizeof(Type)/
sizeof(
float);
244 label nFloats = nm1 + nlast;
245 label nBytes = nFloats*
sizeof(float);
253 resizeBuf(receiveBuf_, nBytes);
268 <<
"Unsupported communications type " << int(commsType)
272 const float *fArray =
273 reinterpret_cast<const float*
>(receiveBuf_.cdata());
274 f.
last() =
reinterpret_cast<const Type&
>(fArray[nm1]);
275 scalar *sArray =
reinterpret_cast<scalar*
>(
f.
data());
276 const scalar *slast = &sArray[nm1];
278 for (label i=0; i<nm1; i++)
280 sArray[i] = fArray[i] + slast[i%nCmpts];
285 this->receive<Type>(commsType,
f);
298 compressedReceive(commsType, tfld.ref());
virtual bool read()
Re-read model coefficients if they have changed.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
char * data_bytes() noexcept
Return pointer to the underlying array serving as data storage,.
const T * cdata() const noexcept
Return pointer to the underlying array serving as data storage.
T * data() noexcept
Return pointer to the underlying array serving as data storage.
std::streamsize byteSize() const
const char * cdata_bytes() const noexcept
Return pointer to the underlying array serving as data storage,.
void size(const label n)
Older name for setAddressableSize.
T & last()
Return the last element of the list.
commsTypes
Types of communications.
@ nonBlocking
"nonBlocking"
static bool floatTransfer
virtual bool write()
Write the output fields.
virtual label comm() const =0
Return communicator used for parallel communication.
void compressedSend(const Pstream::commsTypes commsType, const UList< Type > &f) const
Raw send function with data compression.
virtual int neighbProcNo() const =0
Return neighbour processor number (rank in communicator)
void receive(const Pstream::commsTypes commsType, UList< Type > &f) const
Raw receive function.
void compressedReceive(const Pstream::commsTypes commsType, UList< Type > &f) const
Raw receive function with data compression.
virtual int tag() const =0
Return message tag used for sending.
void send(const Pstream::commsTypes commsType, const UList< Type > &f) const
Raw send function.
A class for managing temporary objects.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
errorManipArg< error, int > exit(error &err, const int errNo=1)