245#ifdef TTK_ENABLE_OPENMP
246#pragma omp parallel for schedule(static)
248 for(
idCell ti = 0; ti < nbTriangles_; ++ti) {
250 getTriangleEdge(ti, 0, e0);
251 getTriangleEdge(ti, 1, e1);
252 getTriangleEdge(ti, 2, e2);
254 if(compareEdges(e0, e1, lowerThan)) {
258 if(compareEdges(e1, e2, lowerThan)) {
260 trianglesSortId_[ti] = 0;
261 }
else if(compareEdges(e0, e2, lowerThan)) {
263 trianglesSortId_[ti] = 1;
266 trianglesSortId_[ti] = 3;
272 if(compareEdges(e0, e2, lowerThan)) {
274 trianglesSortId_[ti] = 2;
275 }
else if(compareEdges(e1, e2, lowerThan)) {
277 trianglesSortId_[ti] = 4;
280 trianglesSortId_[ti] = 5;
317 const idCell ti,
const bool increasingOrder)
const {
319 getTriangleEdge(ti, 0, e0);
320 getTriangleEdge(ti, 1, e1);
321 getTriangleEdge(ti, 2, e2);
323 switch(trianglesSortId_[ti]) {
326 return std::make_tuple(e0, e1, e2);
328 return std::make_tuple(e2, e1, e0);
332 return std::make_tuple(e0, e2, e1);
334 return std::make_tuple(e1, e2, e0);
338 return std::make_tuple(e1, e0, e2);
340 return std::make_tuple(e2, e0, e1);
344 return std::make_tuple(e2, e0, e1);
346 return std::make_tuple(e1, e0, e2);
350 return std::make_tuple(e1, e2, e0);
352 return std::make_tuple(e0, e2, e1);
356 return std::make_tuple(e2, e1, e0);
358 return std::make_tuple(e0, e1, e2);
361#ifndef TTK_ENABLE_KAMIKAZE
362 std::cerr <<
"[Mesh]: error, unknownk case in triangleSortId_ : "
363 <<
static_cast<unsigned>(trianglesSortId_[ti]) <<
" at " << ti
367 return std::make_tuple(nullEdge, nullEdge, nullEdge);
373 const bool increasingOrder,
376 getTriangleEdge(ti, 0, e0);
377 getTriangleEdge(ti, 1, e1);
378 getTriangleEdge(ti, 2, e2);
380 switch(trianglesSortId_[ti]) {
382 if(increasingOrder) {
383 std::get<0>(oTriangle) = e0;
384 std::get<1>(oTriangle) = e1;
385 std::get<2>(oTriangle) = e2;
387 std::get<0>(oTriangle) = e2;
388 std::get<1>(oTriangle) = e1;
389 std::get<2>(oTriangle) = e0;
394 if(increasingOrder) {
395 std::get<0>(oTriangle) = e0;
396 std::get<1>(oTriangle) = e2;
397 std::get<2>(oTriangle) = e1;
399 std::get<0>(oTriangle) = e1;
400 std::get<1>(oTriangle) = e2;
401 std::get<2>(oTriangle) = e0;
406 if(increasingOrder) {
407 std::get<0>(oTriangle) = e1;
408 std::get<1>(oTriangle) = e0;
409 std::get<2>(oTriangle) = e2;
411 std::get<0>(oTriangle) = e2;
412 std::get<1>(oTriangle) = e0;
413 std::get<2>(oTriangle) = e1;
418 if(increasingOrder) {
419 std::get<0>(oTriangle) = e2;
420 std::get<1>(oTriangle) = e0;
421 std::get<2>(oTriangle) = e1;
423 std::get<0>(oTriangle) = e1;
424 std::get<1>(oTriangle) = e0;
425 std::get<2>(oTriangle) = e2;
430 if(increasingOrder) {
431 std::get<0>(oTriangle) = e1;
432 std::get<1>(oTriangle) = e2;
433 std::get<2>(oTriangle) = e0;
435 std::get<0>(oTriangle) = e0;
436 std::get<1>(oTriangle) = e2;
437 std::get<2>(oTriangle) = e1;
442 if(increasingOrder) {
443 std::get<0>(oTriangle) = e2;
444 std::get<1>(oTriangle) = e1;
445 std::get<2>(oTriangle) = e0;
447 std::get<0>(oTriangle) = e0;
448 std::get<1>(oTriangle) = e1;
449 std::get<2>(oTriangle) = e2;
453#ifndef TTK_ENABLE_KAMIKAZE
454 std::cerr <<
"[Mesh]: error, unknownk case in triangleSortId_ : "
455 <<
static_cast<unsigned>(trianglesSortId_[ti]) <<
" at "
468 if(edgesSortId_[e0] == 0) {
469 getEdgeVertex(e0, 0, e0v0);
470 getEdgeVertex(e0, 1, e0v1);
472 getEdgeVertex(e0, 1, e0v0);
473 getEdgeVertex(e0, 0, e0v1);
477 if(edgesSortId_[e1] == 0) {
478 getEdgeVertex(e1, 0, e1v0);
479 getEdgeVertex(e1, 1, e1v1);
481 getEdgeVertex(e1, 1, e1v0);
482 getEdgeVertex(e1, 0, e1v1);
486 return lowerThan(e0v1, e1v1);
487 return lowerThan(e0v0, e1v0);