Fix bugs causing same results for all indices

This commit is contained in:
Sujin Philip 2019-06-20 09:11:25 -04:00 committed by Allison Vacanti
parent 34792145f2
commit cd6501bd4e
2 changed files with 3 additions and 4 deletions

@ -46,7 +46,7 @@ inline VTKM_CONT vtkm::cont::DataSet ComputeMoments::DoExecute(
{
vtkm::cont::ArrayHandle<T> moments;
worklet.Run(input.GetCellSet(this->GetActiveCellSetIndex()), field, p, Order - p, moments);
worklet.Run(input.GetCellSet(this->GetActiveCellSetIndex()), field, p, order - p, moments);
std::string fieldName = "index";
// names for i and j

@ -54,10 +54,10 @@ public:
for (int i = -Radius[0]; i <= Radius[0]; ++i)
{
vtkm::Float64 r0 = i * recp[0];
vtkm::Float64 r1 = i * recp[1];
vtkm::Float64 r1 = j * recp[1];
if (r0 * r0 + r1 * r1 <= 1)
sum += pow(r0, p) * pow(r0, q) * image.Get(i, j, 0);
sum += pow(r0, p) * pow(r1, q) * image.Get(i, j, 0);
}
}
@ -143,7 +143,6 @@ public:
using DispatcherType =
vtkm::worklet::DispatcherPointNeighborhood<vtkm::worklet::moments::ComputeMoments2D>;
DispatcherType dispatcher(vtkm::worklet::moments::ComputeMoments2D{ Radius, p, q });
dispatcher.SetDevice(vtkm::cont::DeviceAdapterTagSerial());
dispatcher.Invoke(input, pixels, momentsOut);
}