------------------------------------------------------------------------------
| 951 | |
| 952 | //------------------------------------------------------------------------------ |
| 953 | void vtkPLagrangianParticleTracker::ReceiveParticles( |
| 954 | std::queue<vtkLagrangianParticle*>& particleQueue) |
| 955 | { |
| 956 | vtkLagrangianParticle* receivedParticle; |
| 957 | int source = -1; |
| 958 | |
| 959 | while (this->StreamManager->ReceiveParticleIfAny(receivedParticle, source)) |
| 960 | { |
| 961 | receivedParticle->SetThreadedData(this->SerialThreadedData); |
| 962 | |
| 963 | // Check for manual shift |
| 964 | if (this->ForcePManualShift || receivedParticle->GetPManualShift()) |
| 965 | { |
| 966 | this->IntegrationModel->ParallelManualShift(receivedParticle); |
| 967 | receivedParticle->SetPManualShift(false); |
| 968 | } |
| 969 | // Receive all particles |
| 970 | bool valid = |
| 971 | this->IntegrationModel->FindInLocators(receivedParticle->GetPosition(), receivedParticle); |
| 972 | |
| 973 | // Inform source rank that it was received |
| 974 | this->TransferredParticleIdManager->SendParticleId(receivedParticle->GetId(), valid, source); |
| 975 | |
| 976 | if (valid) |
| 977 | { |
| 978 | particleQueue.push(receivedParticle); |
| 979 | } |
| 980 | else |
| 981 | { |
| 982 | delete receivedParticle; |
| 983 | } |
| 984 | } |
| 985 | } |
| 986 | |
| 987 | //------------------------------------------------------------------------------ |
| 988 | bool vtkPLagrangianParticleTracker::FinalizeOutputs( |
no test coverage detected