------------------------------------------------------------------------------
| 1436 | |
| 1437 | //------------------------------------------------------------------------------ |
| 1438 | int vtkPStreamTracer::RequestData( |
| 1439 | vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 1440 | { |
| 1441 | if (!vtkMPIController::SafeDownCast(this->Controller) || |
| 1442 | this->Controller->GetNumberOfProcesses() == 1) |
| 1443 | { |
| 1444 | this->SerialExecution = false; |
| 1445 | this->ForceSerialExecution = false; |
| 1446 | this->GenerateNormalsInIntegrate = true; |
| 1447 | int result = vtkStreamTracer::RequestData(request, inputVector, outputVector); |
| 1448 | this->SerialExecution = true; |
| 1449 | this->ForceSerialExecution = true; |
| 1450 | this->GenerateNormalsInIntegrate = false; |
| 1451 | return result; |
| 1452 | } |
| 1453 | |
| 1454 | this->Rank = this->Controller->GetLocalProcessId(); |
| 1455 | this->NumProcs = this->Controller->GetNumberOfProcesses(); |
| 1456 | |
| 1457 | vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); |
| 1458 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 1459 | if (!this->SetupOutput(inInfo, outInfo)) |
| 1460 | { |
| 1461 | return 0; |
| 1462 | } |
| 1463 | |
| 1464 | vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 1465 | |
| 1466 | vtkInformation* sourceInfo = inputVector[1]->GetInformationObject(0); |
| 1467 | vtkDataSet* localSource = vtkDataSet::SafeDownCast(sourceInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 1468 | vtkDataSet* source = nullptr; |
| 1469 | vtkNew<vtkAppendDataSets> distantAppender; |
| 1470 | |
| 1471 | if (this->UseLocalSeedSource) |
| 1472 | { |
| 1473 | source = localSource; |
| 1474 | } |
| 1475 | else |
| 1476 | { |
| 1477 | std::vector<vtkSmartPointer<vtkDataObject>> allSources; |
| 1478 | if (this->Controller->AllGather(localSource, allSources) == 0) |
| 1479 | { |
| 1480 | vtkErrorMacro("Couldn't gather seed sources, aborting StreamTracer"); |
| 1481 | return 0; |
| 1482 | } |
| 1483 | for (const auto& distantSource : allSources) |
| 1484 | { |
| 1485 | if (vtkDataSet* ds = vtkDataSet::SafeDownCast(distantSource)) |
| 1486 | { |
| 1487 | distantAppender->AddInputData(ds); |
| 1488 | } |
| 1489 | } |
| 1490 | distantAppender->MergePointsOn(); |
| 1491 | distantAppender->SetTolerance(0.0); |
| 1492 | distantAppender->Update(); |
| 1493 | source = vtkDataSet::SafeDownCast(distantAppender->GetOutputDataObject(0)); |
| 1494 | } |
| 1495 |
nothing calls this directly
no test coverage detected