mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
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:
parent
ef3c4c65c9
commit
74a8d688e5
7
docs/changelog/particle-density-output-field.md
Normal file
7
docs/changelog/particle-density-output-field.md
Normal file
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user