Go to the documentation of this file.
18 #ifndef viskores_cont_CellLocatorChooser_h
19 #define viskores_cont_CellLocatorChooser_h
36 template <
typename CellSetType,
typename CoordinateSystemArrayType>
37 struct CellLocatorChooserImpl
45 struct CellLocatorChooserImpl<
viskores::cont::CellSetStructured<3>, UniformArray>
50 using RectilinearArray =
56 struct CellLocatorChooserImpl<
viskores::cont::CellSetStructured<3>, RectilinearArray>
70 template <
typename CellSetType,
typename CoordinateSystemArrayType>
77 struct CastAndCallCellLocatorChooserFunctor
79 template <
typename CellLocatorType,
typename Functor,
typename... Args>
85 CellLocatorType locator;
87 locator.SetCoordinates(coordinateSystem);
89 functor(locator, std::forward<Args>(args)...);
92 template <
typename CellSetType,
typename Functor,
typename... Args>
93 void operator()(
const CellSetType& cellSet,
98 this->CallFunctorWithLocator<viskores::cont::CellLocatorTwoLevel>(
99 cellSet, coordinateSystem, std::forward<Functor>(functor), std::forward<Args>(args)...);
102 template <
typename Functor,
typename... Args>
106 Args&&... args)
const
108 auto coordArray = coordinateSystem.
GetData();
111 this->CallFunctorWithLocator<viskores::cont::CellLocatorUniformGrid>(
112 cellSet, coordinateSystem, std::forward<Functor>(functor), std::forward<Args>(args)...);
116 this->CallFunctorWithLocator<viskores::cont::CellLocatorRectilinearGrid>(
117 cellSet, coordinateSystem, std::forward<Functor>(functor), std::forward<Args>(args)...);
121 this->CallFunctorWithLocator<viskores::cont::CellLocatorTwoLevel>(
122 cellSet, coordinateSystem, std::forward<Functor>(functor), std::forward<Args>(args)...);
137 template <
typename CellSetType,
typename Functor,
typename... Args>
139 const CellSetType& cellSet,
145 detail::CastAndCallCellLocatorChooserFunctor{},
147 std::forward<Functor>(functor),
148 std::forward<Args>(args)...);
158 template <
typename Functor,
typename... Args>
165 std::forward<Functor>(functor),
166 std::forward<Args>(args)...);
172 #endif //viskores_cont_CellLocatorChooser_h
viskores::cont::CoordinateSystem GetCoordinateSystem(viskores::Id index=0) const
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
void CastAndCall(const DynamicObject &dynamicObject, Functor &&f, Args &&... args)
A Generic interface to CastAndCall.
Definition: CastAndCall.h:55
void SetCellSet(const viskores::cont::UnknownCellSet &cellSet)
Specify the CellSet defining the structure of the cells being searched.
Definition: CellLocatorBase.h:56
typename detail::CellLocatorChooserImpl< CellSetType, CoordinateSystemArrayType >::type CellLocatorChooser
A template to select an appropriate CellLocator based on CellSet type.
Definition: CellLocatorChooser.h:72
Manages an array-worth of data.
Definition: ArrayHandle.h:313
Manages a coordinate system for a DataSet.
Definition: CoordinateSystem.h:38
#define VISKORES_CONT
Definition: ExportMacros.h:65
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::cont::UncertainArrayHandle< viskores::TypeListFieldVec3, ::viskores::cont::StorageListCommon > GetData() const
A locator that uses 2 nested levels of grids.
Definition: cont/CellLocatorTwoLevel.h:52
void CastAndCallCellLocatorChooser(const CellSetType &cellSet, const viskores::cont::CoordinateSystem &coordinateSystem, Functor &&functor, Args &&... args)
Calls a functor with the appropriate type of CellLocator.
Definition: CellLocatorChooser.h:138
Defines a 1-, 2-, or 3-dimensional structured grid of points.
Definition: CastAndCall.h:40
const viskores::cont::UnknownCellSet & GetCellSet() const
Definition: DataSet.h:422
A CellSet of an unknown type.
Definition: UnknownCellSet.h:56
ArrayHandleCartesianProduct is a specialization of ArrayHandle.
Definition: ArrayHandleCartesianProduct.h:345
A cell locator optimized for finding cells in a rectilinear grid.
Definition: cont/CellLocatorRectilinearGrid.h:36