6 : dimensionality_{-1}, cellNumber_{}, vertexNumber_{}, edgeNumber_{},
7 triangleNumber_{}, tetrahedronNumber_{}, isAccelerated_{} {
17 const float &xSpacing,
18 const float &ySpacing,
19 const float &zSpacing,
25 if(xDim < 1 or yDim < 1 or zDim < 1)
27 else if(xDim > 1 and yDim > 1 and zDim > 1)
29 else if((xDim > 1 and yDim > 1) or (yDim > 1 and zDim > 1)
30 or (xDim > 1 and zDim > 1))
32 else if(xDim > 1 or yDim > 1 or zDim > 1)
65 for(
int k = 1; k < 7; ++k)
91 for(
int k = 1; k < 6; ++k)
111 wrap_[1] = xDim * yDim;
112 wrap_[2] = xDim * yDim * zDim;
117 for(
int k = 0; k < 7; ++k)
120 for(
int k = 0; k < 6; ++k)
131 }
else if(yDim == 1) {
146 for(
int k = 1; k < 3; ++k)
161 for(
int k = 0; k < 3; ++k)
169 for(
int k = 0; k < 3; ++k) {
188 unsigned long long int msb[3];
190 bool allDimensionsArePowerOfTwo =
true;
191 for(
int k = 0; k < 3; ++k)
193 allDimensionsArePowerOfTwo =
false;
195 if(allDimensionsArePowerOfTwo) {
199 div_[1] = msb[0] + msb[1];
205 bool allDimensionsArePowerOfTwo = (isDi and isDj);
207 if(allDimensionsArePowerOfTwo) {
222 unsigned long long int &r) {
223 if(v && !(v & (v - 1))) {
232bool PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
234#ifndef TTK_ENABLE_KAMIKAZE
235 if(vertexId < 0 or vertexId >= vertexNumber_)
244bool PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
246#ifndef TTK_ENABLE_KAMIKAZE
247 if(edgeId < 0 or edgeId >= edgeNumber_)
256bool PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
258#ifndef TTK_ENABLE_KAMIKAZE
259 if(triangleId < 0 or triangleId >= triangleNumber_)
268SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
270#ifndef TTK_ENABLE_KAMIKAZE
271 if(vertexId < 0 or vertexId >= vertexNumber_)
277 if(dimensionality_ == 3) {
279 }
else if(dimensionality_ == 2) {
281 }
else if(dimensionality_ == 1) {
288template <
typename Derived>
291 const int &localNeighborId,
293#ifndef TTK_ENABLE_KAMIKAZE
294 if(localNeighborId < 0
300 const auto &p = this->underlying().getVertexCoords(vertexId);
302 if(dimensionality_ == 3) {
303 neighborId = getVertexNeighbor3d(p.data(), vertexId, localNeighborId);
304 }
else if(dimensionality_ == 2) {
305 neighborId = getVertexNeighbor2d(p.data(), vertexId, localNeighborId);
306 }
else if(dimensionality_ == 1) {
308 if(vertexId > 0 and vertexId < nbvoxels_[Di_]) {
309 if(localNeighborId == 0)
310 neighborId = vertexId + 1;
312 neighborId = vertexId - 1;
313 }
else if(vertexId == 0) {
314 if(localNeighborId == 0)
315 neighborId = vertexId + 1;
317 neighborId = nbvoxels_[Di_];
319 if(localNeighborId == 0)
322 neighborId = vertexId - 1;
329const vector<vector<SimplexId>> *
330 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
332 if(vertexNeighborList_.empty()) {
334 vertexNeighborList_.resize(vertexNumber_);
335 for(
SimplexId i = 0; i < vertexNumber_; ++i) {
341 printMsg(
"Built " + to_string(vertexNumber_) +
" vertex neighbors.", 1,
345 return &vertexNeighborList_;
353template <
typename Derived>
356#ifndef TTK_ENABLE_KAMIKAZE
357 if(localEdgeId < 0 or localEdgeId >= getVertexEdgeNumberInternal(vertexId))
362 const auto &p = this->underlying().getVertexCoords(vertexId);
364 if(dimensionality_ == 3) {
365 edgeId = getVertexEdge3d(p.data(), localEdgeId);
366 }
else if(dimensionality_ == 2) {
367 edgeId = getVertexEdge2d(p.data(), localEdgeId);
368 }
else if(dimensionality_ == 1) {
369 if(vertexId > 0 and vertexId < nbvoxels_[Di_]) {
371 edgeId = localEdgeId == 0 ? vertexId : vertexId - 1;
372 }
else if(vertexId == 0) {
374 edgeId = localEdgeId == 0 ? vertexId : 0;
377 edgeId = localEdgeId == 0 ? 0 : vertexId - 1;
384const vector<vector<SimplexId>> *
405#ifndef TTK_ENABLE_KAMIKAZE
419template <
typename Derived>
422 const int &localTriangleId,
424#ifndef TTK_ENABLE_KAMIKAZE
425 if(localTriangleId < 0
426 or localTriangleId >= getVertexTriangleNumberInternal(vertexId))
431 const auto &p = this->underlying().getVertexCoords(vertexId);
433 if(dimensionality_ == 3) {
434 triangleId = getVertexTriangle3d(p.data(), localTriangleId);
440const vector<vector<SimplexId>> *
459SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
464template <
typename Derived>
467 const int &localLinkId,
469#ifndef TTK_ENABLE_KAMIKAZE
475 const auto &p = this->underlying().getVertexCoords(vertexId);
477 if(dimensionality_ == 3) {
478 linkId = getVertexLink3d(p.data(), localLinkId);
479 }
else if(dimensionality_ == 2) {
480 linkId = getVertexLink2d(p.data(), localLinkId);
486const vector<vector<SimplexId>> *
488 if(vertexLinkList_.empty()) {
491 vertexLinkList_.resize(vertexNumber_);
492 for(
SimplexId i = 0; i < vertexNumber_; ++i) {
498 printMsg(
"Built " + to_string(vertexNumber_) +
" vertex links.", 1,
502 return &vertexLinkList_;
505SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
507#ifndef TTK_ENABLE_KAMIKAZE
508 if(vertexId < 0 or vertexId >= vertexNumber_)
514 if(dimensionality_ == 3) {
516 }
else if(dimensionality_ == 2) {
523template <
typename Derived>
526 const int &localStarId,
528#ifndef TTK_ENABLE_KAMIKAZE
534 const auto &p = this->underlying().getVertexCoords(vertexId);
536 if(dimensionality_ == 3) {
537 starId = getVertexStar3d(p.data(), localStarId);
538 }
else if(dimensionality_ == 2) {
539 starId = getVertexStar2d(p.data(), localStarId);
545const vector<vector<SimplexId>> *
547 if(vertexStarList_.empty()) {
549 vertexStarList_.resize(vertexNumber_);
550 for(
SimplexId i = 0; i < vertexNumber_; ++i) {
556 printMsg(
"Built " + to_string(vertexNumber_) +
" vertex stars.", 1,
560 return &vertexStarList_;
565void PeriodicImplicitTriangulation::setIsBoundaryPeriodic(
566 std::array<unsigned char, 6> boundary) {
567 this->isBoundaryPeriodic = boundary;
570void PeriodicImplicitTriangulation::createMetaGrid(
const double *
const bounds) {
572 if(!ttk::isRunningWithMPI()) {
577 if(this->metaGrid_ !=
nullptr) {
582 std::array<double, 6> tempBounds = {
583 bounds[0], bounds[2], bounds[4], bounds[1], bounds[3], bounds[5],
586 for(
int i = 0; i < 3; i++) {
588 if(this->isBoundaryPeriodic[2 * i] == 1) {
591 if(this->isBoundaryPeriodic[2 * i + 1] == 1) {
597 std::array<double, 6> tempGlobalBounds{};
599 MPI_Allreduce(tempBounds.data(), tempGlobalBounds.data(), 3, MPI_DOUBLE,
600 MPI_MIN, ttk::MPIcomm_);
602 MPI_Allreduce(&tempBounds[3], &tempGlobalBounds[3], 3, MPI_DOUBLE, MPI_MAX,
606 std::array<double, 6> globalBounds{
607 tempGlobalBounds[0], tempGlobalBounds[3], tempGlobalBounds[1],
608 tempGlobalBounds[4], tempGlobalBounds[2], tempGlobalBounds[5],
611 const std::array<ttk::SimplexId, 3> dimensions = {
613 std::round((globalBounds[1] - globalBounds[0]) / this->
spacing_[0]))
616 std::round((globalBounds[3] - globalBounds[2]) / this->
spacing_[1]))
619 std::round((globalBounds[5] - globalBounds[4]) / this->
spacing_[2]))
623 this->localGridOffset_ = {
632 this->metaGrid_ = std::make_shared<PeriodicNoPreconditions>();
633 this->metaGrid_->setInputGrid(globalBounds[0], globalBounds[1],
636 dimensions[0], dimensions[1], dimensions[2]);
639int PeriodicImplicitTriangulation::preconditionDistributedCells() {
640 if(this->hasPreconditionedDistributedCells_) {
643 if(!ttk::hasInitializedMPI()) {
646 if(this->metaGrid_ ==
nullptr) {
649 if(this->cellGhost_ ==
nullptr) {
650 if(ttk::isRunningWithMPI()) {
651 this->
printErr(
"Missing cell ghost array!");
666 std::vector<unsigned char> fillCells(nLocCells / nTetraPerCube);
672 this->localGridOffset_[0] + this->
dimensions_[0], this->localGridOffset_[0],
673 this->localGridOffset_[1] + this->dimensions_[1], this->localGridOffset_[1],
674 this->localGridOffset_[2] + this->dimensions_[2], this->localGridOffset_[2],
676 const auto &dims{this->metaGrid_->getGridDimensions()};
678 for(
SimplexId lcid = 0; lcid < nLocCells; ++lcid) {
680 if(this->cellGhost_[lcid / nTetraPerCube] != 0) {
684 std::array<SimplexId, 3> p{};
695 p[0] += this->localGridOffset_[0];
696 p[1] += this->localGridOffset_[1];
697 p[2] += this->localGridOffset_[2];
699 if(p[0] < localBBox[0]) {
702 if(p[0] > localBBox[1]) {
703 localBBox[1] = min(p[0], dims[0]);
705 if(p[1] < localBBox[2]) {
708 if(p[1] > localBBox[3]) {
709 localBBox[3] = min(p[1], dims[1]);
711 if(p[2] < localBBox[4]) {
714 if(p[2] > localBBox[5]) {
715 localBBox[5] = min(p[2], dims[2]);
718 localBBox[0] -= isBoundaryPeriodic[0];
720 localBBox[2] -= isBoundaryPeriodic[2];
722 localBBox[4] -= isBoundaryPeriodic[4];
729 for(
size_t i = 0; i < this->neighborRanks_.size(); ++i) {
730 const auto neigh{this->neighborRanks_[i]};
731 MPI_Sendrecv(this->neighborCellBBoxes_[
ttk::MPIrank_].data(), 6,
733 this->neighborCellBBoxes_[neigh].data(), 6,
734 ttk::getMPIType(
SimplexId{}), neigh, neigh, ttk::MPIcomm_,
738 this->hasPreconditionedDistributedCells_ =
true;
743std::array<SimplexId, 3> PeriodicImplicitTriangulation::getVertGlobalCoords(
746 std::array<SimplexId, 3> p{};
753 p[0] += this->localGridOffset_[0];
754 p[1] += this->localGridOffset_[1];
755 p[2] += this->localGridOffset_[2];
757 const auto &dims{this->metaGrid_->getGridDimensions()};
759 p[0] = (p[0] + dims[0]) % dims[0];
761 p[1] = (p[1] + dims[1]) % dims[1];
763 p[2] = (p[2] + dims[2]) % dims[2];
769std::array<SimplexId, 3> PeriodicImplicitTriangulation::getVertLocalCoords(
772 std::array<SimplexId, 3> pGlobal{};
774 this->metaGrid_->vertexToPosition(gvid, pGlobal.data());
776 this->metaGrid_->vertexToPosition2d(gvid, pGlobal.data());
778 std::array<SimplexId, 3> p{pGlobal};
780 p[0] -= this->localGridOffset_[0];
781 p[1] -= this->localGridOffset_[1];
782 p[2] -= this->localGridOffset_[2];
786 if(p[0] >= 0 && p[1] >= 0 && p[2] >= 0 && p[0] <= dims[0] - 1
787 && p[1] <= dims[1] - 1 && p[2] <= dims[2] - 1) {
790 for(
int i = 0; i < 3; i++) {
791 if((p[i] < 0 || p[i] > dims[i] - 1) && pGlobal[i] == 0) {
794 if((p[i] < 0 || p[i] > dims[i] - 1)
795 && pGlobal[i] == this->metaGrid_->dimensions_[i] - 1) {
800 if(p[0] >= 0 && p[1] >= 0 && p[2] >= 0 && p[0] <= dims[0] - 1
801 && p[1] <= dims[1] - 1 && p[2] <= dims[2] - 1) {
802 if(this->vertexGhost_[p[0] + p[1] * dims[0] + p[2] * dims[0] * dims[1]]
807 return std::array<SimplexId, 3>{-1, -1, -1};
810int ttk::PeriodicImplicitTriangulation::getCellRankInternal(
813 const int nTetraPerCube{this->dimensionality_ == 3 ? 6 : 2};
814 const auto locCubeId{lcid / nTetraPerCube};
816 if(this->cellGhost_[locCubeId] == 0) {
820#ifndef TTK_ENABLE_KAMIKAZE
821 if(this->neighborRanks_.empty()) {
822 this->printErr(
"Empty neighborsRanks_!");
828 std::vector<bool> inRank(nVertsCell);
829 std::map<int, int> neighborOccurrences;
830 for(
const auto neigh : this->neighborRanks_) {
831 std::fill(inRank.begin(), inRank.end(),
false);
832 const auto &bbox{this->neighborCellBBoxes_[neigh]};
833 for(
SimplexId i = 0; i < nVertsCell; ++i) {
836 if(this->vertexGhost_[v] == 0) {
839 const auto p{this->getVertGlobalCoords(v)};
840 if(p[0] >= bbox[0] && p[0] <= bbox[1] && p[1] >= bbox[2]
841 && p[1] <= bbox[3] && p[2] >= bbox[4] && p[2] <= bbox[5]) {
847 inRank.begin(), inRank.end(), [](
const bool v) { return v; })) {
850 neighborOccurrences[neigh]
851 = std::accumulate(inRank.begin(), inRank.end(), 0);
854 auto pr = std::max_element(
855 std::begin(neighborOccurrences), std::end(neighborOccurrences),
856 [](
const std::pair<int, int> &p1,
const std::pair<int, int> &p2) {
857 return p1.second < p2.second;
864template <
typename Derived>
870#ifndef TTK_ENABLE_KAMIKAZE
871 if(vertexId < 0 or vertexId >= vertexNumber_)
875 if(dimensionality_ == 3) {
876 const auto &p = this->underlying().getVertexCoords(vertexId);
878 x = origin_[0] + spacing_[0] * p[0];
879 y = origin_[1] + spacing_[1] * p[1];
880 z = origin_[2] + spacing_[2] * p[2];
881 }
else if(dimensionality_ == 2) {
882 const auto &p = this->underlying().getVertexCoords(vertexId);
884 if(dimensions_[0] > 1 and dimensions_[1] > 1) {
885 x = origin_[0] + spacing_[0] * p[0];
886 y = origin_[1] + spacing_[1] * p[1];
888 }
else if(dimensions_[1] > 1 and dimensions_[2] > 1) {
890 y = origin_[1] + spacing_[1] * p[0];
891 z = origin_[2] + spacing_[2] * p[1];
892 }
else if(dimensions_[0] > 1 and dimensions_[2] > 1) {
893 x = origin_[0] + spacing_[0] * p[0];
895 z = origin_[2] + spacing_[2] * p[1];
897 }
else if(dimensionality_ == 1) {
898 if(dimensions_[0] > 1) {
899 x = origin_[0] + spacing_[0] * vertexId;
902 }
else if(dimensions_[1] > 1) {
904 y = origin_[1] + spacing_[1] * vertexId;
906 }
else if(dimensions_[2] > 1) {
909 z = origin_[2] + spacing_[2] * vertexId;
916template <
typename Derived>
919 const int &localVertexId,
921#ifndef TTK_ENABLE_KAMIKAZE
922 if(edgeId < 0 or edgeId >= edgeNumber_)
924 if(localVertexId < 0 or localVertexId >= 2)
929 const auto &p = this->underlying().getEdgeCoords(edgeId);
930 const SimplexId wrapXRight = (p[0] == nbvoxels_[0] ? -wrap_[0] : 0);
931 const SimplexId wrapYBottom = (p[1] == nbvoxels_[1] ? -wrap_[1] : 0);
932 const SimplexId wrapZFront = (p[2] == nbvoxels_[2] ? -wrap_[2] : 0);
933 const auto a = p[0] + this->underlying().getEdgeVertexAccelerated(edgeId);
935 switch(this->underlying().getEdgePosition(edgeId)) {
936 case EdgePosition::L_3D:
937 vertexId = a + (localVertexId == 0 ? 0 : (1 + wrapXRight));
939 case EdgePosition::H_3D:
940 vertexId = a + (localVertexId == 0 ? 0 : (vshift_[0] + wrapYBottom));
942 case EdgePosition::P_3D:
943 vertexId = a + (localVertexId == 0 ? 0 : (vshift_[1] + wrapZFront));
945 case EdgePosition::D1_3D:
947 + (localVertexId == 0 ? (1 + wrapXRight)
948 : (vshift_[0] + wrapYBottom));
950 case EdgePosition::D2_3D:
952 + (localVertexId == 0
954 : (vshift_[0] + wrapYBottom + vshift_[1] + wrapZFront));
956 case EdgePosition::D3_3D:
959 + (localVertexId == 0 ? (1 + wrapXRight) : (vshift_[1] + wrapZFront));
961 case EdgePosition::D4_3D:
963 + (localVertexId == 0
965 : (vshift_[0] + wrapYBottom + vshift_[1] + wrapZFront));
967 case EdgePosition::L_2D:
968 vertexId = a + (localVertexId == 0 ? 0 : (1 + wrapXRight));
970 case EdgePosition::H_2D:
971 vertexId = a + (localVertexId == 0 ? 0 : (vshift_[0] + wrapYBottom));
973 case EdgePosition::D1_2D:
975 + (localVertexId == 0 ? (1 + wrapXRight)
976 : (vshift_[0] + wrapYBottom));
978 case EdgePosition::FIRST_EDGE_1D:
979 vertexId = localVertexId == 0 ? 0 : 1;
981 case EdgePosition::LAST_EDGE_1D:
982 vertexId = localVertexId == 0 ? edgeId : 0;
984 case EdgePosition::CENTER_1D:
985 vertexId = localVertexId == 0 ? edgeId : edgeId + 1;
994const vector<std::array<SimplexId, 2>> *
995 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
getEdges)() {
997 if(edgeList_.empty()) {
1000 edgeList_.resize(edgeNumber_);
1001 for(
SimplexId i = 0; i < edgeNumber_; ++i) {
1003 getEdgeVertexInternal(i, 0, id0);
1004 getEdgeVertexInternal(i, 1, id1);
1005 edgeList_[i] = {id0, id1};
1009 "Built " + to_string(edgeNumber_) +
" edges.", 1, t.
getElapsedTime(), 1);
1015template <
typename Derived>
1019#ifndef TTK_ENABLE_KAMIKAZE
1020 if(edgeId < 0 or edgeId >= edgeNumber_)
1024 switch(this->underlying().getEdgePosition(edgeId)) {
1025 case EdgePosition::L_3D:
1026 case EdgePosition::H_3D:
1027 case EdgePosition::P_3D:
1028 case EdgePosition::D4_3D:
1030 case EdgePosition::D1_3D:
1031 case EdgePosition::D2_3D:
1032 case EdgePosition::D3_3D:
1034 case EdgePosition::L_2D:
1035 case EdgePosition::H_2D:
1036 case EdgePosition::D1_2D:
1043template <
typename Derived>
1046 const int &localTriangleId,
1048#ifndef TTK_ENABLE_KAMIKAZE
1049 if(localTriangleId < 0
1050 or localTriangleId >= getEdgeTriangleNumberInternal(edgeId))
1055 const auto &p = this->underlying().getEdgeCoords(edgeId);
1057 switch(this->underlying().getEdgePosition(edgeId)) {
1058 case EdgePosition::L_3D:
1059 triangleId = getEdgeTriangle3dL(p.data(), localTriangleId);
1061 case EdgePosition::H_3D:
1062 triangleId = getEdgeTriangle3dH(p.data(), localTriangleId);
1064 case EdgePosition::P_3D:
1065 triangleId = getEdgeTriangle3dP(p.data(), localTriangleId);
1067 case EdgePosition::D1_3D:
1068 triangleId = getEdgeTriangle3dD1(p.data(), localTriangleId);
1070 case EdgePosition::D2_3D:
1071 triangleId = getEdgeTriangle3dD2(p.data(), localTriangleId);
1073 case EdgePosition::D3_3D:
1074 triangleId = getEdgeTriangle3dD3(p.data(), localTriangleId);
1076 case EdgePosition::D4_3D:
1077 triangleId = getEdgeTriangle3dD4(p.data(), localTriangleId);
1079 case EdgePosition::L_2D:
1080 triangleId = getEdgeTriangle2dL(p.data(), localTriangleId);
1082 case EdgePosition::H_2D:
1083 triangleId = getEdgeTriangle2dH(p.data(), localTriangleId);
1085 case EdgePosition::D1_2D:
1086 triangleId = getEdgeTriangle2dD1(p.data(), localTriangleId);
1095const vector<vector<SimplexId>> *
1114SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
1120template <
typename Derived>
1123 const int &localLinkId,
1125#ifndef TTK_ENABLE_KAMIKAZE
1131 const auto &p = this->underlying().getEdgeCoords(edgeId);
1133 switch(this->underlying().getEdgePosition(edgeId)) {
1134 case EdgePosition::L_3D:
1135 linkId = getEdgeLinkL(p.data(), localLinkId);
1137 case EdgePosition::H_3D:
1138 linkId = getEdgeLinkH(p.data(), localLinkId);
1140 case EdgePosition::P_3D:
1141 linkId = getEdgeLinkP(p.data(), localLinkId);
1143 case EdgePosition::D1_3D:
1144 linkId = getEdgeLinkD1(p.data(), localLinkId);
1146 case EdgePosition::D2_3D:
1147 linkId = getEdgeLinkD2(p.data(), localLinkId);
1149 case EdgePosition::D3_3D:
1150 linkId = getEdgeLinkD3(p.data(), localLinkId);
1152 case EdgePosition::D4_3D:
1153 linkId = getEdgeLinkD4(p.data(), localLinkId);
1155 case EdgePosition::L_2D:
1156 linkId = getEdgeLink2dL(p.data(), localLinkId);
1158 case EdgePosition::H_2D:
1159 linkId = getEdgeLink2dH(p.data(), localLinkId);
1161 case EdgePosition::D1_2D:
1162 linkId = getEdgeLink2dD1(p.data(), localLinkId);
1171const vector<vector<SimplexId>> *
1172 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
getEdgeLinks)() {
1174 if(edgeLinkList_.empty()) {
1177 edgeLinkList_.resize(edgeNumber_);
1178 for(
SimplexId i = 0; i < edgeNumber_; ++i) {
1184 printMsg(
"Built " + to_string(edgeNumber_) +
" edge links.", 1,
1188 return &edgeLinkList_;
1191template <
typename Derived>
1195#ifndef TTK_ENABLE_KAMIKAZE
1196 if(edgeId < 0 or edgeId >= edgeNumber_)
1200 switch(this->underlying().getEdgePosition(edgeId)) {
1201 case EdgePosition::L_3D:
1202 case EdgePosition::H_3D:
1203 case EdgePosition::P_3D:
1204 case EdgePosition::D4_3D:
1206 case EdgePosition::D1_3D:
1207 case EdgePosition::D2_3D:
1208 case EdgePosition::D3_3D:
1210 case EdgePosition::L_2D:
1211 case EdgePosition::H_2D:
1212 case EdgePosition::D1_2D:
1221template <
typename Derived>
1224 const int &localStarId,
1226#ifndef TTK_ENABLE_KAMIKAZE
1232 const auto &p = this->underlying().getEdgeCoords(edgeId);
1234 switch(this->underlying().getEdgePosition(edgeId)) {
1235 case EdgePosition::L_3D:
1236 starId = getEdgeStarL(p.data(), localStarId);
1238 case EdgePosition::H_3D:
1239 starId = getEdgeStarH(p.data(), localStarId);
1241 case EdgePosition::P_3D:
1242 starId = getEdgeStarP(p.data(), localStarId);
1244 case EdgePosition::D1_3D:
1245 starId = getEdgeStarD1(p.data(), localStarId);
1247 case EdgePosition::D2_3D:
1248 starId = getEdgeStarD2(p.data(), localStarId);
1250 case EdgePosition::D3_3D:
1251 starId = getEdgeStarD3(p.data(), localStarId);
1253 case EdgePosition::D4_3D:
1255 = p[2] * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6 + localStarId;
1257 case EdgePosition::L_2D:
1258 starId = getEdgeStar2dL(p.data(), localStarId);
1260 case EdgePosition::H_2D:
1261 starId = getEdgeStar2dH(p.data(), localStarId);
1263 case EdgePosition::D1_2D:
1264 starId = p[0] * 2 + p[1] * tshift_[0] + localStarId;
1273const vector<vector<SimplexId>> *
1274 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
getEdgeStars)() {
1276 if(edgeStarList_.empty()) {
1279 edgeStarList_.resize(edgeNumber_);
1280 for(
SimplexId i = 0; i < edgeNumber_; ++i) {
1286 printMsg(
"Built " + to_string(edgeNumber_) +
" edge stars.", 1,
1290 return &edgeStarList_;
1293template <
typename Derived>
1296 const int &localVertexId,
1298#ifndef TTK_ENABLE_KAMIKAZE
1299 if(triangleId < 0 or triangleId >= triangleNumber_)
1301 if(localVertexId < 0 or localVertexId >= 3)
1306 const auto &p = this->underlying().getTriangleCoords(triangleId);
1307 const SimplexId wrapXRight = (p[0] / 2 == nbvoxels_[Di_]) ? -wrap_[0] : 0;
1308 const SimplexId wrapYBottom = (p[1] == nbvoxels_[Dj_]) ? -wrap_[1] : 0;
1310 switch(this->underlying().getTrianglePosition(triangleId)) {
1311 case TrianglePosition::F_3D:
1312 vertexId = getTriangleVertexF(p.data(), localVertexId);
1314 case TrianglePosition::H_3D:
1315 vertexId = getTriangleVertexH(p.data(), localVertexId);
1317 case TrianglePosition::C_3D:
1318 vertexId = getTriangleVertexC(p.data(), localVertexId);
1320 case TrianglePosition::D1_3D:
1321 vertexId = getTriangleVertexD1(p.data(), localVertexId);
1323 case TrianglePosition::D2_3D:
1324 vertexId = getTriangleVertexD2(p.data(), localVertexId);
1326 case TrianglePosition::D3_3D:
1327 vertexId = getTriangleVertexD3(p.data(), localVertexId);
1329 case TrianglePosition::TOP_2D:
1330 if(localVertexId == 0) {
1331 vertexId = p[0] / 2 + p[1] * vshift_[0];
1332 }
else if(localVertexId == 1) {
1333 vertexId = p[0] / 2 + p[1] * vshift_[0] + 1 + wrapXRight;
1334 }
else if(localVertexId == 2) {
1335 vertexId = p[0] / 2 + p[1] * vshift_[0] + vshift_[0] + wrapYBottom;
1338 case TrianglePosition::BOTTOM_2D:
1339 if(localVertexId == 0) {
1340 vertexId = p[0] / 2 + p[1] * vshift_[0] + 1 + wrapXRight;
1341 }
else if(localVertexId == 1) {
1342 vertexId = p[0] / 2 + p[1] * vshift_[0] + vshift_[0] + 1 + wrapXRight
1344 }
else if(localVertexId == 2) {
1345 vertexId = p[0] / 2 + p[1] * vshift_[0] + vshift_[0] + wrapYBottom;
1355template <
typename Derived>
1358 const int &localEdgeId,
1360#ifndef TTK_ENABLE_KAMIKAZE
1361 if(triangleId < 0 or triangleId >= triangleNumber_)
1363 if(localEdgeId < 0 or localEdgeId >= 3)
1368 const auto &p = this->underlying().getTriangleCoords(triangleId);
1369 const SimplexId wrapXRight = (p[0] / 2 == nbvoxels_[Di_]) ? -wrap_[0] : 0;
1370 const SimplexId wrapYBottom = (p[1] == nbvoxels_[Dj_]) ? -wrap_[1] : 0;
1373 switch(this->underlying().getTrianglePosition(triangleId)) {
1374 case TrianglePosition::F_3D:
1375 edgeId = (
id == 1) ? getTriangleEdgeF_1(p.data(), localEdgeId)
1376 : getTriangleEdgeF_0(p.data(), localEdgeId);
1378 case TrianglePosition::H_3D:
1379 edgeId = (
id == 1) ? getTriangleEdgeH_1(p.data(), localEdgeId)
1380 : getTriangleEdgeH_0(p.data(), localEdgeId);
1382 case TrianglePosition::C_3D:
1383 edgeId = (
id == 1) ? getTriangleEdgeC_1(p.data(), localEdgeId)
1384 : getTriangleEdgeC_0(p.data(), localEdgeId);
1386 case TrianglePosition::D1_3D:
1387 edgeId = (
id == 1) ? getTriangleEdgeD1_1(p.data(), localEdgeId)
1388 : getTriangleEdgeD1_0(p.data(), localEdgeId);
1390 case TrianglePosition::D2_3D:
1391 edgeId = (
id == 1) ? getTriangleEdgeD2_1(p.data(), localEdgeId)
1392 : getTriangleEdgeD2_0(p.data(), localEdgeId);
1394 case TrianglePosition::D3_3D:
1395 edgeId = (
id == 1) ? getTriangleEdgeD3_1(p.data(), localEdgeId)
1396 : getTriangleEdgeD3_0(p.data(), localEdgeId);
1398 case TrianglePosition::TOP_2D:
1399 if(localEdgeId == 0) {
1400 edgeId = p[0] / 2 + p[1] * eshift_[0];
1401 }
else if(localEdgeId == 1) {
1402 edgeId = esetshift_[0] + p[0] / 2 + p[1] * eshift_[2];
1403 }
else if(localEdgeId == 2) {
1404 edgeId = esetshift_[1] + p[0] / 2 + p[1] * eshift_[4];
1407 case TrianglePosition::BOTTOM_2D:
1408 if(localEdgeId == 0) {
1409 edgeId = p[0] / 2 + (p[1] + 1) * eshift_[0] + wrapYBottom;
1410 }
else if(localEdgeId == 1) {
1412 = esetshift_[0] + (p[0] + 1) / 2 + p[1] * eshift_[2] + wrapXRight;
1413 }
else if(localEdgeId == 2) {
1414 edgeId = esetshift_[1] + p[0] / 2 + p[1] * eshift_[4];
1425 vector<vector<SimplexId>> &edges)
const {
1429 for(
int j = 0; j < 3; ++j)
1435const vector<vector<SimplexId>> *
1449const vector<std::array<SimplexId, 3>> *
1450 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
getTriangles)() {
1452 if(triangleList_.empty()) {
1455 triangleList_.resize(triangleNumber_);
1456 for(
SimplexId i = 0; i < triangleNumber_; ++i) {
1457 for(
int j = 0; j < 3; ++j)
1458 getTriangleVertexInternal(i, j, triangleList_[i][j]);
1461 printMsg(
"Built " + to_string(triangleNumber_) +
" triangles.", 1,
1465 return &triangleList_;
1468template <
typename Derived>
1471 const int &localLinkId,
1473#ifndef TTK_ENABLE_KAMIKAZE
1479 const auto &p = this->underlying().getTriangleCoords(triangleId);
1481 switch(this->underlying().getTrianglePosition(triangleId)) {
1482 case TrianglePosition::F_3D:
1483 linkId = getTriangleLinkF(p.data(), localLinkId);
1485 case TrianglePosition::H_3D:
1486 linkId = getTriangleLinkH(p.data(), localLinkId);
1488 case TrianglePosition::C_3D:
1489 linkId = getTriangleLinkC(p.data(), localLinkId);
1491 case TrianglePosition::D1_3D:
1492 linkId = getTriangleLinkD1(p.data(), localLinkId);
1494 case TrianglePosition::D2_3D:
1495 linkId = getTriangleLinkD2(p.data(), localLinkId);
1497 case TrianglePosition::D3_3D:
1498 linkId = getTriangleLinkD3(p.data(), localLinkId);
1507SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
1513const vector<vector<SimplexId>> *
1514 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
1517 if(triangleLinkList_.empty()) {
1520 triangleLinkList_.resize(triangleNumber_);
1521 for(
SimplexId i = 0; i < triangleNumber_; ++i) {
1527 printMsg(
"Built " + to_string(triangleNumber_) +
" triangle links.", 1,
1530 return &triangleLinkList_;
1533template <
typename Derived>
1537#ifndef TTK_ENABLE_KAMIKAZE
1538 if(triangleId < 0 or triangleId >= triangleNumber_)
1544 if(dimensionality_ == 3) {
1550template <
typename Derived>
1553 const int &localStarId,
1555#ifndef TTK_ENABLE_KAMIKAZE
1561 const auto &p = this->underlying().getTriangleCoords(triangleId);
1563 switch(this->underlying().getTrianglePosition(triangleId)) {
1564 case TrianglePosition::F_3D:
1565 starId = getTriangleStarF(p.data(), localStarId);
1567 case TrianglePosition::H_3D:
1568 starId = getTriangleStarH(p.data(), localStarId);
1570 case TrianglePosition::C_3D:
1571 starId = getTriangleStarC(p.data(), localStarId);
1573 case TrianglePosition::D1_3D:
1574 starId = getTriangleStarD1(p.data(), localStarId);
1576 case TrianglePosition::D2_3D:
1577 starId = getTriangleStarD2(p.data(), localStarId);
1579 case TrianglePosition::D3_3D:
1580 starId = getTriangleStarD3(p.data(), localStarId);
1589const vector<vector<SimplexId>> *
1590 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
1593 if(triangleStarList_.empty()) {
1596 triangleStarList_.resize(triangleNumber_);
1597 for(
SimplexId i = 0; i < triangleNumber_; ++i) {
1603 printMsg(
"Built " + to_string(triangleNumber_) +
" triangle stars.", 1,
1606 return &triangleStarList_;
1611#ifndef TTK_ENABLE_KAMIKAZE
1624template <
typename Derived>
1627 const int &localNeighborId,
1629#ifndef TTK_ENABLE_KAMIKAZE
1630 if(localNeighborId < 0
1631 or localNeighborId >= getTriangleNeighborNumber(triangleId))
1636 const auto &p = this->underlying().getTriangleCoords(triangleId);
1638 switch(this->underlying().getTrianglePosition(triangleId)) {
1639 case TrianglePosition::BOTTOM_2D:
1641 if(p[0] / 2 == nbvoxels_[Di_] and p[1] == nbvoxels_[Dj_]) {
1642 if(localNeighborId == 0) {
1643 neighborId = triangleId - 1;
1644 }
else if(localNeighborId == 1) {
1645 neighborId = triangleId + 1 - wrap_[0] * 2;
1646 }
else if(localNeighborId == 2) {
1647 neighborId = triangleId + tshift_[0] - 1 - wrap_[1] * 2;
1650 }
else if(p[0] / 2 == nbvoxels_[Di_]) {
1651 if(localNeighborId == 0) {
1652 neighborId = triangleId - 1;
1653 }
else if(localNeighborId == 1) {
1654 neighborId = triangleId + 1 - wrap_[0] * 2;
1655 }
else if(localNeighborId == 2) {
1656 neighborId = triangleId + tshift_[0] - 1;
1659 }
else if(p[1] == nbvoxels_[Dj_]) {
1660 if(localNeighborId == 0) {
1661 neighborId = triangleId - 1;
1662 }
else if(localNeighborId == 1) {
1663 neighborId = triangleId + 1;
1664 }
else if(localNeighborId == 2) {
1665 neighborId = triangleId + tshift_[0] - 1 - wrap_[1] * 2;
1669 if(localNeighborId == 0) {
1670 neighborId = triangleId - 1;
1671 }
else if(localNeighborId == 1) {
1672 neighborId = triangleId + 1;
1673 }
else if(localNeighborId == 2) {
1674 neighborId = triangleId + tshift_[0] - 1;
1679 case TrianglePosition::TOP_2D:
1681 if(p[0] / 2 == 0 and p[1] == 0) {
1682 if(localNeighborId == 0) {
1683 neighborId = triangleId + 1;
1684 }
else if(localNeighborId == 1) {
1685 neighborId = triangleId - 1 + wrap_[0] * 2;
1686 }
else if(localNeighborId == 2) {
1687 neighborId = triangleId - tshift_[0] + 1 + wrap_[1] * 2;
1690 }
else if(p[0] / 2 == 0) {
1691 if(localNeighborId == 0) {
1692 neighborId = triangleId + 1;
1693 }
else if(localNeighborId == 1) {
1694 neighborId = triangleId - 1 + wrap_[0] * 2;
1695 }
else if(localNeighborId == 2) {
1696 neighborId = triangleId - tshift_[0] + 1;
1699 }
else if(p[1] == 0) {
1700 if(localNeighborId == 0) {
1701 neighborId = triangleId + 1;
1702 }
else if(localNeighborId == 1) {
1703 neighborId = triangleId - 1;
1704 }
else if(localNeighborId == 2) {
1705 neighborId = triangleId - tshift_[0] + 1 + wrap_[1] * 2;
1709 if(localNeighborId == 0) {
1710 neighborId = triangleId + 1;
1711 }
else if(localNeighborId == 1) {
1712 neighborId = triangleId - 1;
1713 }
else if(localNeighborId == 2) {
1714 neighborId = triangleId - tshift_[0] + 1;
1726 vector<vector<SimplexId>> &neighbors) {
1736template <
typename Derived>
1739#ifndef TTK_ENABLE_KAMIKAZE
1740 if(tetId < 0 or tetId >= tetrahedronNumber_)
1742 if(localVertexId < 0 or localVertexId >= 4)
1748 if(dimensionality_ == 3) {
1749 const auto &p = this->underlying().getTetrahedronCoords(tetId);
1754 vertexId = getTetrahedronVertexABCG(p.data(), localVertexId);
1757 vertexId = getTetrahedronVertexBCDG(p.data(), localVertexId);
1760 vertexId = getTetrahedronVertexABEG(p.data(), localVertexId);
1763 vertexId = getTetrahedronVertexBEFG(p.data(), localVertexId);
1766 vertexId = getTetrahedronVertexBFGH(p.data(), localVertexId);
1769 vertexId = getTetrahedronVertexBDGH(p.data(), localVertexId);
1776template <
typename Derived>
1779#ifndef TTK_ENABLE_KAMIKAZE
1780 if(tetId < 0 or tetId >= tetrahedronNumber_)
1782 if(localEdgeId < 0 or localEdgeId >= 6)
1788 if(dimensionality_ == 3) {
1789 const auto &p = this->underlying().getTetrahedronCoords(tetId);
1794 edgeId = getTetrahedronEdgeABCG(p.data(), localEdgeId);
1797 edgeId = getTetrahedronEdgeBCDG(p.data(), localEdgeId);
1800 edgeId = getTetrahedronEdgeABEG(p.data(), localEdgeId);
1803 edgeId = getTetrahedronEdgeBEFG(p.data(), localEdgeId);
1806 edgeId = getTetrahedronEdgeBFGH(p.data(), localEdgeId);
1809 edgeId = getTetrahedronEdgeBDGH(p.data(), localEdgeId);
1818 vector<vector<SimplexId>> &edges)
const {
1822 for(
int j = 0; j < 6; ++j)
1829template <
typename Derived>
1832 const int &localTriangleId,
1834#ifndef TTK_ENABLE_KAMIKAZE
1835 if(tetId < 0 or tetId >= tetrahedronNumber_)
1837 if(localTriangleId < 0 or localTriangleId >= 4)
1843 if(dimensionality_ == 3) {
1844 const auto &p = this->underlying().getTetrahedronCoords(tetId);
1849 triangleId = getTetrahedronTriangleABCG(p.data(), localTriangleId);
1852 triangleId = getTetrahedronTriangleBCDG(p.data(), localTriangleId);
1855 triangleId = getTetrahedronTriangleABEG(p.data(), localTriangleId);
1858 triangleId = getTetrahedronTriangleBEFG(p.data(), localTriangleId);
1861 triangleId = getTetrahedronTriangleBFGH(p.data(), localTriangleId);
1864 triangleId = getTetrahedronTriangleBDGH(p.data(), localTriangleId);
1873 vector<vector<SimplexId>> &triangles)
const {
1876 triangles[i].resize(4);
1877 for(
int j = 0; j < 4; ++j)
1886#ifndef TTK_ENABLE_KAMIKAZE
1899template <
typename Derived>
1902 const int &localNeighborId,
1904#ifndef TTK_ENABLE_KAMIKAZE
1905 if(localNeighborId < 0
1906 or localNeighborId >= getTetrahedronNeighborNumber(tetId))
1912 if(dimensionality_ == 3) {
1913 const auto &p = this->underlying().getTetrahedronCoords(tetId);
1919 = getTetrahedronNeighborABCG(tetId, p.data(), localNeighborId);
1923 = getTetrahedronNeighborBCDG(tetId, p.data(), localNeighborId);
1927 = getTetrahedronNeighborABEG(tetId, p.data(), localNeighborId);
1931 = getTetrahedronNeighborBEFG(tetId, p.data(), localNeighborId);
1935 = getTetrahedronNeighborBFGH(tetId, p.data(), localNeighborId);
1939 = getTetrahedronNeighborBDGH(tetId, p.data(), localNeighborId);
1948 vector<vector<SimplexId>> &neighbors) {
1959SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
1962 return dimensionality_ + 1;
1967 const int &localVertexId,
1970 if(dimensionality_ == 3)
1971 getTetrahedronVertex(cellId, localVertexId, vertexId);
1972 else if(dimensionality_ == 2)
1973 getTriangleVertexInternal(cellId, localVertexId, vertexId);
1974 else if(dimensionality_ == 1)
1975 getEdgeVertexInternal(cellId, localVertexId, vertexId);
2002const vector<vector<SimplexId>> *
2021 const int &localTriangleId,
2029const vector<vector<SimplexId>> *
2044SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
2047 if(dimensionality_ == 3)
2048 return getTetrahedronNeighborNumber(cellId);
2049 else if(dimensionality_ == 2)
2050 return getTriangleNeighborNumber(cellId);
2051 else if(dimensionality_ == 1) {
2052 printErr(
"getCellNeighborNumber() not implemented in 1D! (TODO)");
2061 const int &localNeighborId,
2064 if(dimensionality_ == 3)
2065 getTetrahedronNeighbor(cellId, localNeighborId, neighborId);
2066 else if(dimensionality_ == 2)
2067 getTriangleNeighbor(cellId, localNeighborId, neighborId);
2068 else if(dimensionality_ == 1) {
2069 printErr(
"getCellNeighbor() not implemented in 1D! (TODO)");
2076const vector<vector<SimplexId>> *
2077 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
2080 if(cellNeighborList_.empty()) {
2083 if(dimensionality_ == 3)
2084 getTetrahedronNeighbors(cellNeighborList_);
2085 else if(dimensionality_ == 2)
2086 getTriangleNeighbors(cellNeighborList_);
2087 else if(dimensionality_ == 1) {
2088 printErr(
"getCellNeighbors() not implemented in 1D! (TODO)");
2092 printMsg(
"Built " + to_string(cellNumber_) +
" cell neighbors.", 1,
2096 return &cellNeighborList_;
#define TTK_FORCE_USE(x)
Force the compiler to use the function/method parameter.
#define ttkNotUsed(x)
Mark function/method parameters that are not used in the function body at all.
bool ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() isTriangleOnBoundary(const SimplexId &triangleId) const
int ImplicitTriangulationCRTP< Derived >::TTK_TRIANGULATION_INTERNAL() getEdgeStar(const SimplexId &edgeId, const int &localStarId, SimplexId &starId) const
const vector< vector< SimplexId > > *ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getCellNeighbors()
SimplexId ImplicitTriangulationCRTP< Derived >::TTK_TRIANGULATION_INTERNAL() getTriangleStarNumber(const SimplexId &triangleId) const
int ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getCellNeighbor(const SimplexId &cellId, const int &localNeighborId, SimplexId &neighborId) const
int ImplicitTriangulationCRTP< Derived >::TTK_TRIANGULATION_INTERNAL() getVertexStar(const SimplexId &vertexId, const int &localStarId, SimplexId &starId) const
SimplexId ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getTriangleLinkNumber(const SimplexId &triangleId) const
int ImplicitTriangulationCRTP< Derived >::TTK_TRIANGULATION_INTERNAL() getEdgeLink(const SimplexId &edgeId, const int &localLinkId, SimplexId &linkId) const
int ImplicitTriangulationCRTP< Derived >::TTK_TRIANGULATION_INTERNAL() getTriangleLink(const SimplexId &triangleId, const int &localLinkId, SimplexId &linkId) const
SimplexId ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getCellVertexNumber(const SimplexId &) const
SimplexId ImplicitTriangulationCRTP< Derived >::TTK_TRIANGULATION_INTERNAL() getEdgeStarNumber(const SimplexId &edgeId) const
int ImplicitTriangulationCRTP< Derived >::TTK_TRIANGULATION_INTERNAL() getVertexNeighbor(const SimplexId &vertexId, const int &localNeighborId, SimplexId &neighborId) const
const vector< vector< SimplexId > > *ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getTriangleLinks()
const vector< vector< SimplexId > > *ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getTriangleStars()
SimplexId ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getVertexLinkNumber(const SimplexId &vertexId) const
SimplexId ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getCellNeighborNumber(const SimplexId &cellId) const
SimplexId ImplicitTriangulationCRTP< Derived >::TTK_TRIANGULATION_INTERNAL() getVertexStarNumber(const SimplexId &vertexId) const
const vector< vector< SimplexId > > *ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getVertexLinks()
const vector< vector< SimplexId > > *ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getEdgeStars()
bool ImplicitTriangulationCRTP< Derived >::TTK_TRIANGULATION_INTERNAL() isEdgeOnBoundary(const SimplexId &edgeId) const
int ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getCellVertex(const SimplexId &cellId, const int &localVertexId, SimplexId &vertexId) const
SimplexId ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getEdgeLinkNumber(const SimplexId &edgeId) const
const vector< vector< SimplexId > > *ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getVertexNeighbors()
int ImplicitTriangulationCRTP< Derived >::TTK_TRIANGULATION_INTERNAL() getTriangleStar(const SimplexId &triangleId, const int &localStarId, SimplexId &starId) const
const vector< std::array< SimplexId, 3 > > *ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getTriangles()
const vector< vector< SimplexId > > *ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getVertexStars()
int ImplicitTriangulationCRTP< Derived >::TTK_TRIANGULATION_INTERNAL() getVertexPoint(const SimplexId &vertexId, float &x, float &y, float &z) const
const vector< std::array< SimplexId, 2 > > *ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getEdges()
bool ImplicitTriangulationCRTP< Derived >::TTK_TRIANGULATION_INTERNAL() isVertexOnBoundary(const SimplexId &vertexId) const
int ImplicitTriangulationCRTP< Derived >::TTK_TRIANGULATION_INTERNAL() getVertexLink(const SimplexId &vertexId, const int &localLinkId, SimplexId &linkId) const
const vector< vector< SimplexId > > *ImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getEdgeLinks()
SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL() getVertexNeighborNumber(const SimplexId &vertexId) const
bool hasPeriodicBoundaries_
virtual int getVertexTriangleInternal(const SimplexId &ttkNotUsed(vertexId), const int &ttkNotUsed(localTriangleId), SimplexId &ttkNotUsed(triangleId)) const
std::vector< std::vector< SimplexId > > vertexEdgeList_
std::vector< std::vector< SimplexId > > triangleEdgeVector_
virtual int getTriangleEdgeInternal(const SimplexId &ttkNotUsed(triangleId), const int &ttkNotUsed(localEdgeId), SimplexId &ttkNotUsed(edgeId)) const
virtual SimplexId getEdgeTriangleNumberInternal(const SimplexId &ttkNotUsed(edgeId)) const
virtual int getEdgeTriangleInternal(const SimplexId &ttkNotUsed(edgeId), const int &ttkNotUsed(localTriangleId), SimplexId &ttkNotUsed(triangleId)) const
virtual int getVertexEdgeInternal(const SimplexId &ttkNotUsed(vertexId), const int &ttkNotUsed(localEdgeId), SimplexId &ttkNotUsed(edgeId)) const
std::vector< std::vector< SimplexId > > vertexTriangleList_
std::vector< std::vector< SimplexId > > cellEdgeVector_
std::vector< std::vector< SimplexId > > cellTriangleVector_
std::vector< std::vector< SimplexId > > edgeTriangleList_
void setDebugMsgPrefix(const std::string &prefix)
int printMsg(const std::string &msg, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
int printErr(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
int getTetrahedronVertex(const SimplexId &tetId, const int &localVertexId, SimplexId &vertexId) const override
int getTetrahedronTriangle(const SimplexId &tetId, const int &id, SimplexId &triangleId) const override
int getTriangleVertexInternal(const SimplexId &triangleId, const int &localVertexId, SimplexId &vertexId) const override
int getEdgeVertexInternal(const SimplexId &edgeId, const int &localVertexId, SimplexId &vertexId) const override
int getVertexTriangleInternal(const SimplexId &vertexId, const int &id, SimplexId &triangleId) const override
int getTriangleEdgeInternal(const SimplexId &triangleId, const int &id, SimplexId &edgeId) const override
int getTetrahedronNeighbor(const SimplexId &tetId, const int &localNeighborId, SimplexId &neighborId) const override
int getVertexEdgeInternal(const SimplexId &vertexId, const int &id, SimplexId &edgeId) const override
SimplexId getEdgeTriangleNumberInternal(const SimplexId &edgeId) const override
int getEdgeTriangleInternal(const SimplexId &edgeId, const int &id, SimplexId &triangleId) const override
int getTetrahedronEdge(const SimplexId &tetId, const int &id, SimplexId &edgeId) const override
int getTriangleNeighbor(const SimplexId &triangleId, const int &localNeighborId, SimplexId &neighborId) const override
int getTriangleNeighbors(std::vector< std::vector< SimplexId > > &neighbors)
virtual int getTetrahedronNeighbor(const SimplexId &tetId, const int &localNeighborId, SimplexId &neighborId) const =0
int getCellTriangleInternal(const SimplexId &cellId, const int &id, SimplexId &triangleId) const override
int setInputGrid(const float &xOrigin, const float &yOrigin, const float &zOrigin, const float &xSpacing, const float &ySpacing, const float &zSpacing, const SimplexId &xDim, const SimplexId &yDim, const SimplexId &zDim) override
const std::vector< std::vector< SimplexId > > * getTriangleEdgesInternal() override
int getTetrahedronNeighbors(std::vector< std::vector< SimplexId > > &neighbors)
SimplexId getVertexEdgeNumberInternal(const SimplexId &vertexId) const override
SimplexId getCellEdgeNumberInternal(const SimplexId &cellId) const override
int getTetrahedronEdges(std::vector< std::vector< SimplexId > > &edges) const
SimplexId getTriangleNeighborNumber(const SimplexId &triangleId) const
const std::array< ttk::SimplexId, 3 > & getGridDimensions() const override
SimplexId tetrahedronNumber_
SimplexId triangleNumber_
const std::vector< std::vector< SimplexId > > * getEdgeTrianglesInternal() override
virtual int getTriangleNeighbor(const SimplexId &triangleId, const int &localNeighborId, SimplexId &neighborId) const =0
bool isPowerOfTwo(unsigned long long int v, unsigned long long int &r)
virtual int getTetrahedronEdge(const SimplexId &tetId, const int &id, SimplexId &edgeId) const =0
virtual int getTetrahedronTriangle(const SimplexId &tetId, const int &id, SimplexId &triangleId) const =0
const std::vector< std::vector< SimplexId > > * getVertexEdgesInternal() override
~PeriodicImplicitTriangulation() override
PeriodicImplicitTriangulation()
SimplexId getVertexTriangleNumberInternal(const SimplexId &vertexId) const override
int getTetrahedronTriangles(std::vector< std::vector< SimplexId > > &triangles) const
const std::vector< std::vector< SimplexId > > * getCellEdgesInternal() override
int getCellEdgeInternal(const SimplexId &cellId, const int &id, SimplexId &edgeId) const override
SimplexId getTetrahedronNeighborNumber(const SimplexId &tetId) const
SimplexId TTK_TRIANGULATION_INTERNAL() getVertexNeighborNumber(const SimplexId &vertexId) const override
int TTK_TRIANGULATION_INTERNAL() getCellNeighbor(const SimplexId &cellId, const int &localNeighborId, SimplexId &neighborId) const override
const std::vector< std::vector< SimplexId > > * getCellTrianglesInternal() override
const std::vector< std::vector< SimplexId > > * getVertexTrianglesInternal() override
Periodic implicit Triangulation class without preconditioning.
Periodic implicit Triangulation class with preconditioning.
virtual void tetrahedronToPosition(const SimplexId tetrahedron, SimplexId p[3]) const =0
virtual void vertexToPosition(const SimplexId vertex, SimplexId p[3]) const =0
virtual void triangleToPosition2d(const SimplexId triangle, SimplexId p[2]) const =0
std::array< SimplexId, 3 > dimensions_
virtual void vertexToPosition2d(const SimplexId vertex, SimplexId p[2]) const =0
COMMON_EXPORTS int MPIsize_
COMMON_EXPORTS int MPIrank_
int SimplexId
Identifier type for simplices of any dimension.
printMsg(debug::output::GREEN+" "+debug::output::ENDCOLOR+debug::output::GREEN+"▒"+debug::output::ENDCOLOR+debug::output::GREEN+"▒▒▒▒▒▒▒▒▒▒▒▒▒░"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)