| 73 | } |
| 74 | |
| 75 | void MyProcess::Execute() |
| 76 | { |
| 77 | this->ReturnValue = 1; |
| 78 | int numProcs = this->Controller->GetNumberOfProcesses(); |
| 79 | int me = this->Controller->GetLocalProcessId(); |
| 80 | |
| 81 | int i, go; |
| 82 | |
| 83 | vtkCompositeRenderManager* prm = vtkCompositeRenderManager::New(); |
| 84 | |
| 85 | // READER |
| 86 | |
| 87 | vtkDataSetReader* dsr = vtkDataSetReader::New(); |
| 88 | vtkUnstructuredGrid* ug = vtkUnstructuredGrid::New(); |
| 89 | |
| 90 | vtkDataSet* ds = nullptr; |
| 91 | |
| 92 | if (me == 0) |
| 93 | { |
| 94 | char* fname = |
| 95 | vtkTestUtilities::ExpandDataFileName(this->Argc, this->Argv, "Data/tetraMesh.vtk"); |
| 96 | |
| 97 | dsr->SetFileName(fname); |
| 98 | |
| 99 | ds = dsr->GetOutput(); |
| 100 | |
| 101 | dsr->Update(); |
| 102 | |
| 103 | vtkFloatArray* fa = vtkFloatArray::New(); |
| 104 | fa->SetName("ones"); |
| 105 | fa->SetNumberOfTuples(ds->GetNumberOfPoints()); |
| 106 | fa->FillComponent(0, 1); |
| 107 | ds->GetPointData()->AddArray(fa); |
| 108 | fa->Delete(); |
| 109 | |
| 110 | delete[] fname; |
| 111 | |
| 112 | go = 1; |
| 113 | |
| 114 | if ((ds == nullptr) || (ds->GetNumberOfCells() == 0)) |
| 115 | { |
| 116 | if (ds) |
| 117 | { |
| 118 | std::cout << "Failure: input file has no cells" << std::endl; |
| 119 | } |
| 120 | go = 0; |
| 121 | } |
| 122 | } |
| 123 | else |
| 124 | { |
| 125 | ds = static_cast<vtkDataSet*>(ug); |
| 126 | } |
| 127 | |
| 128 | vtkMPICommunicator* comm = vtkMPICommunicator::SafeDownCast(this->Controller->GetCommunicator()); |
| 129 | |
| 130 | comm->Broadcast(&go, 1, 0); |
| 131 | |
| 132 | if (!go) |
nothing calls this directly
no test coverage detected