Viskores  1.0
cont/CellLocatorTwoLevel.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_cont_CellLocatorTwoLevel_h
19 #define viskores_cont_CellLocatorTwoLevel_h
20 
23 
25 
28 
29 
30 namespace viskores
31 {
32 namespace cont
33 {
34 
52 class VISKORES_CONT_EXPORT CellLocatorTwoLevel : public viskores::cont::CellLocatorBase
53 {
54  template <typename CellSetCont>
55  using CellSetContToExec =
56  typename CellSetCont::template ExecConnectivityType<viskores::TopologyElementTagCell,
58 
59 public:
61 
63  using CellLocatorExecList =
65 
66  using ExecObjType =
68  using LastCell = typename ExecObjType::LastCell;
69 
71  : DensityL1(32.0f)
72  , DensityL2(2.0f)
73  {
74  }
75 
80  {
81  this->DensityL1 = val;
82  this->SetModified();
83  }
85  viskores::FloatDefault GetDensityL1() const { return this->DensityL1; }
86 
93  {
94  this->DensityL2 = val;
95  this->SetModified();
96  }
98  viskores::FloatDefault GetDensityL2() const { return this->DensityL2; }
99 
101  void PrintSummary(std::ostream& out) const;
102 
103  ExecObjType PrepareForExecution(viskores::cont::DeviceAdapterId device,
104  viskores::cont::Token& token) const;
105 
106 private:
107  VISKORES_CONT void Build() override;
108 
110 
111  viskores::internal::cl_uniform_bins::Grid TopLevel;
117 
118  struct MakeExecObject;
119 };
120 
121 }
122 } // viskores::cont
123 
124 #endif // viskores_cont_CellLocatorTwoLevel_h
viskores::cont::CellLocatorBase
Base class for all CellLocator classes.
Definition: CellLocatorBase.h:42
ArrayHandle.h
viskores::cont::CellLocatorTwoLevel::LastCell
typename ExecObjType::LastCell LastCell
Definition: cont/CellLocatorTwoLevel.h:68
viskores::cont::CellLocatorTwoLevel::CellLocatorExecList
viskores::ListTransform< CellExecObjectList, viskores::exec::CellLocatorTwoLevel > CellLocatorExecList
Definition: cont/CellLocatorTwoLevel.h:64
CellLocatorMultiplexer.h
viskores::TopologyElementTagCell
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:32
CellLocatorBase.h
CellSetList.h
viskores::cont::CellLocatorTwoLevel::CellLocatorTwoLevel
CellLocatorTwoLevel()
Definition: cont/CellLocatorTwoLevel.h:70
viskores::ListApply
typename detail::ListApplyImpl< List, Target >::type ListApply
Applies the list of types to a template.
Definition: List.h:146
viskores::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:313
viskores::cont::CellLocatorTwoLevel::CellIds
viskores::cont::ArrayHandle< viskores::Id > CellIds
Definition: cont/CellLocatorTwoLevel.h:116
viskores::cont::CellLocatorTwoLevel::ExecObjType
viskores::ListApply< CellLocatorExecList, viskores::exec::CellLocatorMultiplexer > ExecObjType
Definition: cont/CellLocatorTwoLevel.h:67
viskores::TopologyElementTagPoint
A tag used to identify the point elements in a topology.
Definition: TopologyElementTag.h:42
viskores::cont::CellLocatorTwoLevel::DensityL2
viskores::FloatDefault DensityL2
Definition: cont/CellLocatorTwoLevel.h:109
viskores::cont::CellLocatorTwoLevel::CellExecObjectList
viskores::ListTransform< SupportedCellSets, CellSetContToExec > CellExecObjectList
Definition: cont/CellLocatorTwoLevel.h:62
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::cont::CellLocatorTwoLevel::TopLevel
viskores::internal::cl_uniform_bins::Grid TopLevel
Definition: cont/CellLocatorTwoLevel.h:111
VISKORES_DEFAULT_CELL_SET_LIST
#define VISKORES_DEFAULT_CELL_SET_LIST
Definition: DefaultTypes.h:85
viskores::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:617
viskores::cont::CellLocatorTwoLevel::SetDensityL1
void SetDensityL1(viskores::FloatDefault val)
Specify the desired approximate number of cells per level 1 bin.
Definition: cont/CellLocatorTwoLevel.h:79
viskores::cont::CellLocatorTwoLevel::SetDensityL2
void SetDensityL2(viskores::FloatDefault val)
Specify the desired approximate number of cells per level 2 bin.
Definition: cont/CellLocatorTwoLevel.h:92
CellLocatorTwoLevel.h
viskores::cont::CellLocatorTwoLevel::LeafStartIndex
viskores::cont::ArrayHandle< viskores::Id > LeafStartIndex
Definition: cont/CellLocatorTwoLevel.h:113
viskores::cont::CellLocatorTwoLevel
A locator that uses 2 nested levels of grids.
Definition: cont/CellLocatorTwoLevel.h:52
viskores::cont::CellLocatorTwoLevel::CellCount
viskores::cont::ArrayHandle< viskores::Id > CellCount
Definition: cont/CellLocatorTwoLevel.h:115
viskores::cont::CellLocatorTwoLevel::SupportedCellSets
::viskores::cont::internal::CellSetList SupportedCellSets
Definition: cont/CellLocatorTwoLevel.h:60
viskores::cont::DeviceAdapterId
An object used to specify a device.
Definition: DeviceAdapterTag.h:66
viskores::cont::CellLocatorTwoLevel::LeafDimensions
viskores::cont::ArrayHandle< viskores::internal::cl_uniform_bins::DimVec3 > LeafDimensions
Definition: cont/CellLocatorTwoLevel.h:112
viskores::FloatDefault
viskores::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:244
viskores::cont::CellLocatorTwoLevel::GetDensityL2
viskores::FloatDefault GetDensityL2() const
Specify the desired approximate number of cells per level 2 bin.
Definition: cont/CellLocatorTwoLevel.h:98
viskores::cont::CellLocatorTwoLevel::CellSetContToExec
typename CellSetCont::template ExecConnectivityType< viskores::TopologyElementTagCell, viskores::TopologyElementTagPoint > CellSetContToExec
Definition: cont/CellLocatorTwoLevel.h:57
viskores::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:43
viskores::cont::CellLocatorTwoLevel::GetDensityL1
viskores::FloatDefault GetDensityL1() const
Specify the desired approximate number of cells per level 1 bin.
Definition: cont/CellLocatorTwoLevel.h:85
viskores::cont::CellLocatorTwoLevel::CellStartIndex
viskores::cont::ArrayHandle< viskores::Id > CellStartIndex
Definition: cont/CellLocatorTwoLevel.h:114