mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: broadcast lumpedPointState with Foam::scatter instead of manual code
This commit is contained in:
committed by
Andrew Heather
parent
05b1bc9e79
commit
5368b38b8d
@ -403,47 +403,14 @@ bool Foam::lumpedPointState::readData
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
// Scatter master data using communication scheme
|
||||
// Broadcast master data to everyone
|
||||
|
||||
// Get my communication order
|
||||
const List<Pstream::commsStruct>& comms = Pstream::whichCommunication();
|
||||
const Pstream::commsStruct& myComm = comms[Pstream::myProcNo()];
|
||||
|
||||
// Receive from up
|
||||
if (myComm.above() != -1)
|
||||
{
|
||||
IPstream fromAbove
|
||||
(
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.above(),
|
||||
0,
|
||||
Pstream::msgType(),
|
||||
Pstream::worldComm
|
||||
);
|
||||
|
||||
fromAbove >> points_ >> angles_ >> degrees_;
|
||||
}
|
||||
|
||||
// Send to downstairs neighbours
|
||||
forAllReverse(myComm.below(), belowI)
|
||||
{
|
||||
OPstream toBelow
|
||||
(
|
||||
UPstream::commsTypes::scheduled,
|
||||
myComm.below()[belowI],
|
||||
0,
|
||||
Pstream::msgType(),
|
||||
Pstream::worldComm
|
||||
);
|
||||
|
||||
toBelow << points_ << angles_ << degrees_;
|
||||
}
|
||||
|
||||
rotationPtr_.reset(nullptr);
|
||||
|
||||
// MPI barrier
|
||||
Pstream::scatter(points_);
|
||||
Pstream::scatter(angles_);
|
||||
Pstream::scatter(degrees_);
|
||||
Pstream::scatter(ok);
|
||||
}
|
||||
rotationPtr_.reset(nullptr);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user