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