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