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.
This commit is contained in:
Kenneth Moreland 2022-10-31 12:59:24 -06:00
parent ef3c4c65c9
commit 74a8d688e5
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);