TTK
Loading...
Searching...
No Matches
AbstractTriangulation.h
Go to the documentation of this file.
1
11
12#pragma once
13
14// base code includes
15#include <Cache.h>
16#include <Geometry.h>
17#include <Wrapper.h>
18
19#include <array>
20#include <ostream>
21#include <unordered_map>
22
23#ifdef TTK_ENABLE_KAMIKAZE
24#define TTK_TRIANGULATION_INTERNAL(NAME) NAME
25#else
26#define TTK_TRIANGULATION_INTERNAL(NAME) NAME##Internal
27#endif // TTK_ENABLE_KAMIKAZE
28
29#define ttkTemplateMacroCase(triangulationType, triangulationClass, call) \
30 case triangulationType: { \
31 using TTK_TT = triangulationClass; \
32 call; \
33 }; break
34
35#define ttkTemplateMacro(triangulationType, call) \
36 switch(triangulationType) { \
37 ttkTemplateMacroCase( \
38 ttk::Triangulation::Type::EXPLICIT, ttk::ExplicitTriangulation, call); \
39 ttkTemplateMacroCase( \
40 ttk::Triangulation::Type::IMPLICIT, ttk::ImplicitNoPreconditions, call); \
41 ttkTemplateMacroCase(ttk::Triangulation::Type::HYBRID_IMPLICIT, \
42 ttk::ImplicitWithPreconditions, call); \
43 ttkTemplateMacroCase( \
44 ttk::Triangulation::Type::PERIODIC, ttk::PeriodicNoPreconditions, call); \
45 ttkTemplateMacroCase(ttk::Triangulation::Type::HYBRID_PERIODIC, \
46 ttk::PeriodicWithPreconditions, call); \
47 ttkTemplateMacroCase( \
48 ttk::Triangulation::Type::COMPACT, ttk::CompactTriangulation, call); \
49 }
50
51namespace ttk {
52
53 // forward declaration of the ttk::dcg::DiscreteGradient class to
54 // give it access to the gradient cache (with a `friend`
55 // declaration)
56 namespace dcg {
57 class DiscreteGradient;
58 }
59
61
62 public:
64
66
71
74 int clear();
75
78 size_t footprint(size_t size = 0) const;
79
101 virtual inline int getCellEdge(const SimplexId &cellId,
102 const int &localEdgeId,
103 SimplexId &edgeId) const {
104
105#ifndef TTK_ENABLE_KAMIKAZE
106 // initialize output variable before early return
107 edgeId = -1;
108
110 return -1;
111#endif
112
113 if(getDimensionality() == 1)
114 return getCellNeighbor(cellId, localEdgeId, edgeId);
115
116 else if(getDimensionality() == 2)
117 return getTriangleEdgeInternal(cellId, localEdgeId, edgeId);
118
119 return getCellEdgeInternal(cellId, localEdgeId, edgeId);
120 }
121
138 virtual inline SimplexId getCellEdgeNumber(const SimplexId &cellId) const {
139#ifndef TTK_ENABLE_KAMIKAZE
141 return -1;
142#endif
143 if(getDimensionality() == 1)
144 return getCellNeighborNumber(cellId);
145
146 else if(getDimensionality() == 2)
147 return getTriangleEdgeNumber(cellId);
148
149 return getCellEdgeNumberInternal(cellId);
150 }
151
180 virtual inline const std::vector<std::vector<SimplexId>> *getCellEdges() {
181#ifndef TTK_ENABLE_KAMIKAZE
183 return nullptr;
184#endif
185 if(getDimensionality() == 1)
186 return getCellNeighbors();
187
188 else if(getDimensionality() == 2)
190
191 return getCellEdgesInternal();
192 }
193
213 virtual inline int getCellNeighbor(const SimplexId &cellId,
214 const int &localNeighborId,
215 SimplexId &neighborId) const {
216
217#ifndef TTK_ENABLE_KAMIKAZE
218 // initialize output variable before early return
219 neighborId = -1;
220
222 return -1;
223#endif
224 return getCellNeighborInternal(cellId, localNeighborId, neighborId);
225 }
226
241 virtual inline SimplexId
242 getCellNeighborNumber(const SimplexId &cellId) const {
243
244#ifndef TTK_ENABLE_KAMIKAZE
246 return -1;
247#endif
248 return getCellNeighborNumberInternal(cellId);
249 }
250
276 virtual inline const std::vector<std::vector<SimplexId>> *
278#ifndef TTK_ENABLE_KAMIKAZE
280 return nullptr;
281#endif
283 }
284
307 virtual inline int getCellTriangle(const SimplexId &cellId,
308 const int &localTriangleId,
309 SimplexId &triangleId) const {
310#ifndef TTK_ENABLE_KAMIKAZE
311 // initialize output variable before early return
312 triangleId = -1;
313
314 if(getDimensionality() == 1)
315 return -1;
316
318 return -2;
319#endif
320 if(getDimensionality() == 2)
321 return getCellNeighbor(cellId, localTriangleId, triangleId);
322
323 return getCellTriangleInternal(cellId, localTriangleId, triangleId);
324 }
325
343 virtual inline SimplexId
344 getCellTriangleNumber(const SimplexId &cellId) const {
345#ifndef TTK_ENABLE_KAMIKAZE
346 if(getDimensionality() == 1)
347 return -1;
348
350 return -2;
351#endif
352 if(getDimensionality() == 2)
353 return getCellNeighborNumber(cellId);
354
355 return getCellTriangleNumberInternal(cellId);
356 }
357
389 virtual inline const std::vector<std::vector<SimplexId>> *
391#ifndef TTK_ENABLE_KAMIKAZE
392 if(getDimensionality() == 1)
393 return nullptr;
394
396 return nullptr;
397#endif
398 if(getDimensionality() == 2)
399 return getCellNeighbors();
400
402 }
403
415 virtual inline int getCellVertex(const SimplexId &cellId,
416 const int &localVertexId,
417 SimplexId &vertexId) const {
418
419 return getCellVertexInternal(cellId, localVertexId, vertexId);
420 }
421
428 virtual inline SimplexId
429 getCellVertexNumber(const SimplexId &cellId) const {
430 return getCellVertexNumberInternal(cellId);
431 }
432
436 virtual inline int getDimensionality() const {
438 }
439
464 virtual inline const std::vector<std::array<SimplexId, 2>> *getEdges() {
465#ifndef TTK_ENABLE_KAMIKAZE
466 if(getDimensionality() == 1)
467 return nullptr;
468
470 return nullptr;
471#endif
472 return getEdgesInternal();
473 }
474
494 virtual inline int getEdgeLink(const SimplexId &edgeId,
495 const int &localLinkId,
496 SimplexId &linkId) const {
497#ifndef TTK_ENABLE_KAMIKAZE
498 // initialize output variable before early return
499 linkId = -1;
500
501 if(getDimensionality() == 1)
502 return -1;
503
505 return -2;
506#endif
507 return getEdgeLinkInternal(edgeId, localLinkId, linkId);
508 }
509
524 virtual inline SimplexId getEdgeLinkNumber(const SimplexId &edgeId) const {
525#ifndef TTK_ENABLE_KAMIKAZE
526 if(getDimensionality() == 1)
527 return -1;
528
530 return -2;
531#endif
532 return getEdgeLinkNumberInternal(edgeId);
533 }
534
558 virtual inline const std::vector<std::vector<SimplexId>> *getEdgeLinks() {
559#ifndef TTK_ENABLE_KAMIKAZE
560 if(getDimensionality() == 1)
561 return nullptr;
562
564 return nullptr;
565#endif
566 return getEdgeLinksInternal();
567 }
568
591 virtual inline int getEdgeStar(const SimplexId &edgeId,
592 const int &localStarId,
593 SimplexId &starId) const {
594
595#ifndef TTK_ENABLE_KAMIKAZE
596 // initialize output variable before early return
597 starId = -1;
598
599 if(getDimensionality() == 1)
600 return -1;
601
603 return -2;
604#endif
605 return getEdgeStarInternal(edgeId, localStarId, starId);
606 }
607
625 virtual inline SimplexId getEdgeStarNumber(const SimplexId &edgeId) const {
626#ifndef TTK_ENABLE_KAMIKAZE
627 if(getDimensionality() == 1)
628 return -1;
629
631 return -2;
632#endif
633 return getEdgeStarNumberInternal(edgeId);
634 }
635
664 virtual inline const std::vector<std::vector<SimplexId>> *getEdgeStars() {
665#ifndef TTK_ENABLE_KAMIKAZE
666 if(getDimensionality() == 1)
667 return nullptr;
668
670 return nullptr;
671#endif
672 return getEdgeStarsInternal();
673 }
674
694 virtual inline int getEdgeTriangle(const SimplexId &edgeId,
695 const int &localTriangleId,
696 SimplexId &triangleId) const {
697#ifndef TTK_ENABLE_KAMIKAZE
698 // initialize output variable before early return
699 triangleId = -1;
700
701 if(getDimensionality() == 1)
702 return -1;
703
705 return -2;
706#endif
707 if(getDimensionality() == 2)
708 return getEdgeStar(edgeId, localTriangleId, triangleId);
709
710 return getEdgeTriangleInternal(edgeId, localTriangleId, triangleId);
711 }
712
727 virtual inline SimplexId
728 getEdgeTriangleNumber(const SimplexId &edgeId) const {
729#ifndef TTK_ENABLE_KAMIKAZE
730 if(getDimensionality() == 1)
731 return -1;
732
734 return -2;
735#endif
736
737 if(getDimensionality() == 2)
738 return getEdgeStarNumber(edgeId);
739
740 return getEdgeTriangleNumberInternal(edgeId);
741 }
742
768 virtual inline const std::vector<std::vector<SimplexId>> *
770#ifndef TTK_ENABLE_KAMIKAZE
771 if(getDimensionality() == 1)
772 return nullptr;
773
775 return nullptr;
776#endif
777
778 if(getDimensionality() == 2)
779 return getEdgeStars();
780
782 }
783
801 virtual inline int getEdgeVertex(const SimplexId &edgeId,
802 const int &localVertexId,
803 SimplexId &vertexId) const {
804#ifndef TTK_ENABLE_KAMIKAZE
805 // initialize output variable before early return
806 vertexId = -1;
807
809 return -2;
810#endif
811 if(getDimensionality() == 1)
812 return getCellVertex(edgeId, localVertexId, vertexId);
813
814 return getEdgeVertexInternal(edgeId, localVertexId, vertexId);
815 }
816
819 inline int getEdgeVertexNumber(const SimplexId ttkNotUsed(edgeId)) const {
820 return 2;
821 }
822
830 virtual inline const std::array<SimplexId, 3> &getGridDimensions() const {
831 return this->gridDimensions_;
832 }
833
839 virtual inline SimplexId getNumberOfCells() const {
841 }
842
856 virtual inline SimplexId getNumberOfEdges() const {
857#ifndef TTK_ENABLE_KAMIKAZE
859 return -2;
860#endif
861 if(getDimensionality() == 1)
862 return getNumberOfCells();
863
865 }
866
880 virtual inline SimplexId getNumberOfTriangles() const {
881#ifndef TTK_ENABLE_KAMIKAZE
882 if(getDimensionality() == 1)
883 return -1;
884
886 return -2;
887#endif
888 if(getDimensionality() == 2)
889 return getNumberOfCells();
890
892 }
893
896 virtual inline SimplexId getNumberOfVertices() const {
898 }
899
924 virtual inline const std::vector<std::array<SimplexId, 3>> *getTriangles() {
925#ifndef TTK_ENABLE_KAMIKAZE
927 return nullptr;
928#endif
929 return getTrianglesInternal();
930 }
931
950 virtual inline int getTriangleEdge(const SimplexId &triangleId,
951 const int &localEdgeId,
952 SimplexId &edgeId) const {
953#ifndef TTK_ENABLE_KAMIKAZE
954 // initialize output variable before early return
955 edgeId = -1;
956
957 if(getDimensionality() == 1)
958 return -1;
959
961 return -2;
962#endif
963
964 return getTriangleEdgeInternal(triangleId, localEdgeId, edgeId);
965 }
966
981 virtual inline SimplexId
982 getTriangleEdgeNumber(const SimplexId &triangleId) const {
983#ifndef TTK_ENABLE_KAMIKAZE
984 if(getDimensionality() == 1)
985 return -1;
986
988 return -2;
989#endif
990
991 return getTriangleEdgeNumberInternal(triangleId);
992 }
993
1019 virtual inline const std::vector<std::vector<SimplexId>> *
1021#ifndef TTK_ENABLE_KAMIKAZE
1022 if(getDimensionality() == 1)
1023 return nullptr;
1024
1026 return nullptr;
1027#endif
1028
1029 return getTriangleEdgesInternal();
1030 }
1031
1051 virtual inline int getTriangleLink(const SimplexId &triangleId,
1052 const int &localLinkId,
1053 SimplexId &linkId) const {
1054#ifndef TTK_ENABLE_KAMIKAZE
1055 // initialize output variable before early return
1056 linkId = -1;
1057
1058 if(getDimensionality() != 3)
1059 return -1;
1060
1062 return -2;
1063#endif
1064 return getTriangleLinkInternal(triangleId, localLinkId, linkId);
1065 }
1066
1082 virtual inline SimplexId
1083 getTriangleLinkNumber(const SimplexId &triangleId) const {
1084#ifndef TTK_ENABLE_KAMIKAZE
1085 if(getDimensionality() != 3)
1086 return -1;
1087
1089 return -2;
1090#endif
1091 return getTriangleLinkNumberInternal(triangleId);
1092 }
1093
1118 virtual inline const std::vector<std::vector<SimplexId>> *
1120#ifndef TTK_ENABLE_KAMIKAZE
1121 if(getDimensionality() != 3)
1122 return nullptr;
1123
1125 return nullptr;
1126#endif
1127 return getTriangleLinksInternal();
1128 }
1129
1150 virtual inline int getTriangleStar(const SimplexId &triangleId,
1151 const int &localStarId,
1152 SimplexId &starId) const {
1153#ifndef TTK_ENABLE_KAMIKAZE
1154 // initialize output variable before early return
1155 starId = -1;
1156
1157 if(getDimensionality() != 3)
1158 return -1;
1159
1161 return -2;
1162#endif
1163 return getTriangleStarInternal(triangleId, localStarId, starId);
1164 }
1165
1180 virtual inline SimplexId
1181 getTriangleStarNumber(const SimplexId &triangleId) const {
1182#ifndef TTK_ENABLE_KAMIKAZE
1183 if(getDimensionality() != 3)
1184 return -1;
1185
1187 return -2;
1188#endif
1189 return getTriangleStarNumberInternal(triangleId);
1190 }
1191
1217 virtual inline const std::vector<std::vector<SimplexId>> *
1219#ifndef TTK_ENABLE_KAMIKAZE
1220 if(getDimensionality() != 3)
1221 return nullptr;
1222
1224 return nullptr;
1225#endif
1226 return getTriangleStarsInternal();
1227 }
1228
1246 virtual inline int getTriangleVertex(const SimplexId &triangleId,
1247 const int &localVertexId,
1248 SimplexId &vertexId) const {
1249#ifndef TTK_ENABLE_KAMIKAZE
1250 // initialize output variable before early return
1251 vertexId = -1;
1252
1253 if(getDimensionality() == 1)
1254 return -1;
1255
1257 return -2;
1258#endif
1259 if(getDimensionality() == 2)
1260 return getCellVertex(triangleId, localVertexId, vertexId);
1261
1262 return getTriangleVertexInternal(triangleId, localVertexId, vertexId);
1263 }
1264
1267 inline int
1269 return 3;
1270 }
1271
1292 virtual inline int getVertexEdge(const SimplexId &vertexId,
1293 const int &localEdgeId,
1294 SimplexId &edgeId) const {
1295
1296#ifndef TTK_ENABLE_KAMIKAZE
1297 // initialize output variable before early return
1298 edgeId = -1;
1299
1301 return -1;
1302#endif
1303 if(getDimensionality() == 1)
1304 return getVertexStar(vertexId, localEdgeId, edgeId);
1305
1306 return getVertexEdgeInternal(vertexId, localEdgeId, edgeId);
1307 }
1308
1323 virtual inline SimplexId
1324 getVertexEdgeNumber(const SimplexId &vertexId) const {
1325#ifndef TTK_ENABLE_KAMIKAZE
1327 return -1;
1328#endif
1329 if(getDimensionality() == 1)
1330 return getVertexStarNumber(vertexId);
1331
1332 return getVertexEdgeNumberInternal(vertexId);
1333 }
1334
1361 virtual inline const std::vector<std::vector<SimplexId>> *getVertexEdges() {
1362#ifndef TTK_ENABLE_KAMIKAZE
1364 return nullptr;
1365#endif
1366 if(getDimensionality() == 1)
1367 return getVertexStars();
1368
1369 return getVertexEdgesInternal();
1370 }
1371
1391 virtual inline int getVertexLink(const SimplexId &vertexId,
1392 const int &localLinkId,
1393 SimplexId &linkId) const {
1394#ifndef TTK_ENABLE_KAMIKAZE
1395 // initialize output variable before early return
1396 linkId = -1;
1397
1399 return -1;
1400#endif
1401 return getVertexLinkInternal(vertexId, localLinkId, linkId);
1402 }
1403
1418 virtual inline SimplexId
1419 getVertexLinkNumber(const SimplexId &vertexId) const {
1420#ifndef TTK_ENABLE_KAMIKAZE
1422 return -1;
1423#endif
1424 return getVertexLinkNumberInternal(vertexId);
1425 }
1426
1451 virtual inline const std::vector<std::vector<SimplexId>> *getVertexLinks() {
1452#ifndef TTK_ENABLE_KAMIKAZE
1454 return nullptr;
1455#endif
1456 return getVertexLinksInternal();
1457 }
1458
1475 virtual inline int getVertexNeighbor(const SimplexId &vertexId,
1476 const int &localNeighborId,
1477 SimplexId &neighborId) const {
1478#ifndef TTK_ENABLE_KAMIKAZE
1479 // initialize output variable before early return
1480 neighborId = -1;
1481
1483 return -1;
1484#endif
1485 return getVertexNeighborInternal(vertexId, localNeighborId, neighborId);
1486 }
1487
1499 virtual inline SimplexId
1500 getVertexNeighborNumber(const SimplexId &vertexId) const {
1501#ifndef TTK_ENABLE_KAMIKAZE
1503 return -1;
1504#endif
1505 return getVertexNeighborNumberInternal(vertexId);
1506 }
1507
1531 virtual inline const std::vector<std::vector<SimplexId>> *
1533#ifndef TTK_ENABLE_KAMIKAZE
1535 return nullptr;
1536#endif
1538 }
1539
1546 virtual inline int getVertexPoint(const SimplexId &vertexId,
1547 float &x,
1548 float &y,
1549 float &z) const {
1550 return getVertexPointInternal(vertexId, x, y, z);
1551 }
1552
1573 virtual inline int getVertexStar(const SimplexId &vertexId,
1574 const int &localStarId,
1575 SimplexId &starId) const {
1576#ifndef TTK_ENABLE_KAMIKAZE
1577 // initialize output variable before early return
1578 starId = -1;
1579
1581 return -1;
1582#endif
1583 return getVertexStarInternal(vertexId, localStarId, starId);
1584 }
1585
1600 virtual inline SimplexId
1601 getVertexStarNumber(const SimplexId &vertexId) const {
1602#ifndef TTK_ENABLE_KAMIKAZE
1604 return -1;
1605#endif
1606 return getVertexStarNumberInternal(vertexId);
1607 }
1608
1634 virtual inline const std::vector<std::vector<SimplexId>> *getVertexStars() {
1635#ifndef TTK_ENABLE_KAMIKAZE
1637 return nullptr;
1638#endif
1639 return getVertexStarsInternal();
1640 }
1641
1662 virtual inline int getVertexTriangle(const SimplexId &vertexId,
1663 const int &localTriangleId,
1664 SimplexId &triangleId) const {
1665#ifndef TTK_ENABLE_KAMIKAZE
1666 // initialize output variable before early return
1667 triangleId = -1;
1668
1669 if(getDimensionality() == 1)
1670 return -1;
1671
1673 return -2;
1674#endif
1675 if(getDimensionality() == 2)
1676 return getVertexStar(vertexId, localTriangleId, triangleId);
1677
1678 return getVertexTriangleInternal(vertexId, localTriangleId, triangleId);
1679 }
1680
1695 virtual inline SimplexId
1696 getVertexTriangleNumber(const SimplexId &vertexId) const {
1697#ifndef TTK_ENABLE_KAMIKAZE
1698 if(getDimensionality() == 1)
1699 return -1;
1700
1702 return -2;
1703#endif
1704
1705 if(getDimensionality() == 2)
1706 return getVertexStarNumber(vertexId);
1707
1708 return getVertexTriangleNumberInternal(vertexId);
1709 }
1710
1736 virtual inline const std::vector<std::vector<SimplexId>> *
1738#ifndef TTK_ENABLE_KAMIKAZE
1739 if(getDimensionality() == 1)
1740 return nullptr;
1741
1743 return nullptr;
1744#endif
1745 if(getDimensionality() == 2)
1746 return getVertexStars();
1747
1749 }
1750
1752 inline bool hasPeriodicBoundaries() const {
1754 }
1755
1775 virtual inline bool isEdgeOnBoundary(const SimplexId &edgeId) const {
1776#ifndef TTK_ENABLE_KAMIKAZE
1778 return false;
1779#endif
1780 return isEdgeOnBoundaryInternal(edgeId);
1781 }
1782
1785 virtual inline bool isEmpty() const {
1786 return true;
1787 }
1788
1792 virtual inline bool isManifold() const {
1793#ifndef TTK_ENABLE_KAMIKAZE
1794 if(!this->hasPreconditionedManifold())
1795 return false;
1796#endif
1797 return this->isManifold_;
1798 }
1799
1820 virtual inline int preconditionManifold() {
1821
1822 if(!this->hasPreconditionedManifold_) {
1824 this->hasPreconditionedManifold_ = true;
1825 }
1826 return 0;
1827 }
1828
1849 virtual inline bool
1850 isTriangleOnBoundary(const SimplexId &triangleId) const {
1851#ifndef TTK_ENABLE_KAMIKAZE
1853 return false;
1854#endif
1855 return isTriangleOnBoundaryInternal(triangleId);
1856 }
1857
1875 virtual inline bool isVertexOnBoundary(const SimplexId &vertexId) const {
1876#ifndef TTK_ENABLE_KAMIKAZE
1878 return false;
1879#endif
1880 return isVertexOnBoundaryInternal(vertexId);
1881 }
1882
1896 virtual inline int preconditionBoundaryEdges() {
1897
1902 }
1903 return 0;
1904 }
1905
1928
1942 virtual inline int preconditionBoundaryVertices() {
1943
1947 }
1948 return 0;
1949 }
1950
1966 virtual inline int preconditionCellEdges() {
1967
1970 if(getDimensionality() == 1)
1972
1975 }
1976 return 0;
1977 }
1978
1996 virtual inline int preconditionCellNeighbors() {
1997
2001 }
2002 return 0;
2003 }
2004
2022 virtual inline int preconditionCellTriangles() {
2023
2026
2027#ifndef TTK_ENABLE_KAMIKAZE
2028 if(getDimensionality() == 1)
2029 return -1;
2030#endif
2031 if(getDimensionality() == 2)
2033
2036 }
2037 return 0;
2038 }
2039
2057 virtual inline int preconditionEdges() {
2058
2062 }
2063 return 0;
2064 }
2065
2083 virtual inline int preconditionEdgeLinks() {
2084
2086#ifndef TTK_ENABLE_KAMIKAZE
2087 if(getDimensionality() == 1)
2088 return -1;
2089#endif
2093 }
2094 return 0;
2095 }
2096
2114 virtual inline int preconditionEdgeStars() {
2115
2117#ifndef TTK_ENABLE_KAMIKAZE
2118 if(getDimensionality() == 1)
2119 return -1;
2120#endif
2124 }
2125 return 0;
2126 }
2127
2145 virtual inline int preconditionEdgeTriangles() {
2146
2149
2150#ifndef TTK_ENABLE_KAMIKAZE
2151 if(getDimensionality() == 1)
2152 return -1;
2153#endif
2154
2155 if(getDimensionality() == 2)
2156 return preconditionEdgeStars();
2157
2161 }
2162
2163 return 0;
2164 }
2165
2183 virtual inline int preconditionTriangles() {
2184
2187
2188#ifndef TTK_ENABLE_KAMIKAZE
2189 if(getDimensionality() == 1)
2190 return -1;
2191#endif
2192 if(getDimensionality() == 2)
2193 return 0;
2194
2196 }
2197
2198 return 0;
2199 }
2200
2218 virtual inline int preconditionTriangleEdges() {
2219
2222
2223#ifndef TTK_ENABLE_KAMIKAZE
2224 if(getDimensionality() == 1)
2225 return -1;
2226#endif
2227 if(getDimensionality() == 2)
2228 return preconditionCellEdges();
2229
2233 }
2234 return 0;
2235 }
2236
2254 virtual inline int preconditionTriangleLinks() {
2255
2257#ifndef TTK_ENABLE_KAMIKAZE
2258 if(getDimensionality() != 3)
2259 return -2;
2260#endif
2264 }
2265 return 0;
2266 }
2267
2285 virtual inline int preconditionTriangleStars() {
2286
2288#ifndef TTK_ENABLE_KAMIKAZE
2289 if(getDimensionality() != 3)
2290 return -1;
2291#endif
2295 }
2296 return 0;
2297 }
2298
2316 virtual inline int preconditionVertexEdges() {
2317
2320
2321 if(getDimensionality() == 1)
2322 return preconditionVertexStars();
2323
2326 }
2327 return 0;
2328 }
2329
2347 virtual inline int preconditionVertexLinks() {
2348
2352 }
2353 return 0;
2354 }
2355
2373 virtual inline int preconditionVertexNeighbors() {
2374
2378 }
2379 return 0;
2380 }
2381
2399 virtual inline int preconditionVertexStars() {
2400
2404 }
2405 return 0;
2406 }
2407
2425 virtual inline int preconditionVertexTriangles() {
2426
2429
2430#ifndef TTK_ENABLE_KAMIKAZE
2431 if(getDimensionality() == 1)
2432 return -1;
2433#endif
2434
2435 if(getDimensionality() == 2)
2436 return preconditionVertexStars();
2437
2440 }
2441 return 0;
2442 }
2443
2447 inline int getEdgeIncenter(const SimplexId edgeId,
2448 float incenter[3]) const {
2449 std::array<SimplexId, 2> vertexId{};
2450 getEdgeVertex(edgeId, 0, vertexId[0]);
2451 getEdgeVertex(edgeId, 1, vertexId[1]);
2452
2453 std::array<float, 6> p{};
2454 getVertexPoint(vertexId[0], p[0], p[1], p[2]);
2455 getVertexPoint(vertexId[1], p[3], p[4], p[5]);
2456
2457 incenter[0] = 0.5 * p[0] + 0.5 * p[3];
2458 incenter[1] = 0.5 * p[1] + 0.5 * p[4];
2459 incenter[2] = 0.5 * p[2] + 0.5 * p[5];
2460
2461 return 0;
2462 }
2463
2467 inline int getTriangleIncenter(const SimplexId triangleId,
2468 float incenter[3]) const {
2469
2470 std::array<SimplexId, 3> vertexId{};
2471 if(getDimensionality() == 2) {
2472 getCellVertex(triangleId, 0, vertexId[0]);
2473 getCellVertex(triangleId, 1, vertexId[1]);
2474 getCellVertex(triangleId, 2, vertexId[2]);
2475 } else if(getDimensionality() == 3) {
2476 getTriangleVertex(triangleId, 0, vertexId[0]);
2477 getTriangleVertex(triangleId, 1, vertexId[1]);
2478 getTriangleVertex(triangleId, 2, vertexId[2]);
2479 }
2480
2481 std::array<float, 9> p{};
2482 getVertexPoint(vertexId[0], p[0], p[1], p[2]);
2483 getVertexPoint(vertexId[1], p[3], p[4], p[5]);
2484 getVertexPoint(vertexId[2], p[6], p[7], p[8]);
2485
2486 std::array<float, 3> d{};
2487 d[0] = Geometry::distance(&p[3], &p[6]);
2488 d[1] = Geometry::distance(&p[0], &p[6]);
2489 d[2] = Geometry::distance(&p[0], &p[3]);
2490 const float sum = d[0] + d[1] + d[2];
2491
2492 d[0] = d[0] / sum;
2493 d[1] = d[1] / sum;
2494 d[2] = d[2] / sum;
2495
2496 incenter[0] = d[0] * p[0] + d[1] * p[3] + d[2] * p[6];
2497 incenter[1] = d[0] * p[1] + d[1] * p[4] + d[2] * p[7];
2498 incenter[2] = d[0] * p[2] + d[1] * p[5] + d[2] * p[8];
2499
2500 return 0;
2501 }
2502
2507 inline int getTetraIncenter(const SimplexId tetraId,
2508 float incenter[3]) const {
2509 incenter[0] = 0.0f;
2510 incenter[1] = 0.0f;
2511 incenter[2] = 0.0f;
2512
2513 std::array<float, 3> p{};
2514 for(int i = 0; i < 4; ++i) {
2515 SimplexId triangleId{-1};
2516 getCellTriangle(tetraId, i, triangleId);
2517 getTriangleIncenter(triangleId, p.data());
2518 incenter[0] += p[0];
2519 incenter[1] += p[1];
2520 incenter[2] += p[2];
2521 }
2522
2523 incenter[0] /= 4.0f;
2524 incenter[1] /= 4.0f;
2525 incenter[2] /= 4.0f;
2526
2527 return 0;
2528 }
2529
2533 inline int getCellIncenter(const SimplexId cellid,
2534 const int dim,
2535 float incenter[3]) const {
2536 switch(dim) {
2537 case 0:
2538 getVertexPoint(cellid, incenter[0], incenter[1], incenter[2]);
2539 break;
2540 case 1:
2541 getEdgeIncenter(cellid, incenter);
2542 break;
2543 case 2:
2544 getTriangleIncenter(cellid, incenter);
2545 break;
2546 case 3:
2547 getTetraIncenter(cellid, incenter);
2548 break;
2549 }
2550 return 0;
2551 }
2552
2553 virtual inline int getCellVTKID(const int &ttkId, int &vtkId) const {
2554
2555#ifndef TTK_ENABLE_KAMIKAZE
2556 // initialize output variable before early return
2557 vtkId = -1;
2558#endif
2559 return getCellVTKIDInternal(ttkId, vtkId);
2560 }
2561
2562#ifdef TTK_ENABLE_MPI
2563
2564 // "vtkGhostType" on points & cells
2565
2566 inline void setVertexGhostArray(const unsigned char *const data) {
2567 this->vertexGhost_ = data;
2568 }
2569
2570 inline void setCellGhostArray(const unsigned char *const data) {
2571 this->cellGhost_ = data;
2572 }
2573
2584 virtual int preconditionGlobalBoundary() {
2585
2586 if(!hasPreconditionedGlobalBoundary_) {
2587 preconditionGlobalBoundaryInternal();
2588 hasPreconditionedGlobalBoundary_ = true;
2589 }
2590 return 0;
2591 }
2592
2593 virtual inline int preconditionGlobalBoundaryInternal() {
2594 return 0;
2595 }
2596
2597 // public preconditions methods (used in Triangulation/ttkAlgorithm)
2598 virtual int preconditionDistributedVertices() {
2599 return 0;
2600 }
2601 virtual int preconditionDistributedCells() {
2602 return 0;
2603 }
2604
2605 inline void setBoundingBox(const double *const bBox) {
2606 this->boundingBox_
2607 = {bBox[0], bBox[1], bBox[2], bBox[3], bBox[4], bBox[5]};
2608 }
2609
2610 // This method should be called to initialize and populate the
2611 // ghostCellsPerOwner_ and the remoteGhostCells_ attributes.
2612
2613 virtual int preconditionExchangeGhostCells() {
2614 return 0;
2615 }
2616
2617 // This method should be called to initialize and populate the
2618 // ghostVerticesPerOwner_ and the remoteGhostVertices_ attributes.
2619
2620 virtual int preconditionExchangeGhostVertices() {
2621 return 0;
2622 }
2623
2624 virtual int setVertexRankArray(const int *ttkNotUsed(rankArray)) {
2625 return 0;
2626 }
2627
2628 virtual int setCellRankArray(const int *ttkNotUsed(rankArray)) {
2629 return 0;
2630 }
2631
2632 virtual int preconditionEdgeRankArray() {
2633 return 0;
2634 }
2635
2636 virtual int preconditionTriangleRankArray() {
2637 return 0;
2638 }
2639
2640 // global <-> local id mappings
2641
2642 virtual inline SimplexId getVertexGlobalId(const SimplexId lvid) const {
2643 if(!ttk::isRunningWithMPI()) {
2644 return lvid;
2645 }
2646#ifndef TTK_ENABLE_KAMIKAZE
2647 if(this->getDimensionality() != 1 && this->getDimensionality() != 2
2648 && this->getDimensionality() != 3) {
2649 this->printErr("Only 1D, 2D and 3D datasets are supported");
2650 return -1;
2651 }
2652 if(!this->hasPreconditionedDistributedVertices_) {
2653 this->printErr("VertexGlobalId query without pre-process!");
2654 this->printErr(
2655 "Please call preconditionDistributedVertices() in a pre-process.");
2656 return -1;
2657 }
2658 if(lvid < 0 || lvid >= this->getNumberOfVertices()) {
2659 return -1;
2660 }
2661#endif // TTK_ENABLE_KAMIKAZE
2662 return this->getVertexGlobalIdInternal(lvid);
2663 }
2664 virtual inline SimplexId getVertexLocalId(const SimplexId gvid) const {
2665
2666 if(!ttk::isRunningWithMPI()) {
2667 return gvid;
2668 }
2669#ifndef TTK_ENABLE_KAMIKAZE
2670 if(this->getDimensionality() != 1 && this->getDimensionality() != 2
2671 && this->getDimensionality() != 3) {
2672 this->printErr("Only 1D, 2D and 3D datasets are supported");
2673 return -1;
2674 }
2675 if(!this->hasPreconditionedDistributedVertices_) {
2676 this->printErr("VertexLocalId query without pre-process!");
2677 this->printErr(
2678 "Please call preconditionDistributedVertices() in a pre-process.");
2679 return -1;
2680 }
2681#endif // TTK_ENABLE_KAMIKAZE
2682 return this->getVertexLocalIdInternal(gvid);
2683 }
2684
2685 virtual inline SimplexId getCellGlobalId(const SimplexId lcid) const {
2686#ifndef TTK_ENABLE_KAMIKAZE
2687 if(this->getDimensionality() != 1 && this->getDimensionality() != 2
2688 && this->getDimensionality() != 3) {
2689 this->printErr("Only 1D, 2D and 3D datasets are supported");
2690 return -1;
2691 }
2692 if(!this->hasPreconditionedDistributedCells_) {
2693 this->printErr("CellGlobalId query without pre-process!");
2694 this->printErr(
2695 "Please call preconditionDistributedCells() in a pre-process.");
2696 return -1;
2697 }
2698 if(lcid < 0 || lcid >= this->getNumberOfCells()) {
2699 return -1;
2700 }
2701#endif // TTK_ENABLE_KAMIKAZE
2702 if(!ttk::isRunningWithMPI()) {
2703 return lcid;
2704 }
2705 return this->getCellGlobalIdInternal(lcid);
2706 }
2707 virtual inline SimplexId getCellLocalId(const SimplexId gcid) const {
2708#ifndef TTK_ENABLE_KAMIKAZE
2709 if(this->getDimensionality() != 1 && this->getDimensionality() != 2
2710 && this->getDimensionality() != 3) {
2711 this->printErr("Only 1D, 2D and 3D datasets are supported");
2712 return -1;
2713 }
2714 if(!this->hasPreconditionedDistributedCells_) {
2715 this->printErr("CellLocalId query without pre-process!");
2716 this->printErr(
2717 "Please call preconditionDistributedCells() in a pre-process.");
2718 return -1;
2719 }
2720#endif // TTK_ENABLE_KAMIKAZE
2721 if(!ttk::isRunningWithMPI()) {
2722 return gcid;
2723 }
2724 return this->getCellLocalIdInternal(gcid);
2725 }
2726
2727 virtual inline SimplexId getEdgeGlobalId(const SimplexId leid) const {
2728 const auto dim{this->getDimensionality()};
2729#ifndef TTK_ENABLE_KAMIKAZE
2730 if(dim != 1 && dim != 2 && dim != 3) {
2731 this->printErr("Only 1D, 2D and 3D datasets are supported");
2732 return -1;
2733 }
2734 if(!this->hasPreconditionedDistributedEdges_) {
2735 this->printErr("EdgeGlobalId query without pre-process!");
2736 this->printErr(
2737 "Please call preconditionDistributedEdges() in a pre-process.");
2738 return -1;
2739 }
2740 if(leid < 0 || leid >= this->getNumberOfEdges()) {
2741 return -1;
2742 }
2743#endif // TTK_ENABLE_KAMIKAZE
2744 if(!ttk::isRunningWithMPI()) {
2745 return leid;
2746 }
2747 if(dim == 2 || dim == 3) {
2748 return this->getEdgeGlobalIdInternal(leid);
2749 } else if(dim == 1) {
2750 return this->getCellGlobalIdInternal(leid);
2751 }
2752 return -1;
2753 }
2754 virtual inline SimplexId getEdgeLocalId(const SimplexId geid) const {
2755 const auto dim{this->getDimensionality()};
2756#ifndef TTK_ENABLE_KAMIKAZE
2757 if(dim != 1 && dim != 2 && dim != 3) {
2758 this->printErr("Only 1D, 2D and 3D datasets are supported");
2759 return -1;
2760 }
2761 if(!this->hasPreconditionedDistributedEdges_) {
2762 this->printErr("EdgeLocalId query without pre-process!");
2763 this->printErr(
2764 "Please call preconditionDistributedEdges() in a pre-process.");
2765 return -1;
2766 }
2767#endif // TTK_ENABLE_KAMIKAZE
2768 if(!ttk::isRunningWithMPI()) {
2769 return geid;
2770 }
2771 if(dim == 2 || dim == 3) {
2772 return this->getEdgeLocalIdInternal(geid);
2773 } else if(dim == 1) {
2774 return this->getCellLocalIdInternal(geid);
2775 }
2776 return -1;
2777 }
2778
2779 virtual inline SimplexId getTriangleGlobalId(const SimplexId ltid) const {
2780 const auto dim{this->getDimensionality()};
2781#ifndef TTK_ENABLE_KAMIKAZE
2782 if(dim != 3 && dim != 2) {
2783 this->printErr("Only 2D and 3D datasets are supported");
2784 return -1;
2785 }
2786 if(!this->hasPreconditionedDistributedEdges_) {
2787 this->printErr("TriangleGlobalId query without pre-process!");
2788 this->printErr(
2789 "Please call preconditionDistributedTriangles() in a pre-process.");
2790 return -1;
2791 }
2792 if(ltid < 0 || ltid >= this->getNumberOfTriangles()) {
2793 return -1;
2794 }
2795#endif // TTK_ENABLE_KAMIKAZE
2796 if(!ttk::isRunningWithMPI()) {
2797 return ltid;
2798 }
2799 if(dim == 3) {
2800 return this->getTriangleGlobalIdInternal(ltid);
2801 } else if(dim == 2) {
2802 return this->getCellGlobalIdInternal(ltid);
2803 }
2804 return -1;
2805 }
2806 virtual inline SimplexId getTriangleLocalId(const SimplexId gtid) const {
2807 const auto dim{this->getDimensionality()};
2808#ifndef TTK_ENABLE_KAMIKAZE
2809 if(dim != 3 && dim != 2) {
2810 this->printErr("Only 2D and 3D datasets are supported");
2811 return -1;
2812 }
2813 if(!this->hasPreconditionedDistributedEdges_) {
2814 this->printErr("TriangleLocalId query without pre-process!");
2815 this->printErr(
2816 "Please call preconditionDistributedTriangles() in a pre-process.");
2817 return -1;
2818 }
2819#endif // TTK_ENABLE_KAMIKAZE
2820 if(!ttk::isRunningWithMPI()) {
2821 return gtid;
2822 }
2823 if(dim == 3) {
2824 return this->getTriangleLocalIdInternal(gtid);
2825 } else if(dim == 2) {
2826 return this->getCellLocalIdInternal(gtid);
2827 }
2828 return -1;
2829 }
2830
2831 inline ttk::SimplexId getSimplexLocalId(const SimplexId gsid,
2832 const int type) const {
2833 if(!ttk::isRunningWithMPI()) {
2834 return gsid;
2835 }
2836 switch(type) {
2837 case 0:
2838 return this->getVertexLocalId(gsid);
2839 case 1:
2840 return this->getEdgeLocalId(gsid);
2841 case 2:
2842 return this->getTriangleLocalId(gsid);
2843 default:
2844 return this->getCellLocalId(gsid);
2845 }
2846 }
2847
2848 virtual inline int getVertexRank(const SimplexId lvid) const {
2849
2850 if(!ttk::isRunningWithMPI()) {
2851 return 0;
2852 }
2853#ifndef TTK_ENABLE_KAMIKAZE
2854 if(this->getDimensionality() != 1 && this->getDimensionality() != 2
2855 && this->getDimensionality() != 3) {
2856 this->printErr("Only 1D, 2D and 3D datasets are supported");
2857 return -1;
2858 }
2859 if(!this->hasPreconditionedDistributedVertices_) {
2860 this->printErr("VertexRankId query without pre-process!");
2861 this->printErr(
2862 "Please call preconditionDistributedVertices() in a pre-process.");
2863 return -1;
2864 }
2865 if(lvid < 0 || lvid >= this->getNumberOfVertices()) {
2866 return -1;
2867 }
2868#endif // TTK_ENABLE_KAMIKAZE
2869 return this->getVertexRankInternal(lvid);
2870 }
2871
2872 virtual inline int getEdgeRank(const SimplexId lvid) const {
2873
2874 if(!ttk::isRunningWithMPI()) {
2875 return 0;
2876 }
2877#ifndef TTK_ENABLE_KAMIKAZE
2878 if(this->getDimensionality() != 1 && this->getDimensionality() != 2
2879 && this->getDimensionality() != 3) {
2880 this->printErr("Only 1D, 2D and 3D datasets are supported");
2881 return -1;
2882 }
2883 if(!this->hasPreconditionedDistributedEdges_) {
2884 this->printErr("EdgeRankId query without pre-process!");
2885 this->printErr(
2886 "Please call preconditionDistributedEdges() in a pre-process.");
2887 return -1;
2888 }
2889 if(lvid < 0 || lvid >= this->getNumberOfEdges()) {
2890 return -1;
2891 }
2892#endif // TTK_ENABLE_KAMIKAZE
2893 return this->getEdgeRankInternal(lvid);
2894 }
2895
2896 virtual inline int getTriangleRank(const SimplexId lvid) const {
2897
2898 if(!ttk::isRunningWithMPI()) {
2899 return 0;
2900 }
2901#ifndef TTK_ENABLE_KAMIKAZE
2902 if(this->getDimensionality() != 1 && this->getDimensionality() != 2
2903 && this->getDimensionality() != 3) {
2904 this->printErr("Only 1D, 2D and 3D datasets are supported");
2905 return -1;
2906 }
2907 if(!this->hasPreconditionedDistributedTriangles_) {
2908 this->printErr("TriangleRankId query without pre-process!");
2909 this->printErr(
2910 "Please call preconditionDistributedTriangles() in a pre-process.");
2911 return -1;
2912 }
2913 if(lvid < 0 || lvid >= this->getNumberOfTriangles()) {
2914 return -1;
2915 }
2916#endif // TTK_ENABLE_KAMIKAZE
2917 return this->getTriangleRankInternal(lvid);
2918 }
2919
2920 virtual inline int getCellRank(const SimplexId lcid) const {
2921#ifndef TTK_ENABLE_KAMIKAZE
2922 if(this->getDimensionality() != 1 && this->getDimensionality() != 2
2923 && this->getDimensionality() != 3) {
2924 this->printErr("Only 1D, 2D and 3D datasets are supported");
2925 return -1;
2926 }
2927 if(!this->hasPreconditionedDistributedCells_) {
2928 this->printErr("CellRankId query without pre-process!");
2929 this->printErr(
2930 "Please call preconditionDistributedCells() in a pre-process.");
2931 return -1;
2932 }
2933 if(lcid < 0 || lcid >= this->getNumberOfCells()) {
2934 return -1;
2935 }
2936#endif // TTK_ENABLE_KAMIKAZE
2937 if(!ttk::isRunningWithMPI()) {
2938 return ttk::MPIrank_;
2939 }
2940 return this->getCellRankInternal(lcid);
2941 }
2942
2943 inline int getSimplexRank(const SimplexId lsid, const int type) const {
2944 if(!ttk::isRunningWithMPI()) {
2945 return ttk::MPIrank_;
2946 }
2947 switch(type) {
2948 case 0:
2949 return this->getVertexRank(lsid);
2950 case 1:
2951 return this->getEdgeRank(lsid);
2952 case 2: {
2953 if(getDimensionality() == 3)
2954 return this->getTriangleRank(lsid);
2955 return this->getCellRank(lsid);
2956 }
2957 case 3:
2958 return this->getCellRank(lsid);
2959 }
2960 return -1;
2961 }
2962
2963 virtual inline const std::vector<int> &getNeighborRanks() const {
2964 return this->neighborRanks_;
2965 }
2966 virtual inline std::vector<int> &getNeighborRanks() {
2967 return this->neighborRanks_;
2968 }
2969
2970 virtual inline std::map<int, int> &getNeighborsToId() {
2971 return this->neighborsToId_;
2972 }
2973
2974 virtual inline const std::map<int, int> &getNeighborsToId() const {
2975 return this->neighborsToId_;
2976 }
2977
2978 virtual inline const std::vector<std::array<ttk::SimplexId, 6>> &
2979 getNeighborVertexBBoxes() const {
2980 return this->neighborVertexBBoxes_;
2981 }
2982
2983 virtual inline const std::vector<std::vector<SimplexId>> &
2984 getGhostCellsPerOwner() const {
2985 if(!hasPreconditionedExchangeGhostCells_) {
2986 printErr("The ghostCellsOwner_ attribute has not been populated!");
2987 printErr(
2988 "Please call preconditionExchangeGhostCells in a pre-process.");
2989 }
2990 return this->ghostCellsPerOwner_;
2991 }
2992
2993 virtual inline const std::vector<std::vector<SimplexId>> &
2994 getRemoteGhostCells() const {
2995 if(!hasPreconditionedExchangeGhostCells_) {
2996 printErr("The remoteGhostCells_ attribute has not been populated!");
2997 printErr(
2998 "Please call preconditionExchangeGhostCells in a pre-process.");
2999 }
3000 return this->remoteGhostCells_;
3001 }
3002
3003 virtual inline const std::vector<std::vector<SimplexId>> &
3004 getGhostVerticesPerOwner() const {
3005 if(!hasPreconditionedExchangeGhostVertices_) {
3006 printErr(
3007 "The ghostVerticesPerOwner_ attribute has not been populated!");
3008 printErr(
3009 "Please call preconditionExchangeGhostVertices in a pre-process.");
3010 }
3011 return this->ghostVerticesPerOwner_;
3012 }
3013
3014 virtual inline const std::vector<std::vector<SimplexId>> &
3015 getRemoteGhostVertices() const {
3016 if(!hasPreconditionedExchangeGhostVertices_) {
3017 printErr("The remoteGhostVertices_ attribute has not been populated!");
3018 printErr(
3019 "Please call preconditionExchangeGhostVertices in a pre-process.");
3020 }
3021 return this->remoteGhostVertices_;
3022 }
3023
3024 virtual inline void setHasPreconditionedDistributedVertices(bool flag) {
3025 this->hasPreconditionedDistributedVertices_ = flag;
3026 }
3027
3028 virtual inline bool hasPreconditionedDistributedVertices() const {
3029 return this->hasPreconditionedDistributedVertices_;
3030 }
3031 virtual inline bool hasPreconditionedDistributedCells() const {
3032 return this->hasPreconditionedDistributedCells_;
3033 }
3034
3035 inline int getDistributedGlobalCellId(const SimplexId &localCellId,
3036 const int &cellDim,
3037 SimplexId &globalCellId) const {
3038 if(ttk::hasInitializedMPI()) {
3039 switch(cellDim) {
3040 case 0:
3041 globalCellId = this->getVertexGlobalIdInternal(localCellId);
3042 break;
3043 case 1:
3044 globalCellId = this->getEdgeGlobalIdInternal(localCellId);
3045 break;
3046 case 2:
3047 if(getDimensionality() == 2) {
3048 globalCellId = this->getCellGlobalIdInternal(localCellId);
3049 break;
3050 } else {
3051 globalCellId = this->getTriangleGlobalIdInternal(localCellId);
3052 break;
3053 }
3054 case 3: {
3055 globalCellId = this->getCellGlobalIdInternal(localCellId);
3056 break;
3057 }
3058 default:
3059 globalCellId = -1;
3060 break;
3061 }
3062 } else {
3063 globalCellId = localCellId;
3064 }
3065 return 0;
3066 }
3067
3068 inline bool isOrderArrayGlobal(const void *data) const {
3069#ifndef TTK_ENABLE_KAMIKAZE
3070 if(isOrderArrayGlobal_.find(data) != isOrderArrayGlobal_.end())
3071#endif
3072 return isOrderArrayGlobal_.at(data);
3073#ifndef TTK_ENABLE_KAMIKAZE
3074 else {
3075 printErr("No global array flag has been found for this scalar field");
3076 return false;
3077 }
3078#endif
3079 }
3080
3081 inline void setIsOrderArrayGlobal(const void *data, bool flag) {
3082 isOrderArrayGlobal_[data] = flag;
3083 }
3084
3085 protected:
3086 virtual inline SimplexId
3087 getVertexGlobalIdInternal(const SimplexId ttkNotUsed(lvid)) const {
3088 return -1;
3089 }
3090
3091 virtual inline SimplexId
3092 getVertexLocalIdInternal(const SimplexId ttkNotUsed(gvid)) const {
3093 return -1;
3094 }
3095
3096 // overriden in ImplicitTriangulation &
3097 // PeriodicImplicitTriangulation (where cellGid_ refers to
3098 // squares/cubes and not triangles/tetrahedron)
3099 virtual inline SimplexId
3100 getCellGlobalIdInternal(const SimplexId ttkNotUsed(lcid)) const {
3101 return -1;
3102 }
3103
3104 virtual inline SimplexId
3105 getCellLocalIdInternal(const SimplexId ttkNotUsed(gcid)) const {
3106 return -1;
3107 }
3108
3109 virtual inline SimplexId
3110 getEdgeGlobalIdInternal(const SimplexId ttkNotUsed(leid)) const {
3111 return -1;
3112 }
3113
3114 virtual inline SimplexId
3115 getEdgeLocalIdInternal(const SimplexId ttkNotUsed(geid)) const {
3116 return -1;
3117 }
3118
3119 virtual inline SimplexId
3120 getTriangleGlobalIdInternal(const SimplexId ttkNotUsed(ltid)) const {
3121 return -1;
3122 }
3123
3124 virtual inline SimplexId
3125 getTriangleLocalIdInternal(const SimplexId ttkNotUsed(gtid)) const {
3126 return -1;
3127 }
3128
3129 virtual inline int
3130 getVertexRankInternal(const SimplexId ttkNotUsed(lvid)) const {
3131 return -1;
3132 }
3133
3134 virtual inline int
3135 getEdgeRankInternal(const SimplexId ttkNotUsed(lvid)) const {
3136 return -1;
3137 }
3138
3139 virtual inline int
3140 getTriangleRankInternal(const SimplexId ttkNotUsed(lvid)) const {
3141 return -1;
3142 }
3143
3144 virtual inline int
3145 getCellRankInternal(const SimplexId ttkNotUsed(lcid)) const {
3146 return -1;
3147 }
3148
3149 // these protected methods should not be exposed since they are
3150 // called by their non-MPI-aware conterparts
3151 virtual inline bool
3152 isVertexOnGlobalBoundaryInternal(const SimplexId ttkNotUsed(lvid)) const {
3153 return false;
3154 }
3155 virtual inline bool
3156 isEdgeOnGlobalBoundaryInternal(const SimplexId ttkNotUsed(leid)) const {
3157 return false;
3158 }
3159 virtual inline bool isTriangleOnGlobalBoundaryInternal(
3160 const SimplexId ttkNotUsed(ltid)) const {
3161 return false;
3162 }
3163
3164#endif // TTK_ENABLE_MPI
3165
3166 protected:
3167 virtual int getCellEdgeInternal(const SimplexId &ttkNotUsed(cellId),
3168 const int &ttkNotUsed(localEdgeId),
3169 SimplexId &ttkNotUsed(edgeId)) const {
3170 return 0;
3171 }
3172
3173 virtual inline SimplexId
3175 return 0;
3176 }
3177
3178 virtual inline const std::vector<std::vector<SimplexId>> *
3180 return nullptr;
3181 }
3182
3183 virtual inline int
3185 const int &ttkNotUsed(localNeighborId),
3186 SimplexId &ttkNotUsed(neighborId)) const {
3187 return 0;
3188 }
3189
3190 virtual inline SimplexId
3192 return 0;
3193 }
3194
3195 virtual inline const std::vector<std::vector<SimplexId>> *
3197 return nullptr;
3198 }
3199
3200 virtual inline int
3202 const int &ttkNotUsed(localTriangleId),
3203 SimplexId &ttkNotUsed(triangleId)) const {
3204 return 0;
3205 }
3206
3207 virtual inline SimplexId
3209 return 0;
3210 }
3211
3212 virtual inline const std::vector<std::vector<SimplexId>> *
3214 return nullptr;
3215 }
3216
3217 virtual inline int
3219 const int &ttkNotUsed(localVertexId),
3220 SimplexId &ttkNotUsed(vertexId)) const {
3221 return 0;
3222 }
3223
3224 virtual inline SimplexId
3226 return 0;
3227 }
3228
3229 virtual inline int getDimensionalityInternal() const {
3230 return 0;
3231 }
3232
3233 virtual inline const std::vector<std::array<SimplexId, 2>> *
3235 return nullptr;
3236 }
3237
3238 virtual inline int
3240 const int &ttkNotUsed(localLinkId),
3241 SimplexId &ttkNotUsed(linkId)) const {
3242 return 0;
3243 }
3244
3245 virtual inline SimplexId
3247 return 0;
3248 }
3249
3250 virtual inline const std::vector<std::vector<SimplexId>> *
3252 return nullptr;
3253 }
3254
3255 virtual inline int
3257 const int &ttkNotUsed(localStarId),
3258 SimplexId &ttkNotUsed(starId)) const {
3259 return 0;
3260 }
3261
3262 virtual inline SimplexId
3264 return 0;
3265 }
3266
3267 virtual inline const std::vector<std::vector<SimplexId>> *
3269 return nullptr;
3270 }
3271
3272 virtual inline int
3274 const int &ttkNotUsed(localTriangleId),
3275 SimplexId &ttkNotUsed(triangleId)) const {
3276 return 0;
3277 }
3278
3279 virtual inline SimplexId
3281 return 0;
3282 }
3283
3284 virtual inline const std::vector<std::vector<SimplexId>> *
3286 return nullptr;
3287 }
3288
3289 virtual inline int
3291 const int &ttkNotUsed(localVertexId),
3292 SimplexId &ttkNotUsed(vertexId)) const {
3293 return 0;
3294 }
3295
3296 virtual inline SimplexId getNumberOfCellsInternal() const {
3297 return 0;
3298 }
3299
3300 virtual inline SimplexId getNumberOfEdgesInternal() const {
3301 return 0;
3302 }
3303
3305 return 0;
3306 }
3307
3309 return 0;
3310 }
3311
3312 virtual inline const std::vector<std::array<SimplexId, 3>> *
3314 return nullptr;
3315 }
3316
3317 virtual inline int
3319 const int &ttkNotUsed(localEdgeId),
3320 SimplexId &ttkNotUsed(edgeId)) const {
3321 return 0;
3322 }
3323
3325 const SimplexId &ttkNotUsed(triangleId)) const {
3326 return 0;
3327 }
3328
3329 virtual inline const std::vector<std::vector<SimplexId>> *
3331 return nullptr;
3332 }
3333
3334 virtual inline int
3336 const int &ttkNotUsed(localLinkId),
3337 SimplexId &ttkNotUsed(linkId)) const {
3338 return 0;
3339 }
3340
3342 const SimplexId &ttkNotUsed(triangleId)) const {
3343 return 0;
3344 }
3345
3346 virtual inline const std::vector<std::vector<SimplexId>> *
3348 return nullptr;
3349 }
3350
3351 virtual inline int
3353 const int &ttkNotUsed(localStarId),
3354 SimplexId &ttkNotUsed(starId)) const {
3355 return 0;
3356 }
3357
3359 const SimplexId &ttkNotUsed(triangleId)) const {
3360 return 0;
3361 }
3362
3363 virtual inline const std::vector<std::vector<SimplexId>> *
3365 return nullptr;
3366 }
3367
3368 virtual inline int
3370 const int &ttkNotUsed(localVertexId),
3371 SimplexId &ttkNotUsed(vertexId)) const {
3372 return 0;
3373 }
3374
3375 virtual inline int
3377 const int &ttkNotUsed(localEdgeId),
3378 SimplexId &ttkNotUsed(edgeId)) const {
3379 return 0;
3380 }
3381
3382 virtual inline SimplexId
3384 return 0;
3385 }
3386
3387 virtual inline const std::vector<std::vector<SimplexId>> *
3389 return nullptr;
3390 }
3391
3392 virtual inline int
3394 const int &ttkNotUsed(localLinkId),
3395 SimplexId &ttkNotUsed(linkId)) const {
3396 return 0;
3397 }
3398
3399 virtual inline SimplexId
3401 return 0;
3402 }
3403
3404 virtual inline const std::vector<std::vector<SimplexId>> *
3406 return nullptr;
3407 }
3408
3409 virtual inline int
3411 const int &ttkNotUsed(localNeighborId),
3412 SimplexId &ttkNotUsed(neighborId)) const {
3413 return 0;
3414 }
3415
3417 const SimplexId &ttkNotUsed(vertexId)) const {
3418 return 0;
3419 }
3420
3421 virtual inline const std::vector<std::vector<SimplexId>> *
3423 return nullptr;
3424 }
3425
3426 virtual inline int
3428 float &ttkNotUsed(x),
3429 float &ttkNotUsed(y),
3430 float &ttkNotUsed(z)) const {
3431 return 0;
3432 }
3433
3434 virtual inline int
3436 const int &ttkNotUsed(localStarId),
3437 SimplexId &ttkNotUsed(starId)) const {
3438 return 0;
3439 }
3440
3441 virtual inline SimplexId
3443 return 0;
3444 }
3445
3446 virtual inline const std::vector<std::vector<SimplexId>> *
3448 return nullptr;
3449 }
3450
3451 virtual inline int
3453 const int &ttkNotUsed(localTriangleId),
3454 SimplexId &ttkNotUsed(triangleId)) const {
3455 return 0;
3456 }
3457
3459 const SimplexId &ttkNotUsed(vertexId)) const {
3460 return 0;
3461 }
3462
3463 virtual inline const std::vector<std::vector<SimplexId>> *
3465 return nullptr;
3466 }
3467
3468 virtual inline bool
3470 return false;
3471 }
3472
3473 virtual inline bool isTriangleOnBoundaryInternal(
3474 const SimplexId &ttkNotUsed(triangleId)) const {
3475 return false;
3476 }
3477
3478 virtual inline bool
3480 return false;
3481 }
3482
3484
3485#ifndef TTK_ENABLE_KAMIKAZE
3487
3488 printMsg("BoundaryEdge query without pre-process!",
3490 printMsg("Please call preconditionBoundaryEdges() in a pre-process.",
3492 }
3493#endif
3494
3496 }
3497
3499#ifndef TTK_ENABLE_KAMIKAZE
3501
3502 printMsg("BoundaryTriangle query without pre-process!",
3504 printMsg(
3505 "Please call preconditionBoundaryTriangles() in a pre-process.",
3507 }
3508#endif
3510 }
3511
3513#ifndef TTK_ENABLE_KAMIKAZE
3515
3516 printMsg("BoundaryVertex query without pre-process!",
3518 printMsg("Please call preconditionBoundaryVertices() in a pre-process.",
3520 }
3521#endif
3523 }
3524
3525 inline bool hasPreconditionedCellEdges() const {
3526
3527#ifndef TTK_ENABLE_KAMIKAZE
3530
3531 printMsg("CellEdge query without pre-process!", debug::Priority::ERROR,
3532 debug::LineMode::NEW, std::cerr);
3533 printMsg("Please call preconditionCellEdges() in a pre-process.",
3535 return false;
3536 }
3537#endif
3538 return true;
3539 }
3540
3542#ifndef TTK_ENABLE_KAMIKAZE
3544
3545 printMsg("CellNeighbor query without pre-process!",
3547 printMsg("Please call preconditionCellNeighbors() in a pre-process.",
3549 }
3550#endif
3552 }
3553
3555#ifndef TTK_ENABLE_KAMIKAZE
3557 || ((getDimensionality() == 3)
3559
3560 printMsg("CellTriangle query without pre-process!",
3562 printMsg("Please call preconditionCellTriangles() in a pre-process.",
3564
3565 return false;
3566 }
3567#endif
3568 return true;
3569 }
3570
3571 inline bool hasPreconditionedEdgeLinks() const {
3572#ifndef TTK_ENABLE_KAMIKAZE
3574
3575 printMsg("EdgeLink query without pre-process!", debug::Priority::ERROR,
3576 debug::LineMode::NEW, std::cerr);
3577 printMsg("Please call preconditionEdgeLinks() in a pre-process.",
3579 }
3580#endif
3582 }
3583
3584 inline bool hasPreconditionedEdgeStars() const {
3585#ifndef TTK_ENABLE_KAMIKAZE
3587
3588 printMsg("EdgeStar query without pre-process!", debug::Priority::ERROR,
3589 debug::LineMode::NEW, std::cerr);
3590 printMsg("Please call preconditionEdgeStars() in a pre-process.",
3592 }
3593#endif
3595 }
3596
3598#ifndef TTK_ENABLE_KAMIKAZE
3600 || ((getDimensionality() == 3)
3602
3603 printMsg("EdgeTriangle query without pre-process!",
3605 printMsg("Please call preconditionEdgeTriangles() in a pre-process.",
3607
3608 return false;
3609 }
3610#endif
3611 return true;
3612 }
3613
3614 inline bool hasPreconditionedEdges() const {
3615#ifndef TTK_ENABLE_KAMIKAZE
3616 if((getDimensionality() != 1) && (!hasPreconditionedEdges_)) {
3617
3618 printMsg("Edge query without pre-process!", debug::Priority::ERROR,
3619 debug::LineMode::NEW, std::cerr);
3620 printMsg("Please call preconditionEdges() in a pre-process.",
3622
3623 return false;
3624 }
3625#endif
3626 return true;
3627 }
3628
3629 inline bool hasPreconditionedTriangles() const {
3630#ifndef TTK_ENABLE_KAMIKAZE
3632
3633 printMsg("Triangle query without pre-process!", debug::Priority::ERROR,
3634 debug::LineMode::NEW, std::cerr);
3635 printMsg("Please call preconditionTriangles() in a pre-process.",
3637
3638 return false;
3639 }
3640#endif
3641 return true;
3642 }
3643
3645#ifndef TTK_ENABLE_KAMIKAZE
3647 || ((getDimensionality() == 3)
3649
3650 printMsg("TriangleEdge query without pre-process!",
3652 printMsg("Please call preconditionTriangleEdges() in a pre-process.",
3654
3655 return false;
3656 }
3657#endif
3658 return true;
3659 }
3660
3662#ifndef TTK_ENABLE_KAMIKAZE
3664
3665 printMsg("TriangleLink query without pre-process!",
3667 printMsg("Please call preconditionTriangleLinks() in a pre-process.",
3669 }
3670#endif
3672 }
3673
3675#ifndef TTK_ENABLE_KAMIKAZE
3677
3678 printMsg("TriangleStar query without pre-process!",
3680 printMsg("Please call preconditionTriangleStars() in a pre-process.",
3682 }
3683#endif
3685 }
3686
3687 inline bool hasPreconditionedVertexEdges() const {
3688#ifndef TTK_ENABLE_KAMIKAZE
3691
3692 printMsg("VertexEdge query without pre-process!",
3694 printMsg("Please call preconditionVertexEdges() in a pre-process.",
3696
3697 return false;
3698 }
3699#endif
3700 return true;
3701 }
3702
3703 inline bool hasPreconditionedVertexLinks() const {
3704#ifndef TTK_ENABLE_KAMIKAZE
3706
3707 printMsg("VertexLink query without pre-process!",
3709 printMsg("Please call preconditionVertexLinks() in a pre-process.",
3711 }
3712#endif
3714 }
3715
3717#ifndef TTK_ENABLE_KAMIKAZE
3719
3720 printMsg("VertexNeighbor query without pre-process!",
3722 printMsg("Please call preconditionVertexNeighbors() in a pre-process.",
3724 }
3725#endif
3727 }
3728
3729 inline bool hasPreconditionedVertexStars() const {
3730#ifndef TTK_ENABLE_KAMIKAZE
3732
3733 printMsg("VertexStar query without pre-process!",
3735 printMsg("Please call preconditionVertexStars() in a pre-process.",
3737 }
3738#endif
3740 }
3741
3743#ifndef TTK_ENABLE_KAMIKAZE
3745 || ((getDimensionality() == 3)
3747
3748 printMsg("VertexTriangle query without pre-process!",
3750 printMsg("Please call preconditionVertexTriangles() in a pre-process.",
3752
3753 return false;
3754 }
3755#endif
3756 return true;
3757 }
3758
3759 inline bool hasPreconditionedManifold() const {
3760#ifndef TTK_ENABLE_KAMIKAZE
3761 if(!this->hasPreconditionedManifold_) {
3762 this->printMsg("isManifold query without pre-process!",
3764 this->printMsg("Please call preconditionManifold() in a pre-process.",
3766 }
3767#endif // TTK_ENABLE_KAMIKAZE
3768 return this->hasPreconditionedManifold_;
3769 }
3770
3771 // empty wrapping to VTK for now
3772 bool needsToAbort() override {
3773 return false;
3774 }
3775
3777 return 0;
3778 }
3779
3781 return 0;
3782 }
3783
3785 return 0;
3786 }
3787
3788 virtual inline int preconditionCellEdgesInternal() {
3789 return 0;
3790 }
3791
3793 return 0;
3794 }
3795
3797 return 0;
3798 }
3799
3800 virtual inline int preconditionEdgesInternal() {
3801 return 0;
3802 }
3803
3804 virtual inline int preconditionEdgeLinksInternal() {
3805 return 0;
3806 }
3807
3808 virtual inline int preconditionEdgeStarsInternal() {
3809 return 0;
3810 }
3811
3813 return 0;
3814 }
3815
3816 virtual inline int preconditionTrianglesInternal() {
3817 return 0;
3818 }
3819
3821 return 0;
3822 }
3823
3825 return 0;
3826 }
3827
3829 return 0;
3830 }
3831
3832 virtual inline int preconditionVertexEdgesInternal() {
3833 return 0;
3834 }
3835
3836 virtual inline int preconditionVertexLinksInternal() {
3837 return 0;
3838 }
3839
3841 return 0;
3842 }
3843
3844 virtual inline int preconditionVertexStarsInternal() {
3845 return 0;
3846 }
3847
3849 return 0;
3850 }
3851
3852 virtual inline int preconditionManifoldInternal() {
3853 return 0;
3854 }
3855
3856 virtual inline int getCellVTKIDInternal(const int &ttkId,
3857 int &vtkId) const {
3858#ifndef TTK_ENABLE_KAMIKAZE
3859 if(ttkId < 0) {
3860 return -1;
3861 }
3862#endif
3863 vtkId = ttkId;
3864 return 0;
3865 }
3866
3867 template <class itemType>
3868 size_t tableFootprint(const std::vector<itemType> &table,
3869 const std::string &tableName = "",
3870 std::ostream &stream = std::cout) const {
3871
3872 std::stringstream msg;
3873 if((table.size()) && (tableName.length())) {
3874 msg << tableName << ": " << table.size() * sizeof(itemType) << " bytes";
3875 printMsg(
3876 msg.str(), debug::Priority::INFO, debug::LineMode::NEW, stream);
3877 }
3878
3879 return table.size() * sizeof(itemType);
3880 }
3881
3882 template <class itemType>
3883 size_t tableTableFootprint(const std::vector<std::vector<itemType>> &table,
3884 const std::string &tableName = "",
3885 std::ostream &stream = std::cout) const;
3886
3887 int updateProgress(const float &ttkNotUsed(progress)) override {
3888 return 0;
3889 }
3890
3902
3903 bool isManifold_{true};
3904
3905 std::array<SimplexId, 3> gridDimensions_;
3906
3908 std::vector<std::array<SimplexId, 6>> tetraEdgeList_;
3909 std::vector<std::vector<SimplexId>> cellNeighborList_;
3910 std::vector<std::array<SimplexId, 4>> tetraTriangleList_;
3911 std::vector<std::vector<SimplexId>> edgeLinkList_;
3912 std::vector<std::array<SimplexId, 2>> edgeList_;
3913 std::vector<std::vector<SimplexId>> edgeStarList_;
3914 std::vector<std::vector<SimplexId>> edgeTriangleList_;
3915 std::vector<std::array<SimplexId, 3>> triangleList_;
3916 std::vector<std::array<SimplexId, 3>> triangleEdgeList_;
3917 std::vector<std::vector<SimplexId>> triangleLinkList_;
3918 std::vector<std::vector<SimplexId>> triangleStarList_;
3919 std::vector<std::vector<SimplexId>> vertexEdgeList_;
3920 std::vector<std::vector<SimplexId>> vertexLinkList_;
3921 std::vector<std::vector<SimplexId>> vertexNeighborList_;
3922 std::vector<std::vector<SimplexId>> vertexStarList_;
3923 std::vector<std::vector<SimplexId>> vertexTriangleList_;
3924
3925 // keep compatibility between getCellEdges(), getCellTriangles(),
3926 // getCellNeighbors() and getTriangleEdges()
3927 std::vector<std::vector<SimplexId>> cellEdgeVector_{};
3928 std::vector<std::vector<SimplexId>> cellTriangleVector_{};
3929 std::vector<std::vector<SimplexId>> triangleEdgeVector_{};
3930
3931#ifdef TTK_ENABLE_MPI
3932
3933 // precondition methods for distributed meshes
3934
3935 virtual int preconditionDistributedEdges() {
3936 return 0;
3937 }
3938 virtual int preconditionDistributedTriangles() {
3939 return 0;
3940 }
3941
3942 // "vtkGhostType" PointData array
3943 const unsigned char *vertexGhost_{};
3944 // "vtkGhostType" CellData array
3945 const unsigned char *cellGhost_{};
3946
3947 // list of neighboring ranks (sharing ghost cells to current rank)
3948 std::vector<int> neighborRanks_{};
3949 // list of ids in the neighborRanks_ vector of neighboring ranks
3950 std::map<int, int> neighborsToId_{};
3951 // global ids of (local) ghost cells per each MPI (neighboring) rank
3952 std::vector<std::vector<SimplexId>> ghostCellsPerOwner_{};
3953 // global ids of local (owned) cells that are ghost cells of other
3954 // (neighboring) ranks (per MPI rank)
3955 std::vector<std::vector<SimplexId>> remoteGhostCells_{};
3956 // global ids of (local) ghost vertices per each MPI (neighboring) rank
3957 std::vector<std::vector<SimplexId>> ghostVerticesPerOwner_{};
3958 // global ids of local (owned) vertices that are ghost cells of other
3959 // (neighboring) ranks (per MPI rank)
3960 std::vector<std::vector<SimplexId>> remoteGhostVertices_{};
3961 // hold the neighboring ranks vertex bounding boxes (metaGrid_ coordinates)
3962 std::vector<std::array<SimplexId, 6>> neighborVertexBBoxes_{};
3963 // hold the neighboring ranks cells bounding boxes (metaGrid_ coordinates)
3964 std::vector<std::array<double, 6>> neighborCellBBoxes_{};
3965 std::array<double, 6> boundingBox_{};
3966
3967 bool hasPreconditionedDistributedCells_{false};
3968 bool hasPreconditionedExchangeGhostCells_{false};
3969 bool hasPreconditionedDistributedEdges_{false};
3970 bool hasPreconditionedDistributedTriangles_{false};
3971 bool hasPreconditionedDistributedVertices_{false};
3972 bool hasPreconditionedExchangeGhostVertices_{false};
3973 bool hasPreconditionedGlobalBoundary_{false};
3974 std::map<const void *, bool> isOrderArrayGlobal_;
3975
3976#endif // TTK_ENABLE_MPI
3977
3978 // only ttk::dcg::DiscreteGradient should use what's defined below.
3980
3981#ifdef TTK_ENABLE_DCG_OPTIMIZE_MEMORY
3982 // might no be sufficient for Rips complexes, where a vertex can
3983 // have more than 128 neighbors
3984 using gradIdType = char;
3985#else
3987#endif
3988
4002 using gradientType = std::array<std::vector<gradIdType>, 6>;
4011 using gradientKeyType = std::pair<const void *, size_t>;
4012 /*
4013 * @brief Type for caching Discrete Gradient internal data structure.
4014 *
4015 * Uses the ttk::LRUCache with \ref gradientKeytype as key and
4016 * \ref gradientType as value types.
4017 */
4019 /*
4020 * @brief Access to the gradientCache_ mutable member variable
4021 *
4022 * \warning This should only be used by the
4023 * ttk::dcg::DiscreteGradient class.
4024 */
4026 return &this->gradientCache_;
4027 }
4028
4029 // store, for each triangulation object and per offset field, a
4030 // reference to the discrete gradient internal structure
4032 };
4033} // namespace ttk
#define ttkNotUsed(x)
Mark function/method parameters that are not used in the function body at all.
Definition BaseClass.h:47
virtual const std::vector< std::vector< SimplexId > > * getCellNeighborsInternal()
virtual const std::vector< std::vector< SimplexId > > * getVertexNeighbors()
virtual int getVertexPoint(const SimplexId &vertexId, float &x, float &y, float &z) const
std::vector< std::vector< SimplexId > > vertexStarList_
virtual SimplexId getVertexEdgeNumberInternal(const SimplexId &ttkNotUsed(vertexId)) const
std::pair< const void *, size_t > gradientKeyType
Key type for gradientCacheType.
virtual int getEdgeLink(const SimplexId &edgeId, const int &localLinkId, SimplexId &linkId) const
virtual int getEdgeVertexInternal(const SimplexId &ttkNotUsed(edgeId), const int &ttkNotUsed(localVertexId), SimplexId &ttkNotUsed(vertexId)) const
virtual SimplexId getVertexTriangleNumber(const SimplexId &vertexId) const
virtual const std::vector< std::vector< SimplexId > > * getCellNeighbors()
virtual int getVertexTriangle(const SimplexId &vertexId, const int &localTriangleId, SimplexId &triangleId) const
virtual const std::vector< std::vector< SimplexId > > * getCellEdgesInternal()
virtual int getVertexEdge(const SimplexId &vertexId, const int &localEdgeId, SimplexId &edgeId) const
int getCellIncenter(const SimplexId cellid, const int dim, float incenter[3]) const
LRUCache< gradientKeyType, gradientType > gradientCacheType
virtual SimplexId getEdgeTriangleNumber(const SimplexId &edgeId) const
virtual const std::array< SimplexId, 3 > & getGridDimensions() const
virtual bool isTriangleOnBoundary(const SimplexId &triangleId) const
virtual SimplexId getVertexTriangleNumberInternal(const SimplexId &ttkNotUsed(vertexId)) const
virtual const std::vector< std::vector< SimplexId > > * getVertexStars()
int getEdgeVertexNumber(const SimplexId ttkNotUsed(edgeId)) const
virtual const std::vector< std::vector< SimplexId > > * getEdgeStars()
virtual int getTriangleLinkInternal(const SimplexId &ttkNotUsed(triangleId), const int &ttkNotUsed(localLinkId), SimplexId &ttkNotUsed(linkId)) const
virtual SimplexId getNumberOfEdgesInternal() const
virtual const std::vector< std::vector< SimplexId > > * getVertexLinks()
virtual const std::vector< std::array< SimplexId, 2 > > * getEdgesInternal()
virtual const std::vector< std::vector< SimplexId > > * getVertexTriangles()
virtual int getTriangleStar(const SimplexId &triangleId, const int &localStarId, SimplexId &starId) const
virtual SimplexId getVertexNeighborNumber(const SimplexId &vertexId) const
bool hasPeriodicBoundaries() const
Returns true if the grid uses period boundary conditions.
virtual int getEdgeTriangle(const SimplexId &edgeId, const int &localTriangleId, SimplexId &triangleId) const
virtual const std::vector< std::vector< SimplexId > > * getTriangleEdgesInternal()
std::vector< std::array< SimplexId, 3 > > triangleList_
virtual int getCellEdgeInternal(const SimplexId &ttkNotUsed(cellId), const int &ttkNotUsed(localEdgeId), SimplexId &ttkNotUsed(edgeId)) const
virtual int getEdgeVertex(const SimplexId &edgeId, const int &localVertexId, SimplexId &vertexId) const
virtual const std::vector< std::vector< SimplexId > > * getVertexStarsInternal()
virtual int getEdgeLinkInternal(const SimplexId &ttkNotUsed(edgeId), const int &ttkNotUsed(localLinkId), SimplexId &ttkNotUsed(linkId)) const
AbstractTriangulation & operator=(AbstractTriangulation &&)=default
virtual SimplexId getNumberOfVerticesInternal() const
virtual const std::vector< std::array< SimplexId, 2 > > * getEdges()
virtual bool isVertexOnBoundaryInternal(const SimplexId &ttkNotUsed(vertexId)) const
virtual int getTriangleEdge(const SimplexId &triangleId, const int &localEdgeId, SimplexId &edgeId) const
virtual SimplexId getTriangleLinkNumberInternal(const SimplexId &ttkNotUsed(triangleId)) const
virtual SimplexId getNumberOfCellsInternal() const
std::vector< std::array< SimplexId, 4 > > tetraTriangleList_
int updateProgress(const float &ttkNotUsed(progress)) override
virtual SimplexId getTriangleLinkNumber(const SimplexId &triangleId) const
AbstractTriangulation & operator=(const AbstractTriangulation &)=default
std::vector< std::vector< SimplexId > > triangleLinkList_
virtual int getTriangleStarInternal(const SimplexId &ttkNotUsed(triangleId), const int &ttkNotUsed(localStarId), SimplexId &ttkNotUsed(starId)) const
virtual bool isVertexOnBoundary(const SimplexId &vertexId) const
virtual const std::vector< std::vector< SimplexId > > * getVertexEdgesInternal()
virtual const std::vector< std::vector< SimplexId > > * getTriangleLinks()
virtual SimplexId getCellEdgeNumber(const SimplexId &cellId) const
std::vector< std::vector< SimplexId > > vertexNeighborList_
std::vector< std::vector< SimplexId > > vertexLinkList_
virtual int getVertexTriangleInternal(const SimplexId &ttkNotUsed(vertexId), const int &ttkNotUsed(localTriangleId), SimplexId &ttkNotUsed(triangleId)) const
gradientCacheType * getGradientCacheHandler() const
virtual SimplexId getEdgeStarNumberInternal(const SimplexId &ttkNotUsed(edgeId)) const
virtual const std::vector< std::vector< SimplexId > > * getEdgeTrianglesInternal()
virtual bool isEdgeOnBoundary(const SimplexId &edgeId) const
virtual int getVertexNeighborInternal(const SimplexId &ttkNotUsed(vertexId), const int &ttkNotUsed(localNeighborId), SimplexId &ttkNotUsed(neighborId)) const
virtual int getCellNeighborInternal(const SimplexId &ttkNotUsed(cellId), const int &ttkNotUsed(localNeighborId), SimplexId &ttkNotUsed(neighborId)) const
AbstractTriangulation(const AbstractTriangulation &)=default
virtual const std::vector< std::vector< SimplexId > > * getEdgeTriangles()
virtual SimplexId getCellVertexNumberInternal(const SimplexId &ttkNotUsed(cellId)) const
virtual int getCellVTKIDInternal(const int &ttkId, int &vtkId) const
virtual const std::vector< std::array< SimplexId, 3 > > * getTriangles()
virtual int getTriangleLink(const SimplexId &triangleId, const int &localLinkId, SimplexId &linkId) const
virtual const std::vector< std::array< SimplexId, 3 > > * getTrianglesInternal()
virtual SimplexId getEdgeLinkNumberInternal(const SimplexId &ttkNotUsed(edgeId)) const
virtual int getVertexPointInternal(const SimplexId &ttkNotUsed(vertexId), float &ttkNotUsed(x), float &ttkNotUsed(y), float &ttkNotUsed(z)) const
virtual const std::vector< std::vector< SimplexId > > * getEdgeLinks()
virtual int getTriangleVertexInternal(const SimplexId &ttkNotUsed(triangleId), const int &ttkNotUsed(localVertexId), SimplexId &ttkNotUsed(vertexId)) const
std::vector< std::vector< SimplexId > > edgeLinkList_
virtual int getVertexLinkInternal(const SimplexId &ttkNotUsed(vertexId), const int &ttkNotUsed(localLinkId), SimplexId &ttkNotUsed(linkId)) const
std::vector< std::vector< SimplexId > > vertexEdgeList_
std::vector< std::vector< SimplexId > > triangleEdgeVector_
std::vector< std::vector< SimplexId > > triangleStarList_
virtual SimplexId getNumberOfCells() const
virtual SimplexId getCellTriangleNumber(const SimplexId &cellId) const
virtual SimplexId getNumberOfVertices() const
virtual SimplexId getVertexNeighborNumberInternal(const SimplexId &ttkNotUsed(vertexId)) const
virtual SimplexId getNumberOfTrianglesInternal() const
virtual int getEdgeStarInternal(const SimplexId &ttkNotUsed(edgeId), const int &ttkNotUsed(localStarId), SimplexId &ttkNotUsed(starId)) const
virtual SimplexId getCellNeighborNumber(const SimplexId &cellId) const
virtual int getDimensionality() const
virtual int getCellEdge(const SimplexId &cellId, const int &localEdgeId, SimplexId &edgeId) const
virtual int getEdgeStar(const SimplexId &edgeId, const int &localStarId, SimplexId &starId) const
virtual int getVertexNeighbor(const SimplexId &vertexId, const int &localNeighborId, SimplexId &neighborId) const
virtual SimplexId getCellEdgeNumberInternal(const SimplexId &ttkNotUsed(cellId)) const
std::vector< std::vector< SimplexId > > cellNeighborList_
virtual SimplexId getEdgeLinkNumber(const SimplexId &edgeId) const
virtual const std::vector< std::vector< SimplexId > > * getVertexEdges()
virtual const std::vector< std::vector< SimplexId > > * getCellTrianglesInternal()
virtual bool isTriangleOnBoundaryInternal(const SimplexId &ttkNotUsed(triangleId)) const
virtual int getCellTriangleInternal(const SimplexId &ttkNotUsed(cellId), const int &ttkNotUsed(localTriangleId), SimplexId &ttkNotUsed(triangleId)) const
virtual int getVertexStar(const SimplexId &vertexId, const int &localStarId, SimplexId &starId) const
virtual SimplexId getTriangleStarNumber(const SimplexId &triangleId) const
std::vector< std::array< SimplexId, 2 > > edgeList_
virtual int getCellVertex(const SimplexId &cellId, const int &localVertexId, SimplexId &vertexId) const
virtual SimplexId getCellVertexNumber(const SimplexId &cellId) const
int getTriangleIncenter(const SimplexId triangleId, float incenter[3]) const
virtual const std::vector< std::vector< SimplexId > > * getTriangleStars()
virtual const std::vector< std::vector< SimplexId > > * getTriangleLinksInternal()
virtual SimplexId getVertexLinkNumberInternal(const SimplexId &ttkNotUsed(vertexId)) const
std::vector< std::array< SimplexId, 6 > > tetraEdgeList_
std::array< SimplexId, 3 > gridDimensions_
virtual SimplexId getVertexStarNumberInternal(const SimplexId &ttkNotUsed(vertexId)) const
std::vector< std::vector< SimplexId > > edgeStarList_
virtual const std::vector< std::vector< SimplexId > > * getVertexTrianglesInternal()
virtual SimplexId getNumberOfTriangles() const
size_t tableFootprint(const std::vector< itemType > &table, const std::string &tableName="", std::ostream &stream=std::cout) const
virtual int getTriangleVertex(const SimplexId &triangleId, const int &localVertexId, SimplexId &vertexId) const
virtual int getTriangleEdgeInternal(const SimplexId &ttkNotUsed(triangleId), const int &ttkNotUsed(localEdgeId), SimplexId &ttkNotUsed(edgeId)) const
virtual SimplexId getVertexStarNumber(const SimplexId &vertexId) const
virtual int getCellVTKID(const int &ttkId, int &vtkId) const
virtual SimplexId getCellTriangleNumberInternal(const SimplexId &ttkNotUsed(cellId)) const
virtual SimplexId getCellNeighborNumberInternal(const SimplexId &ttkNotUsed(cellId)) const
virtual SimplexId getEdgeTriangleNumberInternal(const SimplexId &ttkNotUsed(edgeId)) const
virtual int preconditionBoundaryTrianglesInternal()
virtual bool isEdgeOnBoundaryInternal(const SimplexId &ttkNotUsed(edgeId)) const
int getTriangleVertexNumber(const SimplexId ttkNotUsed(triangleId)) const
virtual int getEdgeTriangleInternal(const SimplexId &ttkNotUsed(edgeId), const int &ttkNotUsed(localTriangleId), SimplexId &ttkNotUsed(triangleId)) const
int getEdgeIncenter(const SimplexId edgeId, float incenter[3]) const
virtual int getCellTriangle(const SimplexId &cellId, const int &localTriangleId, SimplexId &triangleId) const
virtual const std::vector< std::vector< SimplexId > > * getTriangleEdges()
virtual const std::vector< std::vector< SimplexId > > * getEdgeStarsInternal()
virtual int getVertexEdgeInternal(const SimplexId &ttkNotUsed(vertexId), const int &ttkNotUsed(localEdgeId), SimplexId &ttkNotUsed(edgeId)) const
virtual SimplexId getVertexLinkNumber(const SimplexId &vertexId) const
virtual const std::vector< std::vector< SimplexId > > * getVertexLinksInternal()
virtual SimplexId getVertexEdgeNumber(const SimplexId &vertexId) const
virtual SimplexId getTriangleEdgeNumberInternal(const SimplexId &ttkNotUsed(triangleId)) const
std::array< std::vector< gradIdType >, 6 > gradientType
Discrete gradient internal struct.
std::vector< std::vector< SimplexId > > vertexTriangleList_
virtual SimplexId getNumberOfEdges() const
std::vector< std::vector< SimplexId > > cellEdgeVector_
size_t footprint(size_t size=0) const
std::vector< std::vector< SimplexId > > cellTriangleVector_
size_t tableTableFootprint(const std::vector< std::vector< itemType > > &table, const std::string &tableName="", std::ostream &stream=std::cout) const
virtual const std::vector< std::vector< SimplexId > > * getCellTriangles()
int getTetraIncenter(const SimplexId tetraId, float incenter[3]) const
virtual const std::vector< std::vector< SimplexId > > * getTriangleStarsInternal()
virtual SimplexId getTriangleEdgeNumber(const SimplexId &triangleId) const
virtual int getCellNeighbor(const SimplexId &cellId, const int &localNeighborId, SimplexId &neighborId) const
virtual const std::vector< std::vector< SimplexId > > * getVertexNeighborsInternal()
virtual int getVertexLink(const SimplexId &vertexId, const int &localLinkId, SimplexId &linkId) const
std::vector< std::array< SimplexId, 3 > > triangleEdgeList_
virtual int getVertexStarInternal(const SimplexId &ttkNotUsed(vertexId), const int &ttkNotUsed(localStarId), SimplexId &ttkNotUsed(starId)) const
virtual SimplexId getEdgeStarNumber(const SimplexId &edgeId) const
virtual int getCellVertexInternal(const SimplexId &ttkNotUsed(cellId), const int &ttkNotUsed(localVertexId), SimplexId &ttkNotUsed(vertexId)) const
std::vector< std::vector< SimplexId > > edgeTriangleList_
virtual const std::vector< std::vector< SimplexId > > * getEdgeLinksInternal()
virtual SimplexId getTriangleStarNumberInternal(const SimplexId &ttkNotUsed(triangleId)) const
virtual const std::vector< std::vector< SimplexId > > * getCellEdges()
AbstractTriangulation(AbstractTriangulation &&)=default
virtual int getDimensionalityInternal() const
int printErr(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
Definition Debug.h:149
LRU cache implementation.
Definition Cache.h:13
TTK discreteGradient processing package.
T distance(const T *p0, const T *p1, const int &dimension=3)
Definition Geometry.cpp:362
TTK base package defining the standard types.
int SimplexId
Identifier type for simplices of any dimension.
Definition DataTypes.h:22
COMMON_EXPORTS int MPIrank_
Definition BaseClass.cpp:9
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/| (_) |"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)