VTK-m  2.2
WorkletPointNeighborhood.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 #ifndef vtk_m_worklet_WorkletPointNeighborhood_h
11 #define vtk_m_worklet_WorkletPointNeighborhood_h
12 
21 
22 namespace vtkm
23 {
24 namespace worklet
25 {
26 
33 {
34 public:
35  template <typename Worklet>
37 
41 #ifdef VTKM_DOXYGEN_ONLY
42  // These redeclarations of superclass features are for documentation purposes only.
43 
46  {
47  };
48 
51  {
52  };
53 
56  {
57  };
58 
61  {
62  };
63 
66  {
67  };
68 
70  struct WholeArrayIn : vtkm::worklet::internal::WorkletBase::WholeArrayIn
71  {
72  };
73 
75  struct WholeArrayOut : vtkm::worklet::internal::WorkletBase::WholeArrayOut
76  {
77  };
78 
80  struct WholeArrayInOut : vtkm::worklet::internal::WorkletBase::WholeArrayInOut
81  {
82  };
83 
85  struct AtomicArrayInOut : vtkm::worklet::internal::WorkletBase::AtomicArrayInOut
86  {
87  };
88 
90  template <typename VisitTopology = Cell, typename IncidentTopology = Point>
92  : vtkm::worklet::internal::WorkletBase::WholeCellSetIn<VisitTopology, IncidentTopology>
93  {
94  };
95 
97  struct ExecObject : vtkm::worklet::internal::WorkletBase::ExecObject
98  {
99  };
100 #endif // VTKM_DOXYGEN_ONLY
101 
106 #ifdef VTKM_DOXYGEN_ONLY
107  // These redeclarations of superclass features are for documentation purposes only.
108 
110  struct _1 : vtkm::worklet::internal::WorkletBase::_1
111  {
112  };
113 
116  {
117  };
118 
121  {
122  };
123 
126  {
127  };
128 
131  {
132  };
133 
136  {
137  };
138 
141  {
142  };
143 
145  struct Device : vtkm::worklet::internal::WorkletBase::Device
146  {
147  };
148 #endif // VTKM_DOXYGEN_ONLY
149 
154  template <typename OutToInArrayType,
155  typename VisitArrayType,
156  typename ThreadToOutArrayType,
157  vtkm::IdComponent Dimension>
159  vtkm::Id threadIndex,
160  const OutToInArrayType& outToIn,
161  const VisitArrayType& visit,
162  const ThreadToOutArrayType& threadToOut,
165  Dimension>& inputDomain //this should be explicit
166  ) const
167  {
168  const vtkm::Id outIndex = threadToOut.Get(threadIndex);
170  threadIndex, outToIn.Get(outIndex), visit.Get(outIndex), outIndex, inputDomain);
171  }
172 
173 
180 private:
181  static constexpr bool IsScatterIdentity =
182  std::is_same<ScatterType, vtkm::worklet::ScatterIdentity>::value;
183  static constexpr bool IsMaskNone = std::is_same<MaskType, vtkm::worklet::MaskNone>::value;
184 
185 public:
186  template <bool Cond, typename ReturnType>
187  using EnableFnWhen = typename std::enable_if<Cond, ReturnType>::type;
188 
190  template <typename OutToInArrayType,
191  typename VisitArrayType,
192  typename ThreadToOutArrayType,
193  typename InputDomainType,
194  bool S = IsScatterIdentity,
195  bool M = IsMaskNone>
197  vtkm::Id threadIndex1D,
198  const vtkm::Id3& threadIndex3D,
199  const OutToInArrayType& vtkmNotUsed(outToIn),
200  const VisitArrayType& vtkmNotUsed(visit),
201  const ThreadToOutArrayType& vtkmNotUsed(threadToOut),
202  const InputDomainType& connectivity) const
203  {
205  threadIndex3D, threadIndex1D, connectivity);
206  }
207 
209  template <typename OutToInArrayType,
210  typename VisitArrayType,
211  typename ThreadToOutArrayType,
212  typename InputDomainType,
213  bool S = IsScatterIdentity,
214  bool M = IsMaskNone>
216  GetThreadIndices(vtkm::Id threadIndex1D,
217  const vtkm::Id3& threadIndex3D,
218  const OutToInArrayType& outToIn,
219  const VisitArrayType& visit,
220  const ThreadToOutArrayType& threadToOut,
221  const InputDomainType& connectivity) const
222  {
223  const vtkm::Id outIndex = threadToOut.Get(threadIndex1D);
225  threadIndex1D,
226  outToIn.Get(outIndex),
227  visit.Get(outIndex),
228  outIndex,
229  connectivity);
230  }
231 };
232 }
233 }
234 
235 #endif
vtkm::TopologyElementTagPoint
A tag used to identify the point elements in a topology.
Definition: TopologyElementTag.h:34
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
ThreadIndicesPointNeighborhood.h
vtkm::worklet::WorkletPointNeighborhood::WholeCellSetIn
ControlSignature tag for whole input topology.
Definition: WorkletPointNeighborhood.h:91
vtkm::worklet::WorkletPointNeighborhood::FieldIn
A control signature tag for input fields.
Definition: WorkletPointNeighborhood.h:50
vtkm::worklet::WorkletPointNeighborhood::VisitIndex
The ExecutionSignature tag to use to get the visit index.
Definition: WorkletPointNeighborhood.h:125
vtkm::IdComponent
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
vtkm::worklet::WorkletNeighborhood::CellSetIn
A control signature tag for input connectivity.
Definition: WorkletNeighborhood.h:129
vtkm::worklet::WorkletNeighborhood::FieldOut
A control signature tag for output fields.
Definition: WorkletNeighborhood.h:98
DispatcherPointNeighborhood.h
vtkm::exec::arg::OutputIndex
The ExecutionSignature tag to use to get the output index.
Definition: OutputIndex.h:44
vtkm::exec::arg::ThreadIndicesPointNeighborhood
Container for thread information in a WorkletPointNeighborhood.
Definition: ThreadIndicesPointNeighborhood.h:24
vtkm::worklet::WorkletPointNeighborhood::ThreadIndices
The ExecutionSignature tag to use to get the thread indices.
Definition: WorkletPointNeighborhood.h:140
vtkm::worklet::WorkletPointNeighborhood::Boundary
The ExecutionSignature tag to query if the current iteration is inside the boundary.
Definition: WorkletPointNeighborhood.h:115
vtkm::worklet::WorkletPointNeighborhood::InputIndex
The ExecutionSignature tag to use to get the input index.
Definition: WorkletPointNeighborhood.h:130
vtkm::worklet::WorkletPointNeighborhood::EnableFnWhen
typename std::enable_if< Cond, ReturnType >::type EnableFnWhen
Definition: WorkletPointNeighborhood.h:187
vtkm::worklet::WorkletPointNeighborhood::GetThreadIndices
EnableFnWhen< S &&M, vtkm::exec::arg::ThreadIndicesPointNeighborhood > GetThreadIndices(vtkm::Id threadIndex1D, const vtkm::Id3 &threadIndex3D, const OutToInArrayType &, const VisitArrayType &, const ThreadToOutArrayType &, const InputDomainType &connectivity) const
Definition: WorkletPointNeighborhood.h:196
vtkm::worklet::WorkletNeighborhood::FieldInOut
A control signature tag for input-output (in-place) fields.
Definition: WorkletNeighborhood.h:114
vtkm::worklet::WorkletPointNeighborhood::GetThreadIndices
EnableFnWhen<!(S &&M), vtkm::exec::arg::ThreadIndicesPointNeighborhood > GetThreadIndices(vtkm::Id threadIndex1D, const vtkm::Id3 &threadIndex3D, const OutToInArrayType &outToIn, const VisitArrayType &visit, const ThreadToOutArrayType &threadToOut, const InputDomainType &connectivity) const
Definition: WorkletPointNeighborhood.h:216
vtkm::worklet::WorkletPointNeighborhood::WholeArrayInOut
ControlSignature tag for whole input/output arrays.
Definition: WorkletPointNeighborhood.h:80
vtkm::worklet::WorkletPointNeighborhood::Device
ExecutionSignature tag for getting the device adapter tag.
Definition: WorkletPointNeighborhood.h:145
vtkm::worklet::WorkletPointNeighborhood::GetThreadIndices
vtkm::exec::arg::ThreadIndicesPointNeighborhood GetThreadIndices(vtkm::Id threadIndex, const OutToInArrayType &outToIn, const VisitArrayType &visit, const ThreadToOutArrayType &threadToOut, const vtkm::exec::ConnectivityStructured< vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, Dimension > &inputDomain) const
Point neighborhood worklets use the related thread indices class.
Definition: WorkletPointNeighborhood.h:158
vtkm::worklet::WorkletNeighborhood::FieldIn
A control signature tag for input fields.
Definition: WorkletNeighborhood.h:83
vtkm::exec::arg::ThreadIndices
The ExecutionSignature tag to use to get the thread indices.
Definition: ThreadIndices.h:44
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
WorkletNeighborhood.h
vtkm::worklet::WorkletPointNeighborhood::WorkIndex
The ExecutionSignature tag to use to get the work index.
Definition: WorkletPointNeighborhood.h:120
vtkm::worklet::WorkletPointNeighborhood::CellSetIn
A control signature tag for input connectivity.
Definition: WorkletPointNeighborhood.h:45
vtkmNotUsed
#define vtkmNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition: ExportMacros.h:128
vtkm::worklet::WorkletPointNeighborhood::IsScatterIdentity
static constexpr bool IsScatterIdentity
In the remaining methods and constexpr we determine at compilation time which method definition will ...
Definition: WorkletPointNeighborhood.h:181
vtkm::worklet::WorkletPointNeighborhood::OutputIndex
The ExecutionSignature tag to use to get the output index.
Definition: WorkletPointNeighborhood.h:135
vtkm::worklet::WorkletPointNeighborhood::IsMaskNone
static constexpr bool IsMaskNone
Definition: WorkletPointNeighborhood.h:183
vtkm::worklet::WorkletPointNeighborhood::FieldInOut
A control signature tag for input-output (in-place) fields.
Definition: WorkletPointNeighborhood.h:65
vtkm::worklet::WorkletPointNeighborhood::ExecObject
ControlSignature tag for execution object inputs.
Definition: WorkletPointNeighborhood.h:97
vtkm::exec::ConnectivityStructured
A class holding information about topology connections.
Definition: ConnectivityStructured.h:30
vtkm::worklet::WorkletNeighborhood::Boundary
The ExecutionSignature tag to query if the current iteration is inside the boundary.
Definition: WorkletNeighborhood.h:54
vtkm::Vec< vtkm::Id, 3 >
vtkm::worklet::DispatcherPointNeighborhood
Dispatcher for worklets that inherit from WorkletPointNeighborhood.
Definition: DispatcherPointNeighborhood.h:26
vtkm::worklet::WorkletPointNeighborhood::FieldInNeighborhood
A control signature tag for neighborhood input values.
Definition: WorkletPointNeighborhood.h:55
vtkm::TopologyElementTagCell
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:24
vtkm::worklet::WorkletPointNeighborhood::WholeArrayIn
ControlSignature tag for whole input arrays.
Definition: WorkletPointNeighborhood.h:70
vtkm::worklet::WorkletNeighborhood::FieldInNeighborhood
A control signature tag for neighborhood input values.
Definition: WorkletNeighborhood.h:156
vtkm::worklet::WorkletPointNeighborhood::_1
Argument placeholders for an ExecutionSignature.
Definition: WorkletPointNeighborhood.h:110
vtkm::exec::arg::VisitIndex
The ExecutionSignature tag to use to get the visit index.
Definition: VisitIndex.h:46
vtkm::worklet::WorkletPointNeighborhood
Base class for worklets that map over the points in a structured grid with neighborhood information.
Definition: WorkletPointNeighborhood.h:32
vtkm::worklet::WorkletPointNeighborhood::FieldOut
A control signature tag for output fields.
Definition: WorkletPointNeighborhood.h:60
vtkm::exec::arg::InputIndex
The ExecutionSignature tag to use to get the input index.
Definition: InputIndex.h:43
VTKM_SUPPRESS_EXEC_WARNINGS
#define VTKM_SUPPRESS_EXEC_WARNINGS
Definition: ExportMacros.h:53
vtkm::worklet::WorkletPointNeighborhood::AtomicArrayInOut
ControlSignature tag for whole input/output arrays.
Definition: WorkletPointNeighborhood.h:85
vtkm::worklet::WorkletPointNeighborhood::WholeArrayOut
ControlSignature tag for whole output arrays.
Definition: WorkletPointNeighborhood.h:75
vtkm::worklet::WorkletNeighborhood
Definition: WorkletNeighborhood.h:42
vtkm::exec::arg::WorkIndex
The ExecutionSignature tag to use to get the work index.
Definition: WorkIndex.h:39