35 edgePositions_.resize(edgeNumber_);
36 edgeCoords_.resize(edgeNumber_);
38 if(dimensionality_ == 3) {
39#ifdef TTK_ENABLE_OPENMP
40#pragma omp parallel for num_threads(threadNumber_)
42 for(
SimplexId i = 0; i < edgeNumber_; ++i) {
43 auto &p = edgeCoords_[i];
44 if(i < esetshift_[0]) {
45 edgeToPosition(i, 0, p.data());
46 edgePositions_[i] = EdgePosition::L_3D;
47 }
else if(i < esetshift_[1]) {
48 edgeToPosition(i, 1, p.data());
49 edgePositions_[i] = EdgePosition::H_3D;
50 }
else if(i < esetshift_[2]) {
51 edgeToPosition(i, 2, p.data());
52 edgePositions_[i] = EdgePosition::P_3D;
53 }
else if(i < esetshift_[3]) {
54 edgeToPosition(i, 3, p.data());
55 edgePositions_[i] = EdgePosition::D1_3D;
56 }
else if(i < esetshift_[4]) {
57 edgeToPosition(i, 4, p.data());
58 edgePositions_[i] = EdgePosition::D2_3D;
59 }
else if(i < esetshift_[5]) {
60 edgeToPosition(i, 5, p.data());
61 edgePositions_[i] = EdgePosition::D3_3D;
62 }
else if(i < esetshift_[6]) {
63 edgeToPosition(i, 6, p.data());
64 edgePositions_[i] = EdgePosition::D4_3D;
68 }
else if(this->dimensionality_ == 2) {
69#ifdef TTK_ENABLE_OPENMP
70#pragma omp parallel for num_threads(threadNumber_)
72 for(
SimplexId i = 0; i < edgeNumber_; ++i) {
73 auto &p = edgeCoords_[i];
74 if(i < esetshift_[0]) {
75 edgeToPosition2d(i, 0, p.data());
76 edgePositions_[i] = EdgePosition::L_2D;
77 }
else if(i < esetshift_[1]) {
78 edgeToPosition2d(i, 1, p.data());
79 edgePositions_[i] = EdgePosition::H_2D;
80 }
else if(i < esetshift_[2]) {
81 edgeToPosition2d(i, 2, p.data());
82 edgePositions_[i] = EdgePosition::D1_2D;
87 else if(this->dimensionality_ == 1) {
88 edgePositions_[0] = EdgePosition::FIRST_EDGE_1D;
89#ifdef TTK_ENABLE_OPENMP
90#pragma omp parallel for num_threads(threadNumber_)
92 for(
SimplexId i = 1; i < edgeNumber_ - 1; ++i) {
93 edgePositions_[i] = EdgePosition::CENTER_1D;
95 edgePositions_[edgeNumber_ - 1] = EdgePosition::LAST_EDGE_1D;
98 edgeVertexAccelerated_.resize(edgeNumber_);
101#ifdef TTK_ENABLE_OPENMP
102#pragma omp parallel for num_threads(threadNumber_)
104 for(
SimplexId i = 0; i < edgeNumber_; ++i) {
105 const auto &p = edgeCoords_[i];
106 edgeVertexAccelerated_[i] = (p[1] << div_[0]) + (p[2] << div_[1]);
109#ifdef TTK_ENABLE_OPENMP
110#pragma omp parallel for num_threads(threadNumber_)
112 for(
SimplexId i = 0; i < edgeNumber_; ++i) {
113 const auto &p = edgeCoords_[i];
114 edgeVertexAccelerated_[i] = p[1] * vshift_[0] + p[2] * vshift_[1];
122 if(this->dimensionality_ != 3 && this->dimensionality_ != 2) {
126 trianglePositions_.resize(triangleNumber_);
127 triangleCoords_.resize(triangleNumber_);
129 if(dimensionality_ == 3) {
130#ifdef TTK_ENABLE_OPENMP
131#pragma omp parallel for num_threads(threadNumber_)
133 for(
SimplexId i = 0; i < triangleNumber_; ++i) {
134 if(i < tsetshift_[0]) {
135 triangleToPosition(i, 0, triangleCoords_[i].data());
136 trianglePositions_[i] = TrianglePosition::F_3D;
137 }
else if(i < tsetshift_[1]) {
138 triangleToPosition(i, 1, triangleCoords_[i].data());
139 trianglePositions_[i] = TrianglePosition::H_3D;
140 }
else if(i < tsetshift_[2]) {
141 triangleToPosition(i, 2, triangleCoords_[i].data());
142 trianglePositions_[i] = TrianglePosition::C_3D;
143 }
else if(i < tsetshift_[3]) {
144 triangleToPosition(i, 3, triangleCoords_[i].data());
145 trianglePositions_[i] = TrianglePosition::D1_3D;
146 }
else if(i < tsetshift_[4]) {
147 triangleToPosition(i, 4, triangleCoords_[i].data());
148 trianglePositions_[i] = TrianglePosition::D2_3D;
149 }
else if(i < tsetshift_[5]) {
150 triangleToPosition(i, 5, triangleCoords_[i].data());
151 trianglePositions_[i] = TrianglePosition::D3_3D;
155 }
else if(dimensionality_ == 2) {
156#ifdef TTK_ENABLE_OPENMP
157#pragma omp parallel for num_threads(threadNumber_)
159 for(
SimplexId i = 0; i < triangleNumber_; ++i) {
160 triangleToPosition2d(i, triangleCoords_[i].data());
162 trianglePositions_[i] = TrianglePosition::TOP_2D;
164 trianglePositions_[i] = TrianglePosition::BOTTOM_2D;
191 std::array<SimplexId, 3> p{};
192 if(this->dimensionality_ == 3) {
193 if(e < esetshift_[0]) {
194 edgeToPosition(e, 0, p.data());
195 return EdgePosition::L_3D;
196 }
else if(e < esetshift_[1]) {
197 edgeToPosition(e, 1, p.data());
198 return EdgePosition::H_3D;
199 }
else if(e < esetshift_[2]) {
200 edgeToPosition(e, 2, p.data());
201 return EdgePosition::P_3D;
202 }
else if(e < esetshift_[3]) {
203 edgeToPosition(e, 3, p.data());
204 return EdgePosition::D1_3D;
205 }
else if(e < esetshift_[4]) {
206 edgeToPosition(e, 4, p.data());
207 return EdgePosition::D2_3D;
208 }
else if(e < esetshift_[5]) {
209 edgeToPosition(e, 5, p.data());
210 return EdgePosition::D3_3D;
211 }
else if(e < esetshift_[6]) {
212 edgeToPosition(e, 6, p.data());
213 return EdgePosition::D4_3D;
215 }
else if(this->dimensionality_ == 2) {
216 if(e < esetshift_[0]) {
217 edgeToPosition2d(e, 0, p.data());
218 return EdgePosition::L_2D;
219 }
else if(e < esetshift_[1]) {
220 edgeToPosition2d(e, 1, p.data());
221 return EdgePosition::H_2D;
222 }
else if(e < esetshift_[2]) {
223 edgeToPosition2d(e, 2, p.data());
224 return EdgePosition::D1_2D;
226 }
else if(this->dimensionality_ == 1) {
228 return EdgePosition::FIRST_EDGE_1D;
229 }
else if(e == this->edgeNumber_ - 1)
230 return EdgePosition::CENTER_1D;
232 return EdgePosition::LAST_EDGE_1D;
235 return EdgePosition::CENTER_1D;
240 std::array<SimplexId, 3> p{};
241 if(this->dimensionality_ == 3) {
242 if(e < this->esetshift_[0]) {
243 this->edgeToPosition(e, 0, p.data());
244 }
else if(e < this->esetshift_[1]) {
245 this->edgeToPosition(e, 1, p.data());
246 }
else if(e < this->esetshift_[2]) {
247 this->edgeToPosition(e, 2, p.data());
248 }
else if(e < this->esetshift_[3]) {
249 this->edgeToPosition(e, 3, p.data());
250 }
else if(e < this->esetshift_[4]) {
251 this->edgeToPosition(e, 4, p.data());
252 }
else if(e < this->esetshift_[5]) {
253 this->edgeToPosition(e, 5, p.data());
254 }
else if(e < this->esetshift_[6]) {
255 this->edgeToPosition(e, 6, p.data());
258 }
else if(this->dimensionality_ == 2) {
259 if(e < this->esetshift_[0]) {
260 this->edgeToPosition2d(e, 0, p.data());
261 }
else if(e < this->esetshift_[1]) {
262 this->edgeToPosition2d(e, 1, p.data());
263 }
else if(e < this->esetshift_[2]) {
264 this->edgeToPosition2d(e, 2, p.data());
272 if(this->dimensionality_ == 2) {
274 return TrianglePosition::TOP_2D;
276 return TrianglePosition::BOTTOM_2D;
278 }
else if(this->dimensionality_ == 3) {
279 if(t < this->tsetshift_[0]) {
280 return TrianglePosition::F_3D;
281 }
else if(t < this->tsetshift_[1]) {
282 return TrianglePosition::H_3D;
283 }
else if(t < this->tsetshift_[2]) {
284 return TrianglePosition::C_3D;
285 }
else if(t < this->tsetshift_[3]) {
286 return TrianglePosition::D1_3D;
287 }
else if(t < this->tsetshift_[4]) {
288 return TrianglePosition::D2_3D;
289 }
else if(t < this->tsetshift_[5]) {
290 return TrianglePosition::D3_3D;
293 return TrianglePosition::C_3D;
298 std::array<SimplexId, 3> p{};
299 if(this->dimensionality_ == 2) {
300 this->triangleToPosition2d(t, p.data());
301 }
else if(this->dimensionality_ == 3) {
302 if(t < this->tsetshift_[0]) {
303 this->triangleToPosition(t, 0, p.data());
304 }
else if(t < this->tsetshift_[1]) {
305 this->triangleToPosition(t, 1, p.data());
306 }
else if(t < this->tsetshift_[2]) {
307 this->triangleToPosition(t, 2, p.data());
308 }
else if(t < this->tsetshift_[3]) {
309 this->triangleToPosition(t, 3, p.data());
310 }
else if(t < this->tsetshift_[4]) {
311 this->triangleToPosition(t, 4, p.data());
312 }
else if(t < this->tsetshift_[5]) {
313 this->triangleToPosition(t, 5, p.data());