Merge topic 'particle-density-output-field'

74a8d688e Correct particle density filter output field

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2913
This commit is contained in:
Kenneth Moreland 2022-11-02 12:44:57 +00:00 committed by Kitware Robot
commit de7fd6cd61
2 changed files with 8 additions and 1 deletions

@ -0,0 +1,7 @@
# Correct particle density filter output field
The field being created by `ParticleDensityNearestGridPoint` was supposed
to be associated with cells, but it was sized to the number of points.
Although the number of points will always be more than the number of cells
(so the array will be big enough), having inappropriately sized arrays can
cause further problems downstream.

@ -100,7 +100,7 @@ VTKM_CONT vtkm::cont::DataSet ParticleDensityNearestGridPoint::DoExecute(
// We create an ArrayHandle and pass it to the Worklet as AtomicArrayInOut.
// However, the ArrayHandle needs to be allocated and initialized first.
vtkm::cont::ArrayHandle<T> density;
density.AllocateAndFill(uniform.GetNumberOfPoints(), 0);
density.AllocateAndFill(uniform.GetNumberOfCells(), 0);
this->Invoke(vtkm::worklet::NGPWorklet{}, coords, concrete, locator, density);