VTK-m  2.0
cont/CellLocatorTwoLevel.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_cont_CellLocatorTwoLevel_h
11 #define vtk_m_cont_CellLocatorTwoLevel_h
12 
13 #include <vtkm/cont/ArrayHandle.h>
14 #include <vtkm/cont/CellSetList.h>
15 
17 
20 
21 
22 namespace vtkm
23 {
24 namespace cont
25 {
26 
43 class VTKM_CONT_EXPORT CellLocatorTwoLevel
44  : public vtkm::cont::internal::CellLocatorBase<CellLocatorTwoLevel>
45 {
46  using Superclass = vtkm::cont::internal::CellLocatorBase<CellLocatorTwoLevel>;
47 
48  template <typename CellSetCont>
49  using CellSetContToExec =
50  typename CellSetCont::template ExecConnectivityType<vtkm::TopologyElementTagCell,
52 
53 public:
54  using SupportedCellSets = VTKM_DEFAULT_CELL_SET_LIST;
55 
57  using CellLocatorExecList =
59 
61  using LastCell = typename ExecObjType::LastCell;
62 
64  : DensityL1(32.0f)
65  , DensityL2(2.0f)
66  {
67  }
68 
72  {
73  this->DensityL1 = val;
74  this->SetModified();
75  }
76  vtkm::FloatDefault GetDensityL1() const { return this->DensityL1; }
77 
81  {
82  this->DensityL2 = val;
83  this->SetModified();
84  }
85  vtkm::FloatDefault GetDensityL2() const { return this->DensityL2; }
86 
87  void PrintSummary(std::ostream& out) const;
88 
89 public:
90  ExecObjType PrepareForExecution(vtkm::cont::DeviceAdapterId device,
91  vtkm::cont::Token& token) const;
92 
93 private:
94  friend Superclass;
95  VTKM_CONT void Build();
96 
98 
99  vtkm::internal::cl_uniform_bins::Grid TopLevel;
105 
106  struct MakeExecObject;
107 };
108 
109 }
110 } // vtkm::cont
111 
112 #endif // vtk_m_cont_CellLocatorTwoLevel_h
vtkm::TopologyElementTagPoint
A tag used to identify the point elements in a topology.
Definition: TopologyElementTag.h:34
vtkm::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:283
ArrayHandle.h
vtkm::cont::CellLocatorTwoLevel::DensityL2
vtkm::FloatDefault DensityL2
Definition: cont/CellLocatorTwoLevel.h:97
CellLocatorMultiplexer.h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
CellLocatorBase.h
vtkm::cont::CellLocatorTwoLevel::Superclass
vtkm::cont::internal::CellLocatorBase< CellLocatorTwoLevel > Superclass
Definition: cont/CellLocatorTwoLevel.h:46
vtkm::cont::CellLocatorTwoLevel::CellLocatorTwoLevel
CellLocatorTwoLevel()
Definition: cont/CellLocatorTwoLevel.h:63
vtkm::cont::CellLocatorTwoLevel::CellExecObjectList
vtkm::ListTransform< SupportedCellSets, CellSetContToExec > CellExecObjectList
Definition: cont/CellLocatorTwoLevel.h:56
vtkm::ListApply
typename detail::ListApplyImpl< List, Target >::type ListApply
Applies the list of types to a template.
Definition: List.h:132
CellSetList.h
vtkm::cont::CellLocatorTwoLevel::CellIds
vtkm::cont::ArrayHandle< vtkm::Id > CellIds
Definition: cont/CellLocatorTwoLevel.h:104
vtkm::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
vtkm::cont::CellLocatorTwoLevel::GetDensityL2
vtkm::FloatDefault GetDensityL2() const
Definition: cont/CellLocatorTwoLevel.h:85
vtkm::ListTransform
typename detail::ListTransformImpl< List, Transform >::type ListTransform
Constructs a list containing all types in a source list applied to a transform template.
Definition: List.h:592
vtkm::cont::CellLocatorTwoLevel::TopLevel
vtkm::internal::cl_uniform_bins::Grid TopLevel
Definition: cont/CellLocatorTwoLevel.h:99
CellLocatorTwoLevel.h
vtkm::cont::CellLocatorTwoLevel::CellCount
vtkm::cont::ArrayHandle< vtkm::Id > CellCount
Definition: cont/CellLocatorTwoLevel.h:103
vtkm::cont::CellLocatorTwoLevel::CellStartIndex
vtkm::cont::ArrayHandle< vtkm::Id > CellStartIndex
Definition: cont/CellLocatorTwoLevel.h:102
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::cont::CellLocatorTwoLevel::SetDensityL2
void SetDensityL2(vtkm::FloatDefault val)
Get/Set the desired approximate number of cells per level 1 bin.
Definition: cont/CellLocatorTwoLevel.h:80
vtkm::cont::CellLocatorTwoLevel::CellLocatorExecList
vtkm::ListTransform< CellExecObjectList, vtkm::exec::CellLocatorTwoLevel > CellLocatorExecList
Definition: cont/CellLocatorTwoLevel.h:58
vtkm::cont::CellLocatorTwoLevel::GetDensityL1
vtkm::FloatDefault GetDensityL1() const
Definition: cont/CellLocatorTwoLevel.h:76
vtkm::cont::CellLocatorTwoLevel::CellSetContToExec
typename CellSetCont::template ExecConnectivityType< vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint > CellSetContToExec
Definition: cont/CellLocatorTwoLevel.h:51
vtkm::cont::DeviceAdapterId
Definition: DeviceAdapterTag.h:52
vtkm::FloatDefault
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:198
vtkm::cont::CellLocatorTwoLevel::SetDensityL1
void SetDensityL1(vtkm::FloatDefault val)
Get/Set the desired approximate number of cells per level 1 bin.
Definition: cont/CellLocatorTwoLevel.h:71
vtkm::cont::CellLocatorTwoLevel::LeafDimensions
vtkm::cont::ArrayHandle< vtkm::internal::cl_uniform_bins::DimVec3 > LeafDimensions
Definition: cont/CellLocatorTwoLevel.h:100
vtkm::TopologyElementTagCell
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:24
vtkm::cont::CellLocatorTwoLevel
A locator that uses 2 nested levels of grids.
Definition: cont/CellLocatorTwoLevel.h:43
vtkm::cont::CellLocatorTwoLevel::LastCell
typename ExecObjType::LastCell LastCell
Definition: cont/CellLocatorTwoLevel.h:61
vtkm::cont::CellLocatorTwoLevel::SupportedCellSets
VTKM_DEFAULT_CELL_SET_LIST SupportedCellSets
Definition: cont/CellLocatorTwoLevel.h:54
vtkm::cont::CellLocatorTwoLevel::ExecObjType
vtkm::ListApply< CellLocatorExecList, vtkm::exec::CellLocatorMultiplexer > ExecObjType
Definition: cont/CellLocatorTwoLevel.h:60
vtkm::cont::CellLocatorTwoLevel::Superclass
friend Superclass
Definition: cont/CellLocatorTwoLevel.h:94
vtkm::cont::CellLocatorTwoLevel::LeafStartIndex
vtkm::cont::ArrayHandle< vtkm::Id > LeafStartIndex
Definition: cont/CellLocatorTwoLevel.h:101