Viskores  1.0
DispatcherPointNeighborhood.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_worklet_DispatcherPointNeighborhood_h
19 #define viskores_worklet_DispatcherPointNeighborhood_h
20 
23 
24 namespace viskores
25 {
26 namespace worklet
27 {
28 class WorkletNeighborhood;
29 class WorkletPointNeighborhood;
30 
33 template <typename WorkletType>
35  : public viskores::worklet::internal::DispatcherBase<DispatcherPointNeighborhood<WorkletType>,
36  WorkletType,
37  viskores::worklet::WorkletNeighborhood>
38 {
39  using Superclass =
40  viskores::worklet::internal::DispatcherBase<DispatcherPointNeighborhood<WorkletType>,
41  WorkletType,
43  using ScatterType = typename Superclass::ScatterType;
44 
45 public:
46  template <typename... T>
48  : Superclass(std::forward<T>(args)...)
49  {
50  }
51 
52  template <typename Invocation>
53  void DoInvoke(Invocation& invocation) const
54  {
55  using namespace viskores::worklet::internal;
56 
57  // This is the type for the input domain
58  using InputDomainType = typename Invocation::InputDomainType;
59 
60  // If you get a compile error on this line, then you have tried to use
61  // something that is not a viskores::cont::CellSet as the input domain to a
62  // topology operation (that operates on a cell set connection domain).
63  VISKORES_IS_CELL_SET(InputDomainType);
64 
65  // We can pull the input domain parameter (the data specifying the input
66  // domain) from the invocation object.
67  const InputDomainType& inputDomain = invocation.GetInputDomain();
68  auto inputRange = SchedulingRange(inputDomain, viskores::TopologyElementTagPoint{});
69 
70  // This is pretty straightforward dispatch. Once we know the number
71  // of invocations, the superclass can take care of the rest.
72  this->BasicInvoke(invocation, inputRange);
73  }
74 };
75 }
76 } // namespace viskores::worklet
77 
78 #endif //viskores_worklet_DispatcherPointNeighborhood_h
viskores::worklet::DispatcherPointNeighborhood
Dispatcher for worklets that inherit from WorkletPointNeighborhood.
Definition: DispatcherPointNeighborhood.h:34
viskores::worklet::WorkletNeighborhood
Definition: WorkletNeighborhood.h:50
viskores::worklet::DispatcherPointNeighborhood::Superclass
viskores::worklet::internal::DispatcherBase< DispatcherPointNeighborhood< WorkletType >, WorkletType, viskores::worklet::WorkletNeighborhood > Superclass
Definition: DispatcherPointNeighborhood.h:42
DispatcherBase.h
viskores::worklet::DispatcherPointNeighborhood::DispatcherPointNeighborhood
DispatcherPointNeighborhood(T &&... args)
Definition: DispatcherPointNeighborhood.h:47
viskores::worklet::DispatcherPointNeighborhood::DoInvoke
void DoInvoke(Invocation &invocation) const
Definition: DispatcherPointNeighborhood.h:53
viskores::TopologyElementTagPoint
A tag used to identify the point elements in a topology.
Definition: TopologyElementTag.h:42
DeviceAdapter.h
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
VISKORES_IS_CELL_SET
#define VISKORES_IS_CELL_SET(T)
Definition: CellSet.h:97
viskores::worklet::DispatcherPointNeighborhood::ScatterType
typename Superclass::ScatterType ScatterType
Definition: DispatcherPointNeighborhood.h:43