vtkCPProcessor::RequestDataDescription() issues with Catalyst V2 scripts
Try the following change for the Catalyst/CxxImageDataExample/FEAdaptor.cxx with the attached script which should only print out the message every 12th time step but prints out every time step:
void CoProcess(
Grid& grid, Attributes& attributes, double time, unsigned int timeStep, bool lastTimeStep)
{
vtkNew<vtkCPDataDescription> dataDescription;
dataDescription->AddInput("input");
dataDescription->SetTimeData(time, timeStep);
if (lastTimeStep == true)
{
// assume that we want to all the pipelines to execute if it
// is the last time step.
dataDescription->ForceOutputOn();
}
if (Processor->RequestDataDescription(dataDescription) != 0)
{
std::cerr << timeStep << " is when I'm doing the RDD to DoCP\n";
vtkCPInputDataDescription* idd = dataDescription->GetInputDescriptionByName("input");
BuildVTKDataStructures(grid, attributes, idd);
idd->SetGrid(VTKGrid);
int wholeExtent[6];
for (int i = 0; i < 3; i++)
{
wholeExtent[2 * i] = 0;
wholeExtent[2 * i + 1] = grid.GetNumPoints()[i];
}
dataDescription->GetInputDescriptionByName("input")->SetWholeExtent(wholeExtent);
Processor->CoProcess(dataDescription);
}
}