2017-05-31 19:03:03 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2017-05-31 19:03:03 +00:00
|
|
|
// This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
// PURPOSE. See the above copyright notice for more information.
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
#ifndef vtk_m_worklet_gradient_Vorticity_h
|
|
|
|
#define vtk_m_worklet_gradient_Vorticity_h
|
|
|
|
|
|
|
|
#include <vtkm/worklet/WorkletMapField.h>
|
|
|
|
|
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace worklet
|
|
|
|
{
|
|
|
|
namespace gradient
|
|
|
|
{
|
|
|
|
|
|
|
|
struct VorticityTypes : vtkm::ListTagBase<vtkm::Vec<vtkm::Vec<vtkm::Float32, 3>, 3>,
|
|
|
|
vtkm::Vec<vtkm::Vec<vtkm::Float64, 3>, 3>>
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct Vorticity : public vtkm::worklet::WorkletMapField
|
|
|
|
{
|
2019-01-10 18:59:25 +00:00
|
|
|
using ControlSignature = void(FieldIn input, FieldOut output);
|
2018-05-25 21:18:41 +00:00
|
|
|
using ExecutionSignature = void(_1, _2);
|
2018-02-22 13:29:13 +00:00
|
|
|
using InputDomain = _1;
|
2017-05-31 19:03:03 +00:00
|
|
|
|
|
|
|
template <typename InputType, typename OutputType>
|
|
|
|
VTKM_EXEC void operator()(const InputType& input, OutputType& vorticity) const
|
|
|
|
{
|
2017-06-29 20:35:58 +00:00
|
|
|
vorticity[0] = input[1][2] - input[2][1];
|
|
|
|
vorticity[1] = input[2][0] - input[0][2];
|
|
|
|
vorticity[2] = input[0][1] - input[1][0];
|
2017-05-31 19:03:03 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|