| 104 | } |
| 105 | |
| 106 | void CatalystCoProcess(unsigned int numberOfPoints, double* pointsData, unsigned int numberOfCells, |
| 107 | unsigned int* cellsData, double* velocityData, float* pressureData, double time, |
| 108 | unsigned int timeStep, int lastTimeStep) |
| 109 | { |
| 110 | vtkCPProcessor* processor = vtkCPAdaptorAPI::GetCoProcessor(); |
| 111 | vtkCPDataDescription* dataDescription = vtkCPAdaptorAPI::GetCoProcessorData(); |
| 112 | if (processor == nullptr || dataDescription == nullptr) |
| 113 | { |
| 114 | std::cerr << "ERROR: Catalyst not properly initialized.\n"; |
| 115 | return; |
| 116 | } |
| 117 | |
| 118 | dataDescription->AddInput("input"); |
| 119 | dataDescription->SetTimeData(time, timeStep); |
| 120 | if (lastTimeStep == true) |
| 121 | { |
| 122 | // assume that we want to all the pipelines to execute if it |
| 123 | // is the last time step. |
| 124 | dataDescription->ForceOutputOn(); |
| 125 | } |
| 126 | if (processor->RequestDataDescription(dataDescription) != 0) |
| 127 | { |
| 128 | vtkCPInputDataDescription* idd = dataDescription->GetInputDescriptionByName("input"); |
| 129 | BuildVTKDataStructures( |
| 130 | idd, numberOfPoints, pointsData, velocityData, numberOfCells, cellsData, pressureData); |
| 131 | idd->SetGrid(VTKGrid); |
| 132 | processor->CoProcess(dataDescription); |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | void CatalystFinalize() |
| 137 | { // Used to free grid if it was used |
no test coverage detected