VTK-m  2.0
DispatcherPointNeighborhood.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_DispatcherPointNeighborhood_h
11 #define vtk_m_worklet_DispatcherPointNeighborhood_h
12 
15 
16 namespace vtkm
17 {
18 namespace worklet
19 {
20 class WorkletNeighborhood;
21 class WorkletPointNeighborhood;
22 
25 template <typename WorkletType>
27  : public vtkm::worklet::internal::DispatcherBase<DispatcherPointNeighborhood<WorkletType>,
28  WorkletType,
29  vtkm::worklet::WorkletNeighborhood>
30 {
31  using Superclass =
32  vtkm::worklet::internal::DispatcherBase<DispatcherPointNeighborhood<WorkletType>,
33  WorkletType,
35  using ScatterType = typename Superclass::ScatterType;
36 
37 public:
38  template <typename... T>
40  : Superclass(std::forward<T>(args)...)
41  {
42  }
43 
44  template <typename Invocation>
45  void DoInvoke(Invocation& invocation) const
46  {
47  using namespace vtkm::worklet::internal;
48 
49  // This is the type for the input domain
50  using InputDomainType = typename Invocation::InputDomainType;
51 
52  // If you get a compile error on this line, then you have tried to use
53  // something that is not a vtkm::cont::CellSet as the input domain to a
54  // topology operation (that operates on a cell set connection domain).
55  VTKM_IS_CELL_SET(InputDomainType);
56 
57  // We can pull the input domain parameter (the data specifying the input
58  // domain) from the invocation object.
59  const InputDomainType& inputDomain = invocation.GetInputDomain();
60  auto inputRange = SchedulingRange(inputDomain, vtkm::TopologyElementTagPoint{});
61 
62  // This is pretty straightforward dispatch. Once we know the number
63  // of invocations, the superclass can take care of the rest.
64  this->BasicInvoke(invocation, inputRange);
65  }
66 };
67 }
68 } // namespace vtkm::worklet
69 
70 #endif //vtk_m_worklet_DispatcherPointNeighborhood_h
vtkm::TopologyElementTagPoint
A tag used to identify the point elements in a topology.
Definition: TopologyElementTag.h:34
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::worklet::DispatcherPointNeighborhood::ScatterType
typename Superclass::ScatterType ScatterType
Definition: DispatcherPointNeighborhood.h:35
DispatcherBase.h
DeviceAdapter.h
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::worklet::DispatcherPointNeighborhood::DoInvoke
void DoInvoke(Invocation &invocation) const
Definition: DispatcherPointNeighborhood.h:45
vtkm::worklet::DispatcherPointNeighborhood
Dispatcher for worklets that inherit from WorkletPointNeighborhood.
Definition: DispatcherPointNeighborhood.h:26
vtkm::worklet::DispatcherPointNeighborhood::DispatcherPointNeighborhood
VTKM_CONT DispatcherPointNeighborhood(T &&... args)
Definition: DispatcherPointNeighborhood.h:39
vtkm::worklet::DispatcherPointNeighborhood::Superclass
vtkm::worklet::internal::DispatcherBase< DispatcherPointNeighborhood< WorkletType >, WorkletType, vtkm::worklet::WorkletNeighborhood > Superclass
Definition: DispatcherPointNeighborhood.h:34
vtkm::worklet::WorkletNeighborhood
Definition: WorkletNeighborhood.h:42
VTKM_IS_CELL_SET
#define VTKM_IS_CELL_SET(T)
Definition: CellSet.h:71