Go to the documentation of this file.
10 #ifndef vtk_m_cont_CellLocatorChooser_h
11 #define vtk_m_cont_CellLocatorChooser_h
28 template <
typename CellSetType,
typename CoordinateSystemArrayType>
29 struct CellLocatorChooserImpl
37 struct CellLocatorChooserImpl<
vtkm::cont::CellSetStructured<3>, UniformArray>
42 using RectilinearArray =
48 struct CellLocatorChooserImpl<
vtkm::cont::CellSetStructured<3>, RectilinearArray>
62 template <
typename CellSetType,
typename CoordinateSystemArrayType>
69 struct CastAndCallCellLocatorChooserFunctor
71 template <
typename CellLocatorType,
typename Functor,
typename... Args>
77 CellLocatorType locator;
79 locator.SetCoordinates(coordinateSystem);
81 functor(locator, std::forward<Args>(args)...);
84 template <
typename CellSetType,
typename Functor,
typename... Args>
85 void operator()(
const CellSetType& cellSet,
90 this->CallFunctorWithLocator<vtkm::cont::CellLocatorTwoLevel>(
91 cellSet, coordinateSystem, std::forward<Functor>(functor), std::forward<Args>(args)...);
94 template <
typename Functor,
typename... Args>
100 auto coordArray = coordinateSystem.
GetData();
103 this->CallFunctorWithLocator<vtkm::cont::CellLocatorUniformGrid>(
104 cellSet, coordinateSystem, std::forward<Functor>(functor), std::forward<Args>(args)...);
108 this->CallFunctorWithLocator<vtkm::cont::CellLocatorRectilinearGrid>(
109 cellSet, coordinateSystem, std::forward<Functor>(functor), std::forward<Args>(args)...);
113 this->CallFunctorWithLocator<vtkm::cont::CellLocatorTwoLevel>(
114 cellSet, coordinateSystem, std::forward<Functor>(functor), std::forward<Args>(args)...);
129 template <
typename CellSetType,
typename Functor,
typename... Args>
136 detail::CastAndCallCellLocatorChooserFunctor{},
138 std::forward<Functor>(functor),
139 std::forward<Args>(args)...);
149 template <
typename Functor,
typename... Args>
156 std::forward<Functor>(functor),
157 std::forward<Args>(args)...);
163 #endif //vtk_m_cont_CellLocatorChooser_h
const vtkm::cont::UnknownCellSet & GetCellSet() const
Definition: DataSet.h:403
Manages an array-worth of data.
Definition: ArrayHandle.h:300
Definition: cont/CellLocatorRectilinearGrid.h:22
Groups connected points that have the same field value.
Definition: Atomic.h:19
Defines a 1-, 2-, or 3-dimensional structured grid of points.
Definition: CastAndCall.h:32
ArrayHandleCartesianProduct is a specialization of ArrayHandle.
Definition: ArrayHandleCartesianProduct.h:334
Contains and manages the geometric data structures that VTK-m operates on.
Definition: DataSet.h:57
A CellSet of an unknown type.
Definition: UnknownCellSet.h:48
void CastAndCall(const DynamicObject &dynamicObject, Functor &&f, Args &&... args)
A Generic interface to CastAndCall.
Definition: CastAndCall.h:47
void CastAndCallCellLocatorChooser(const CellSetType &cellSet, const vtkm::cont::CoordinateSystem &coordinateSystem, Functor &&functor, Args &&... args)
Calls a functor with the appropriate type of CellLocator.
Definition: CellLocatorChooser.h:130
Manages a coordinate system for a DataSet.
Definition: CoordinateSystem.h:30
typename detail::CellLocatorChooserImpl< CellSetType, CoordinateSystemArrayType >::type CellLocatorChooser
A template to select an appropriate CellLocator based on CellSet type.
Definition: CellLocatorChooser.h:64
#define VTKM_CONT
Definition: ExportMacros.h:57
void SetCellSet(const vtkm::cont::UnknownCellSet &cellSet)
Specify the CellSet defining the structure of the cells being searched.
Definition: CellLocatorBase.h:49
vtkm::cont::UncertainArrayHandle< vtkm::TypeListFieldVec3, ::vtkm::cont::StorageListCommon > GetData() const
vtkm::cont::CoordinateSystem GetCoordinateSystem(vtkm::Id index=0) const
A locator that uses 2 nested levels of grids.
Definition: cont/CellLocatorTwoLevel.h:43