VTK-m  2.0
DispatcherMapTopology.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_Dispatcher_MapTopology_h
11 #define vtk_m_worklet_Dispatcher_MapTopology_h
12 
16 
17 namespace vtkm
18 {
19 namespace worklet
20 {
21 namespace detail
22 {
23 struct WorkletMapTopologyBase;
24 }
25 class WorkletVisitCellsWithPoints;
26 class WorkletVisitPointsWithCells;
27 
30 template <typename WorkletType>
32  : public vtkm::worklet::internal::DispatcherBase<DispatcherMapTopology<WorkletType>,
33  WorkletType,
34  vtkm::worklet::detail::WorkletMapTopologyBase>
35 {
36  using Superclass =
37  vtkm::worklet::internal::DispatcherBase<DispatcherMapTopology<WorkletType>,
38  WorkletType,
39  vtkm::worklet::detail::WorkletMapTopologyBase>;
40  using ScatterType = typename Superclass::ScatterType;
41 
42 public:
43  template <typename... T>
45  : Superclass(std::forward<T>(args)...)
46  {
47  }
48 
49  template <typename Invocation>
50  VTKM_CONT void DoInvoke(Invocation& invocation) const
51  {
52  using namespace vtkm::worklet::internal;
53 
54  // This is the type for the input domain
55  using InputDomainType = typename Invocation::InputDomainType;
56  using SchedulingRangeType = typename WorkletType::VisitTopologyType;
57 
58  // If you get a compile error on this line, then you have tried to use
59  // something that is not a vtkm::cont::CellSet as the input domain to a
60  // topology operation (that operates on a cell set connection domain).
61  VTKM_IS_CELL_SET(InputDomainType);
62 
63  // We can pull the input domain parameter (the data specifying the input
64  // domain) from the invocation object.
65  const auto& inputDomain = invocation.GetInputDomain();
66 
67  // Now that we have the input domain, we can extract the range of the
68  // scheduling and call BadicInvoke.
69  this->BasicInvoke(invocation, SchedulingRange(inputDomain, SchedulingRangeType{}));
70  }
71 };
72 }
73 } // namespace vtkm::worklet
74 
75 #endif //vtk_m_worklet_Dispatcher_MapTopology_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::worklet::DispatcherMapTopology::Superclass
vtkm::worklet::internal::DispatcherBase< DispatcherMapTopology< WorkletType >, WorkletType, vtkm::worklet::detail::WorkletMapTopologyBase > Superclass
Definition: DispatcherMapTopology.h:39
DispatcherBase.h
vtkm::worklet::DispatcherMapTopology::DispatcherMapTopology
VTKM_CONT DispatcherMapTopology(T &&... args)
Definition: DispatcherMapTopology.h:44
vtkm::worklet::DispatcherMapTopology::DoInvoke
VTKM_CONT void DoInvoke(Invocation &invocation) const
Definition: DispatcherMapTopology.h:50
vtkm::worklet::DispatcherMapTopology::ScatterType
typename Superclass::ScatterType ScatterType
Definition: DispatcherMapTopology.h:40
DeviceAdapter.h
vtkm::worklet::DispatcherMapTopology
Dispatcher for worklets that inherit from WorkletMapTopology.
Definition: DispatcherMapTopology.h:31
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
VTKM_IS_CELL_SET
#define VTKM_IS_CELL_SET(T)
Definition: CellSet.h:71
TopologyElementTag.h