Commit 43208490 authored by Yohann Bearzi's avatar Yohann Bearzi

Fixing a few vortex API issues

The input scalar field has now to be set using `SetInputArrayToProcess`
parent f5a8d5b7
Pipeline #182241 failed with stage
......@@ -234,6 +234,8 @@ int TestVortexCore(int argc, char* argv[])
constructVelocityProfile(unstructuredGrid);
vtkNew<vtkVortexCore> vortexCore;
vortexCore->SetInputArrayToProcess(
0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, "velocity");
vortexCore->SetInputData(unstructuredGrid);
vortexCore->Update();
......@@ -247,13 +249,15 @@ int TestVortexCore(int argc, char* argv[])
constructVelocityProfile(unstructuredGrid);
vtkNew<vtkVortexCore> vortexCore;
vortexCore->SetInputArrayToProcess(
0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, "velocity");
vortexCore->SetInputData(unstructuredGrid);
vortexCore->Update();
output2 = vtkPolyData::SafeDownCast(vortexCore->GetOutput());
}
if (output1->GetNumberOfCells() != output2->GetNumberOfCells())
if (!output1->GetNumberOfCells() || output1->GetNumberOfCells() != output2->GetNumberOfCells())
{
return EXIT_FAILURE;
}
......
......@@ -341,7 +341,7 @@ int vtkVortexCore::RequestData(
vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
vtkDataSet* input = vtkDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
vtkDataArray* velocity = input->GetPointData()->GetVectors();
vtkDataArray* velocity = this->GetInputArrayToProcess(0, input);
if (velocity == nullptr)
{
......@@ -358,7 +358,7 @@ int vtkVortexCore::RequestData(
gradient->SetInputData(input);
gradient->SetResultArrayName("jacobian");
gradient->SetInputArrayToProcess(
0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, vtkDataSetAttributes::VECTORS);
0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, velocity->GetName());
gradient->Update();
dataset = gradient->GetOutput();
......@@ -405,7 +405,7 @@ int vtkVortexCore::RequestData(
gradientPrime->SetInputData(dataset);
gradientPrime->SetResultArrayName("jacobian_prime");
gradientPrime->SetInputArrayToProcess(
0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, vtkDataSetAttributes::VECTORS);
0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, "jacobian");
gradientPrime->Update();
jacobianPrime = vtkDoubleArray::SafeDownCast(
gradientPrime->GetOutput()->GetPointData()->GetAbstractArray("jacobian_prime"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment