VTK-m  2.2
ThreadIndicesNeighborhood.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_exec_arg_ThreadIndicesNeighborhood_h
11 #define vtk_m_exec_arg_ThreadIndicesNeighborhood_h
12 
13 
17 #include <vtkm/exec/arg/ThreadIndicesTopologyMap.h> //for Deflate and Inflate
18 
19 #include <vtkm/Math.h>
20 
21 namespace vtkm
22 {
23 namespace exec
24 {
25 namespace arg
26 {
27 
28 namespace detail
29 {
32 inline VTKM_EXEC vtkm::Id3 To3D(vtkm::Id3 index)
33 {
34  return index;
35 }
36 
39 inline VTKM_EXEC vtkm::Id3 To3D(vtkm::Id2 index)
40 {
41  return vtkm::Id3(index[0], index[1], 1);
42 }
43 
47 {
48  return vtkm::Id3(index[0], 1, 1);
49 }
50 
53 inline VTKM_EXEC vtkm::Id3 To3D(vtkm::Id index)
54 {
55  return vtkm::Id3(index, 1, 1);
56 }
57 }
58 
60 {
61 
62 public:
64  const vtkm::exec::BoundaryState& state)
65  : State(state)
66  , ThreadIndex(threadIndex1D)
67  , InputIndex(threadIndex1D)
68  , OutputIndex(threadIndex1D)
69  , VisitIndex(0)
70  {
71  }
72 
74  vtkm::Id inputIndex,
75  vtkm::IdComponent visitIndex,
76  vtkm::Id outputIndex,
77  const vtkm::exec::BoundaryState& state)
78  : State(state)
79  , ThreadIndex(threadIndex1D)
80  , InputIndex(inputIndex)
81  , OutputIndex(outputIndex)
82  , VisitIndex(visitIndex)
83  {
84  }
85 
86  VTKM_EXEC
87  const vtkm::exec::BoundaryState& GetBoundaryState() const { return this->State; }
88 
89  VTKM_EXEC
90  vtkm::Id GetThreadIndex() const { return this->ThreadIndex; }
91 
92  VTKM_EXEC
93  vtkm::Id GetInputIndex() const { return this->InputIndex; }
94 
95  VTKM_EXEC
96  vtkm::Id3 GetInputIndex3D() const { return this->State.IJK; }
97 
98  VTKM_EXEC
99  vtkm::Id GetOutputIndex() const { return this->OutputIndex; }
100 
101  VTKM_EXEC
102  vtkm::IdComponent GetVisitIndex() const { return this->VisitIndex; }
103 
104 private:
110 };
111 }
112 }
113 } // namespace vtkm::exec::arg
114 
115 #endif //vtk_m_exec_arg_ThreadIndicesNeighborhood_h
vtkm::exec::arg::ThreadIndicesNeighborhood::GetOutputIndex
vtkm::Id GetOutputIndex() const
Definition: ThreadIndicesNeighborhood.h:99
vtkm::exec::BoundaryState
Provides a neighborhood's placement with respect to the mesh's boundary.
Definition: BoundaryState.h:31
ConnectivityStructured.h
vtkm::exec::arg::ThreadIndicesNeighborhood::ThreadIndicesNeighborhood
ThreadIndicesNeighborhood(vtkm::Id threadIndex1D, const vtkm::exec::BoundaryState &state)
Definition: ThreadIndicesNeighborhood.h:63
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
ThreadIndicesBasic.h
vtkm::exec::arg::ThreadIndicesNeighborhood::ThreadIndex
vtkm::Id ThreadIndex
Definition: ThreadIndicesNeighborhood.h:106
vtkm::IdComponent
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
ThreadIndicesTopologyMap.h
vtkm::exec::arg::ThreadIndicesNeighborhood::GetInputIndex
vtkm::Id GetInputIndex() const
Definition: ThreadIndicesNeighborhood.h:93
vtkm::exec::BoundaryState::IJK
vtkm::Id3 IJK
The 3D index of the visited element.
Definition: BoundaryState.h:279
vtkm::exec::arg::OutputIndex
The ExecutionSignature tag to use to get the output index.
Definition: OutputIndex.h:44
vtkm::exec::arg::ThreadIndicesNeighborhood::GetInputIndex3D
vtkm::Id3 GetInputIndex3D() const
Definition: ThreadIndicesNeighborhood.h:96
vtkm::exec::arg::ThreadIndicesNeighborhood
Definition: ThreadIndicesNeighborhood.h:59
vtkm::exec::arg::ThreadIndicesNeighborhood::GetVisitIndex
vtkm::IdComponent GetVisitIndex() const
Definition: ThreadIndicesNeighborhood.h:102
BoundaryState.h
vtkm::exec::arg::ThreadIndicesNeighborhood::VisitIndex
vtkm::IdComponent VisitIndex
Definition: ThreadIndicesNeighborhood.h:109
vtkm::exec::arg::ThreadIndicesNeighborhood::OutputIndex
vtkm::Id OutputIndex
Definition: ThreadIndicesNeighborhood.h:108
vtkm::exec::arg::ThreadIndicesNeighborhood::GetBoundaryState
const vtkm::exec::BoundaryState & GetBoundaryState() const
Definition: ThreadIndicesNeighborhood.h:87
Math.h
vtkm::exec::arg::ThreadIndicesNeighborhood::GetThreadIndex
vtkm::Id GetThreadIndex() const
Definition: ThreadIndicesNeighborhood.h:90
vtkm::exec::arg::ThreadIndicesNeighborhood::State
vtkm::exec::BoundaryState State
Definition: ThreadIndicesNeighborhood.h:105
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
vtkm::Id3
vtkm::Vec< vtkm::Id, 3 > Id3
Id3 corresponds to a 3-dimensional index for 3d arrays.
Definition: Types.h:1041
vtkm::Vec< vtkm::Id, 3 >
vtkm::exec::arg::VisitIndex
The ExecutionSignature tag to use to get the visit index.
Definition: VisitIndex.h:46
vtkm::exec::arg::InputIndex
The ExecutionSignature tag to use to get the input index.
Definition: InputIndex.h:43
vtkm::exec::arg::ThreadIndicesNeighborhood::ThreadIndicesNeighborhood
ThreadIndicesNeighborhood(vtkm::Id threadIndex1D, vtkm::Id inputIndex, vtkm::IdComponent visitIndex, vtkm::Id outputIndex, const vtkm::exec::BoundaryState &state)
Definition: ThreadIndicesNeighborhood.h:73
vtkm::exec::arg::ThreadIndicesNeighborhood::InputIndex
vtkm::Id InputIndex
Definition: ThreadIndicesNeighborhood.h:107