VTK-m  2.0
Transpose.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 
11 #ifndef vtk_m_worklet_gradient_Transpose_h
12 #define vtk_m_worklet_gradient_Transpose_h
13 
16 
17 namespace vtkm
18 {
19 namespace worklet
20 {
21 namespace gradient
22 {
23 
24 template <typename T>
26 
27 template <typename T>
29 {
30  using ControlSignature = void(FieldInOut field);
31 
32  template <typename FieldInVecType>
33  VTKM_EXEC void operator()(FieldInVecType& field) const
34  {
35  T tempA, tempB, tempC;
36  tempA = field[0][1];
37  field[0][1] = field[1][0];
38  field[1][0] = tempA;
39  tempB = field[0][2];
40  field[0][2] = field[2][0];
41  field[2][0] = tempB;
42  tempC = field[1][2];
43  field[1][2] = field[2][1];
44  field[2][1] = tempC;
45  }
46 
47  template <typename S>
49  vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny())
50  {
52  dispatcher.SetDevice(device);
53  dispatcher.Invoke(field);
54  }
55 };
56 }
57 }
58 }
59 
60 #endif
vtkm::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:283
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
WorkletMapField.h
vtkm::worklet::gradient::Transpose3x3::operator()
VTKM_EXEC void operator()(FieldInVecType &field) const
Definition: Transpose.h:33
DispatcherMapField.h
vtkm::worklet::gradient::Transpose3x3::ControlSignature
void(FieldInOut field) ControlSignature
Definition: Transpose.h:30
vtkm::worklet::gradient::Transpose3x3
Definition: Transpose.h:28
vtkm::worklet::gradient::Transpose3x3::Run
void Run(vtkm::cont::ArrayHandle< vtkm::Vec< vtkm::Vec< T, 3 >, 3 >, S > &field, vtkm::cont::DeviceAdapterId device=vtkm::cont::DeviceAdapterTagAny())
Definition: Transpose.h:48
vtkm::worklet::DispatcherMapField
Dispatcher for worklets that inherit from WorkletMapField.
Definition: DispatcherMapField.h:25
vtkm::worklet::WorkletMapField::FieldInOut
A control signature tag for input-output (in-place) fields.
Definition: WorkletMapField.h:71
vtkm::cont::DeviceAdapterId
Definition: DeviceAdapterTag.h:52
vtkm::Vec< T, 3 >
Definition: Types.h:975
vtkm::Vec
A short fixed-length array.
Definition: Types.h:767
vtkm::List
Definition: List.h:34
vtkm::worklet::WorkletMapField
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:38