VTK-m  2.0
filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.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 // Copyright (c) 2018, The Regents of the University of California, through
11 // Lawrence Berkeley National Laboratory (subject to receipt of any required approvals
12 // from the U.S. Dept. of Energy). All rights reserved.
13 //
14 // Redistribution and use in source and binary forms, with or without modification,
15 // are permitted provided that the following conditions are met:
16 //
17 // (1) Redistributions of source code must retain the above copyright notice, this
18 // list of conditions and the following disclaimer.
19 //
20 // (2) Redistributions in binary form must reproduce the above copyright notice,
21 // this list of conditions and the following disclaimer in the documentation
22 // and/or other materials provided with the distribution.
23 //
24 // (3) Neither the name of the University of California, Lawrence Berkeley National
25 // Laboratory, U.S. Dept. of Energy nor the names of its contributors may be
26 // used to endorse or promote products derived from this software without
27 // specific prior written permission.
28 //
29 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
30 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
31 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
32 // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
33 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
36 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
37 // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
38 // OF THE POSSIBILITY OF SUCH DAMAGE.
39 //
40 //=============================================================================
41 //
42 // This code is an extension of the algorithm presented in the paper:
43 // Parallel Peak Pruning for Scalable SMP Contour Tree Computation.
44 // Hamish Carr, Gunther Weber, Christopher Sewell, and James Ahrens.
45 // Proceedings of the IEEE Symposium on Large Data Analysis and Visualization
46 // (LDAV), October 2016, Baltimore, Maryland.
47 //
48 // The PPP2 algorithm and software were jointly developed by
49 // Hamish Carr (University of Leeds), Gunther H. Weber (LBNL), and
50 // Oliver Ruebel (LBNL)
51 //==============================================================================
52 
53 #ifndef vtk_m_worklet_contourtree_augmented_mesh_dem_triangulation_3D_marchingcubes_types_h
54 #define vtk_m_worklet_contourtree_augmented_mesh_dem_triangulation_3D_marchingcubes_types_h
55 
56 #include <vtkm/Types.h>
57 #include <vtkm/cont/ArrayHandle.h>
59 
60 namespace vtkm
61 {
62 namespace worklet
63 {
64 namespace contourtree_augmented
65 {
66 namespace m3d_marchingcubes
67 {
68 
69 // Constants and case tables
70 static constexpr vtkm::Int8 FrontBit = 1 << 4;
71 static constexpr vtkm::Int8 BackBit = 1 << 5;
72 static constexpr vtkm::Int8 TopBit = 1 << 2;
73 static constexpr vtkm::Int8 BottomBit = 1 << 3;
74 static constexpr vtkm::Int8 LeftBit = 1 << 0;
75 static constexpr vtkm::Int8 RightBit = 1 << 1;
76 
77 static constexpr vtkm::IdComponent N_EDGE_NEIGHBOURS = 6;
78 static constexpr vtkm::IdComponent N_FACE_NEIGHBOURS = 18;
79 static constexpr vtkm::IdComponent N_ALL_NEIGHBOURS = 26;
80 
81 // EdgeBoundaryDetectionMasks
83  FrontBit,
84  TopBit,
85  LeftBit,
86  RightBit,
87  BottomBit,
88  BackBit,
89  FrontBit | TopBit,
90  FrontBit | LeftBit,
91  FrontBit | RightBit,
92  FrontBit | BottomBit,
93  TopBit | LeftBit,
94  TopBit | RightBit,
95  BottomBit | LeftBit,
96  BottomBit | RightBit,
97  BackBit | TopBit,
98  BackBit | LeftBit,
99  BackBit | RightBit,
100  BackBit | BottomBit,
101  FrontBit | TopBit | LeftBit,
102  FrontBit | TopBit | RightBit,
103  FrontBit | BottomBit | LeftBit,
104  FrontBit | BottomBit | RightBit,
105  BackBit | TopBit | LeftBit,
106  BackBit | TopBit | RightBit,
107  BackBit | BottomBit | LeftBit,
108  BackBit | BottomBit | RightBit
109 };
110 // VTK-M type for the EdgeBoundaryDetectionMasks
112 
113 // Number of permutation vectors in CubeVertexPermutations
115 // Length of a single permutation vector in the CubeVertexPermutations array
117 // VTK-M type for the CubeVertexPermutations
121 /* CubeVertexPermutations will be used as a 2D array of [8, 7]
122  * The array is flattened here to ease conversion in vtk-m
123  */
127  3, 4, 5, 13, 16, 17, 25, 3, 4, 0, 13, 8, 9, 21, 3, 1, 5, 11, 16,
128  14, 23, 2, 4, 5, 12, 15, 17, 24, 3, 1, 0, 11, 8, 6, 19, 2, 4, 0,
129  12, 7, 9, 20, 2, 1, 5, 10, 15, 14, 22, 2, 1, 0, 10, 7, 6, 18
130  };
131 
132 
133 // number of vertex connection pairs contained in LinkVertexConnectionsSix
135 // number of components defining a vertex connection
137 // VTKM-M type for the LinkVertexConnectionsEighteen and LinkVertexConnectionsSix
141 /* LinkVertexConnectionsSix[ will be used as a 2D array of [3, 3]
142  * The array is flattened here to ease conversion in vtk-m
143  */
146  0, 1, 0, 2, 1, 2
147  };
148 
149 // number of vertex connection pairs contained in LinkVertexConnectionsSix
151 /* LinkVertexConnectionsEighteen[ will be used as a 2D array of [3, 3]
152  * The array is flattened here to ease conversion in vtk-m
153  */
156  VertexConnections_VecLength] = { 0, 1, 0, 2, 0, 3, 0, 4, 0, 5,
157  1, 2, 1, 3, 1, 4, 1, 5, 2, 3,
158  2, 4, 2, 5, 3, 4, 3, 5, 4, 5 };
159 
160 // VTKM-M type for the InCubeConnectionsEighteen and InCubeConnectionsSix
164  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 1, 0, 2, 0, 7,
165  0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 1, 0, 0, 4, 7, 0, 0, 0, 0, 0, 2, 4, 7, 0, 0, 0, 1, 0, 2, 4, 7,
166  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 1, 0, 2, 4, 7,
167  0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 1, 0, 2, 4, 7, 0, 0, 0, 1, 0, 2, 4, 7, 0, 0, 0, 1, 0, 2, 4, 7
168 };
169 
173  0, 0, 0, 1, 0, 2, 32, 35, 0, 4, 64, 69, 0,
174  518, 608, 615, 0, 8, 0, 137, 1024, 1034, 1184, 1195, 4096, 4108,
175  4288, 4301, 5632, 5646, 5856, 5871, 0, 0, 256, 273, 2048, 2066, 2336,
176  2355, 8192, 8212, 8512, 8533, 10752, 10774, 11104, 11127, 16384, 16408, 16768, 16793,
177  19456, 19482, 19872, 19899, 28672, 28700, 29120, 29149, 32256, 32286, 32736, 32767, 0,
178  0, 0, 1, 0, 2, 32, 35, 0, 4, 64, 69, 512, 518,
179  608, 615, 0, 8, 128, 137, 1024, 1034, 1184, 1195, 4096, 4108, 4288,
180  4301, 5632, 5646, 5856, 5871, 0, 16, 256, 273, 2048, 2066, 2336, 2355,
181  8192, 8212, 8512, 8533, 10752, 10774, 11104, 11127, 16384, 16408, 16768, 16793, 19456,
182  19482, 19872, 19899, 28672, 28700, 29120, 29149, 32256, 32286, 32736, 32767
183  };
184 
185 
186 
187 
188 } // mesh_dem_types_2d_freudenthal
189 } // contourtree_augmented
190 } // worklet
191 } // vtkm
192 
193 #endif
vtkm::cont::ArrayHandle< vtkm::Int8 >
ArrayHandle.h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
Types.h
vtkm::worklet::contourtree_augmented::m3d_marchingcubes::InCubeConnectionsSix_NumElements
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::UInt8 InCubeConnectionsSix_NumElements
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.h:162
vtkm::worklet::contourtree_augmented::m3d_marchingcubes::InCubeConnectionsSix
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::UInt32 InCubeConnectionsSix[InCubeConnectionsSix_NumElements]
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.h:163
vtkm::IdComponent
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
VTKM_STATIC_CONSTEXPR_ARRAY
#define VTKM_STATIC_CONSTEXPR_ARRAY
Definition: ExportMacros.h:107
vtkm::worklet::contourtree_augmented::m3d_marchingcubes::LinkVertexConnectionsType
typename vtkm::cont::ArrayHandleGroupVec< vtkm::cont::ArrayHandle< vtkm::IdComponent >, VertexConnections_VecLength > LinkVertexConnectionsType
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.h:140
vtkm::worklet::contourtree_augmented::m3d_marchingcubes::VertexConnections_VecLength
constexpr vtkm::UInt8 VertexConnections_VecLength
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.h:136
vtkm::worklet::contourtree_augmented::m3d_marchingcubes::CubeVertexPermutations_NumPermutations
constexpr vtkm::UInt8 CubeVertexPermutations_NumPermutations
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.h:114
vtkm::worklet::contourtree_augmented::m3d_marchingcubes::EdgeBoundaryDetectionMasks
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::Int8 EdgeBoundaryDetectionMasks[N_ALL_NEIGHBOURS]
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.h:82
vtkm::worklet::contourtree_augmented::m3d_marchingcubes::InCubeConnectionsEighteen_NumElements
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::UInt8 InCubeConnectionsEighteen_NumElements
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.h:170
vtkm::Int8
int8_t Int8
Definition: Types.h:156
vtkm::worklet::contourtree_augmented::m3d_marchingcubes::LinkVertexConnectionsEighteen
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::IdComponent LinkVertexConnectionsEighteen[LinkVertexConnectionsEighteen_NumPairs *VertexConnections_VecLength]
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.h:156
vtkm::worklet::contourtree_augmented::m3d_marchingcubes::LinkVertexConnectionsSix
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::IdComponent LinkVertexConnectionsSix[LinkVertexConnectionsSix_NumPairs *VertexConnections_VecLength]
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.h:145
vtkm::worklet::contourtree_augmented::m3d_marchingcubes::LinkVertexConnectionsSix_NumPairs
constexpr vtkm::UInt8 LinkVertexConnectionsSix_NumPairs
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.h:134
vtkm::worklet::contourtree_augmented::m3d_marchingcubes::LinkVertexConnectionsEighteen_NumPairs
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::UInt8 LinkVertexConnectionsEighteen_NumPairs
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.h:150
vtkm::UInt8
uint8_t UInt8
Definition: Types.h:157
ArrayHandleGroupVec.h
vtkm::worklet::contourtree_augmented::m3d_marchingcubes::InCubeConnectionsType
typename vtkm::cont::ArrayHandle< vtkm::UInt32 > InCubeConnectionsType
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.h:161
vtkm::UInt32
uint32_t UInt32
Definition: Types.h:161
vtkm::worklet::contourtree_augmented::m3d_marchingcubes::CubeVertexPermutations
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::IdComponent CubeVertexPermutations[CubeVertexPermutations_NumPermutations *CubeVertexPermutations_PermVecLength]
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.h:126
vtkm::cont::ArrayHandleGroupVec< vtkm::cont::ArrayHandle< vtkm::IdComponent >, CubeVertexPermutations_PermVecLength >
vtkm::worklet::contourtree_augmented::m3d_marchingcubes::InCubeConnectionsEighteen
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::UInt32 InCubeConnectionsEighteen[InCubeConnectionsEighteen_NumElements]
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.h:172
vtkm::worklet::contourtree_augmented::m3d_marchingcubes::CubeVertexPermutations_PermVecLength
constexpr vtkm::UInt8 CubeVertexPermutations_PermVecLength
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/marchingcubes_3D/Types.h:116