Commit 36a816d1 authored by Joachim Pouderoux's avatar Joachim Pouderoux

Fix PUnstructuredGridGhostCellsGenerator so it does not modify input

parent 40dd9c27
Pipeline #2694 passed with stage
......@@ -216,9 +216,14 @@ int vtkPUnstructuredGridGhostCellsGenerator::RequestData(
vtkPointData *inputPD = input->GetPointData();
this->Internals->InputGlobalPointIds = inputPD->GetGlobalIds();
vtkUnstructuredGridBase* inputGridCopy = NULL;
if (!this->Internals->InputGlobalPointIds)
{
inputGridCopy = input->NewInstance();
inputGridCopy->ShallowCopy(input);
this->Internals->Input = inputGridCopy;
inputPD = inputGridCopy->GetPointData();
this->Internals->InputGlobalPointIds =
inputPD->GetArray(this->GlobalPointIdsArrayName);
inputPD->SetGlobalIds(this->Internals->InputGlobalPointIds);
......@@ -246,7 +251,11 @@ int vtkPUnstructuredGridGhostCellsGenerator::RequestData(
this->Controller->Barrier();
delete this->Internals;
this->Internals = 0;
this->Internals = NULL;
if (inputGridCopy)
{
inputGridCopy->Delete();
}
return 1;
}
......
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