Commit d7a75bc0 authored by Kenneth Moreland's avatar Kenneth Moreland Committed by Kitware Robot
Browse files

Merge topic 'backport-2748' into release-1.7

d6353e1e

 Fix StructuredPointGradient for Uniform Point Coordinates
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland's avatarKenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2765
parents bac75599 d6353e1e
......@@ -89,34 +89,34 @@ struct StructuredPointGradient : public vtkm::worklet::WorkletPointNeighborhood
if (boundary.IsRadiusInXBoundary(1))
{
auto dx = inputField.GetUnchecked(1, 0, 0) - inputField.GetUnchecked(-1, 0, 0);
outputGradient[0] = static_cast<OT>(dx * (r[0] * 0.5f));
outputGradient[0] = static_cast<OT>((dx * 0.5f) / r[0]);
}
else
{
auto dx = inputField.Get(1, 0, 0) - inputField.Get(-1, 0, 0);
outputGradient[0] = static_cast<OT>(dx * r[0]);
outputGradient[0] = static_cast<OT>(dx / r[0]);
}
if (boundary.IsRadiusInYBoundary(1))
{
auto dy = inputField.GetUnchecked(0, 1, 0) - inputField.GetUnchecked(0, -1, 0);
outputGradient[1] = static_cast<OT>(dy * r[1] * 0.5f);
outputGradient[1] = static_cast<OT>((dy * 0.5f) / r[1]);
}
else
{
auto dy = inputField.Get(0, 1, 0) - inputField.Get(0, -1, 0);
outputGradient[1] = static_cast<OT>(dy * (r[1]));
outputGradient[1] = static_cast<OT>(dy / (r[1]));
}
if (boundary.IsRadiusInZBoundary(1))
{
auto dz = inputField.GetUnchecked(0, 0, 1) - inputField.GetUnchecked(0, 0, -1);
outputGradient[2] = static_cast<OT>(dz * r[2] * 0.5f);
outputGradient[2] = static_cast<OT>((dz * 0.5f) / r[2]);
}
else
{
auto dz = inputField.Get(0, 0, 1) - inputField.Get(0, 0, -1);
outputGradient[2] = static_cast<OT>(dz * (r[2]));
outputGradient[2] = static_cast<OT>(dz / (r[2]));
}
#if (defined(VTKM_CUDA) && defined(VTKM_GCC))
#pragma GCC diagnostic pop
......
Supports Markdown
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