Gradient fast paths now works on cellset permutations.

This commit is contained in:
Robert Maynard 2017-09-04 12:05:46 -04:00
parent 5ec6d8fd13
commit a68413937a

@ -33,9 +33,6 @@
#include <vtkm/worklet/gradient/Transpose.h>
#include <vtkm/worklet/gradient/Vorticity.h>
#include <vtkm/cont/Timer.h>
#include <vtkm/cont/serial/DeviceAdapterSerial.h>
namespace vtkm
{
namespace worklet
@ -80,6 +77,17 @@ struct DeducedPointGrad
*this->Result);
}
template <typename PermIterType>
void operator()(const vtkm::cont::CellSetPermutation<vtkm::cont::CellSetStructured<3>,
PermIterType>& cellset) const
{
vtkm::worklet::DispatcherPointNeighborhood<StructuredPointGradient<T>, Device> dispatcher;
dispatcher.Invoke(cellset, //topology to iterate on a per point basis
*this->Points,
*this->Field,
*this->Result);
}
void operator()(const vtkm::cont::CellSetStructured<2>& cellset) const
{
vtkm::worklet::DispatcherPointNeighborhood<StructuredPointGradient<T>, Device> dispatcher;
@ -89,6 +97,18 @@ struct DeducedPointGrad
*this->Result);
}
template <typename PermIterType>
void operator()(const vtkm::cont::CellSetPermutation<vtkm::cont::CellSetStructured<2>,
PermIterType>& cellset) const
{
vtkm::worklet::DispatcherPointNeighborhood<StructuredPointGradient<T>, Device> dispatcher;
dispatcher.Invoke(cellset, //topology to iterate on a per point basis
*this->Points,
*this->Field,
*this->Result);
}
const CoordinateSystem* const Points;
const vtkm::cont::ArrayHandle<T, S>* const Field;
GradientOutputFields<T>* Result;