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 const 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::isRunningWithMPI()) {
646 if(this->metaGrid_ ==
nullptr) {
649 if(this->cellGhost_ ==
nullptr) {
650 if(ttk::isRunningWithMPI()) {
651 this->
printErr(
"Missing cell ghost array!");
660 const auto spacing{this->metaGrid_->spacing_};
661 const auto origin{this->metaGrid_->origin_};
665 double globalBounds[6]{
666 origin[0], origin[0] + (this->metaGrid_->dimensions_[0] - 1) * spacing[0],
667 origin[1], origin[1] + (this->metaGrid_->dimensions_[1] - 1) * spacing[1],
668 origin[2], origin[2] + (this->metaGrid_->dimensions_[1] - 1) * spacing[2]};
670 for(
int i = 0; i < 3; i++) {
671 if(std::abs(globalBounds[2 * i] - boundingBox_[2 * i]) > spacing[i] / 2) {
672 Bbox[2 * i] = boundingBox_[2 * i] + spacing[i];
674 Bbox[2 * i] = boundingBox_[2 * i];
676 Bbox[2 * i] -= isBoundaryPeriodic[2 * i] * spacing[i];
677 if(std::abs(globalBounds[2 * i + 1] - boundingBox_[2 * i + 1])
679 Bbox[2 * i + 1] = boundingBox_[2 * i + 1] - spacing[i];
681 Bbox[2 * i + 1] = boundingBox_[2 * i + 1];
683 Bbox[2 * i + 1] += isBoundaryPeriodic[2 * i + 1] * spacing[i];
686 for(
size_t i = 0; i < this->neighborRanks_.size(); ++i) {
687 const auto neigh{this->neighborRanks_[i]};
688 MPI_Sendrecv(this->neighborCellBBoxes_[
ttk::MPIrank_].data(), 6, MPI_DOUBLE,
689 neigh,
ttk::MPIrank_, this->neighborCellBBoxes_[neigh].data(),
690 6, MPI_DOUBLE, neigh, neigh, ttk::MPIcomm_, MPI_STATUS_IGNORE);
693 this->hasPreconditionedDistributedCells_ =
true;
698std::array<SimplexId, 3> PeriodicImplicitTriangulation::getVertGlobalCoords(
701 std::array<SimplexId, 3> p{};
708 p[0] += this->localGridOffset_[0];
709 p[1] += this->localGridOffset_[1];
710 p[2] += this->localGridOffset_[2];
712 const auto &dims{this->metaGrid_->getGridDimensions()};
714 p[0] = (p[0] + dims[0]) % dims[0];
716 p[1] = (p[1] + dims[1]) % dims[1];
718 p[2] = (p[2] + dims[2]) % dims[2];
724std::array<SimplexId, 3> PeriodicImplicitTriangulation::getVertLocalCoords(
727 std::array<SimplexId, 3> pGlobal{};
729 this->metaGrid_->vertexToPosition(gvid, pGlobal.data());
731 this->metaGrid_->vertexToPosition2d(gvid, pGlobal.data());
733 std::array<SimplexId, 3> p{pGlobal};
735 p[0] -= this->localGridOffset_[0];
736 p[1] -= this->localGridOffset_[1];
737 p[2] -= this->localGridOffset_[2];
741 if(p[0] >= 0 && p[1] >= 0 && p[2] >= 0 && p[0] <= dims[0] - 1
742 && p[1] <= dims[1] - 1 && p[2] <= dims[2] - 1) {
745 for(
int i = 0; i < 3; i++) {
746 if((p[i] < 0 || p[i] > dims[i] - 1) && pGlobal[i] == 0) {
749 if((p[i] < 0 || p[i] > dims[i] - 1)
750 && pGlobal[i] == this->metaGrid_->dimensions_[i] - 1) {
755 if(p[0] >= 0 && p[1] >= 0 && p[2] >= 0 && p[0] <= dims[0] - 1
756 && p[1] <= dims[1] - 1 && p[2] <= dims[2] - 1) {
757 if(this->vertexGhost_[p[0] + p[1] * dims[0] + p[2] * dims[0] * dims[1]]
762 return std::array<SimplexId, 3>{-1, -1, -1};
765int ttk::PeriodicImplicitTriangulation::getCellRankInternal(
768 const int nTetraPerCube{this->dimensionality_ == 3 ? 6 : 2};
769 const auto locCubeId{lcid / nTetraPerCube};
771 if(this->cellGhost_[locCubeId] == 0) {
775#ifndef TTK_ENABLE_KAMIKAZE
776 if(this->neighborRanks_.empty()) {
777 this->printErr(
"Empty neighborsRanks_!");
783 std::vector<bool> inRank(nVertsCell);
784 std::map<int, int> neighborOccurrences;
785 for(
const auto neigh : this->neighborRanks_) {
786 std::fill(inRank.begin(), inRank.end(),
false);
787 const auto &bbox{this->neighborCellBBoxes_[neigh]};
788 for(
SimplexId i = 0; i < nVertsCell; ++i) {
791 if(this->vertexGhost_[v] == 0) {
794 const auto p{this->getVertGlobalCoords(v)};
795 if(p[0] >= bbox[0] && p[0] <= bbox[1] && p[1] >= bbox[2]
796 && p[1] <= bbox[3] && p[2] >= bbox[4] && p[2] <= bbox[5]) {
802 inRank.begin(), inRank.end(), [](
const bool v) { return v; })) {
805 neighborOccurrences[neigh]
806 = std::accumulate(inRank.begin(), inRank.end(), 0);
809 auto pr = std::max_element(
810 std::begin(neighborOccurrences), std::end(neighborOccurrences),
811 [](
const std::pair<int, int> &p1,
const std::pair<int, int> &p2) {
812 return p1.second < p2.second;
819template <
typename Derived>
825#ifndef TTK_ENABLE_KAMIKAZE
826 if(vertexId < 0 or vertexId >= vertexNumber_)
830 if(dimensionality_ == 3) {
831 const auto &p = this->underlying().getVertexCoords(vertexId);
833 x = origin_[0] + spacing_[0] * p[0];
834 y = origin_[1] + spacing_[1] * p[1];
835 z = origin_[2] + spacing_[2] * p[2];
836 }
else if(dimensionality_ == 2) {
837 const auto &p = this->underlying().getVertexCoords(vertexId);
839 if(dimensions_[0] > 1 and dimensions_[1] > 1) {
840 x = origin_[0] + spacing_[0] * p[0];
841 y = origin_[1] + spacing_[1] * p[1];
843 }
else if(dimensions_[1] > 1 and dimensions_[2] > 1) {
845 y = origin_[1] + spacing_[1] * p[0];
846 z = origin_[2] + spacing_[2] * p[1];
847 }
else if(dimensions_[0] > 1 and dimensions_[2] > 1) {
848 x = origin_[0] + spacing_[0] * p[0];
850 z = origin_[2] + spacing_[2] * p[1];
852 }
else if(dimensionality_ == 1) {
853 if(dimensions_[0] > 1) {
854 x = origin_[0] + spacing_[0] * vertexId;
857 }
else if(dimensions_[1] > 1) {
859 y = origin_[1] + spacing_[1] * vertexId;
861 }
else if(dimensions_[2] > 1) {
864 z = origin_[2] + spacing_[2] * vertexId;
871template <
typename Derived>
874 const int &localVertexId,
876#ifndef TTK_ENABLE_KAMIKAZE
877 if(edgeId < 0 or edgeId >= edgeNumber_)
879 if(localVertexId < 0 or localVertexId >= 2)
884 const auto &p = this->underlying().getEdgeCoords(edgeId);
885 const SimplexId wrapXRight = (p[0] == nbvoxels_[0] ? -wrap_[0] : 0);
886 const SimplexId wrapYBottom = (p[1] == nbvoxels_[1] ? -wrap_[1] : 0);
887 const SimplexId wrapZFront = (p[2] == nbvoxels_[2] ? -wrap_[2] : 0);
888 const auto a = p[0] + this->underlying().getEdgeVertexAccelerated(edgeId);
890 switch(this->underlying().getEdgePosition(edgeId)) {
891 case EdgePosition::L_3D:
892 vertexId = a + (localVertexId == 0 ? 0 : (1 + wrapXRight));
894 case EdgePosition::H_3D:
895 vertexId = a + (localVertexId == 0 ? 0 : (vshift_[0] + wrapYBottom));
897 case EdgePosition::P_3D:
898 vertexId = a + (localVertexId == 0 ? 0 : (vshift_[1] + wrapZFront));
900 case EdgePosition::D1_3D:
902 + (localVertexId == 0 ? (1 + wrapXRight)
903 : (vshift_[0] + wrapYBottom));
905 case EdgePosition::D2_3D:
907 + (localVertexId == 0
909 : (vshift_[0] + wrapYBottom + vshift_[1] + wrapZFront));
911 case EdgePosition::D3_3D:
914 + (localVertexId == 0 ? (1 + wrapXRight) : (vshift_[1] + wrapZFront));
916 case EdgePosition::D4_3D:
918 + (localVertexId == 0
920 : (vshift_[0] + wrapYBottom + vshift_[1] + wrapZFront));
922 case EdgePosition::L_2D:
923 vertexId = a + (localVertexId == 0 ? 0 : (1 + wrapXRight));
925 case EdgePosition::H_2D:
926 vertexId = a + (localVertexId == 0 ? 0 : (vshift_[0] + wrapYBottom));
928 case EdgePosition::D1_2D:
930 + (localVertexId == 0 ? (1 + wrapXRight)
931 : (vshift_[0] + wrapYBottom));
933 case EdgePosition::FIRST_EDGE_1D:
934 vertexId = localVertexId == 0 ? 0 : 1;
936 case EdgePosition::LAST_EDGE_1D:
937 vertexId = localVertexId == 0 ? edgeId : 0;
939 case EdgePosition::CENTER_1D:
940 vertexId = localVertexId == 0 ? edgeId : edgeId + 1;
949const vector<std::array<SimplexId, 2>> *
950 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
getEdges)() {
952 if(edgeList_.empty()) {
955 edgeList_.resize(edgeNumber_);
956 for(
SimplexId i = 0; i < edgeNumber_; ++i) {
958 getEdgeVertexInternal(i, 0, id0);
959 getEdgeVertexInternal(i, 1, id1);
960 edgeList_[i] = {id0, id1};
964 "Built " + to_string(edgeNumber_) +
" edges.", 1, t.
getElapsedTime(), 1);
970template <
typename Derived>
974#ifndef TTK_ENABLE_KAMIKAZE
975 if(edgeId < 0 or edgeId >= edgeNumber_)
979 switch(this->underlying().getEdgePosition(edgeId)) {
980 case EdgePosition::L_3D:
981 case EdgePosition::H_3D:
982 case EdgePosition::P_3D:
983 case EdgePosition::D4_3D:
985 case EdgePosition::D1_3D:
986 case EdgePosition::D2_3D:
987 case EdgePosition::D3_3D:
989 case EdgePosition::L_2D:
990 case EdgePosition::H_2D:
991 case EdgePosition::D1_2D:
998template <
typename Derived>
1001 const int &localTriangleId,
1003#ifndef TTK_ENABLE_KAMIKAZE
1004 if(localTriangleId < 0
1005 or localTriangleId >= getEdgeTriangleNumberInternal(edgeId))
1010 const auto &p = this->underlying().getEdgeCoords(edgeId);
1012 switch(this->underlying().getEdgePosition(edgeId)) {
1013 case EdgePosition::L_3D:
1014 triangleId = getEdgeTriangle3dL(p.data(), localTriangleId);
1016 case EdgePosition::H_3D:
1017 triangleId = getEdgeTriangle3dH(p.data(), localTriangleId);
1019 case EdgePosition::P_3D:
1020 triangleId = getEdgeTriangle3dP(p.data(), localTriangleId);
1022 case EdgePosition::D1_3D:
1023 triangleId = getEdgeTriangle3dD1(p.data(), localTriangleId);
1025 case EdgePosition::D2_3D:
1026 triangleId = getEdgeTriangle3dD2(p.data(), localTriangleId);
1028 case EdgePosition::D3_3D:
1029 triangleId = getEdgeTriangle3dD3(p.data(), localTriangleId);
1031 case EdgePosition::D4_3D:
1032 triangleId = getEdgeTriangle3dD4(p.data(), localTriangleId);
1034 case EdgePosition::L_2D:
1035 triangleId = getEdgeTriangle2dL(p.data(), localTriangleId);
1037 case EdgePosition::H_2D:
1038 triangleId = getEdgeTriangle2dH(p.data(), localTriangleId);
1040 case EdgePosition::D1_2D:
1041 triangleId = getEdgeTriangle2dD1(p.data(), localTriangleId);
1050const vector<vector<SimplexId>> *
1069SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
1075template <
typename Derived>
1078 const int &localLinkId,
1080#ifndef TTK_ENABLE_KAMIKAZE
1086 const auto &p = this->underlying().getEdgeCoords(edgeId);
1088 switch(this->underlying().getEdgePosition(edgeId)) {
1089 case EdgePosition::L_3D:
1090 linkId = getEdgeLinkL(p.data(), localLinkId);
1092 case EdgePosition::H_3D:
1093 linkId = getEdgeLinkH(p.data(), localLinkId);
1095 case EdgePosition::P_3D:
1096 linkId = getEdgeLinkP(p.data(), localLinkId);
1098 case EdgePosition::D1_3D:
1099 linkId = getEdgeLinkD1(p.data(), localLinkId);
1101 case EdgePosition::D2_3D:
1102 linkId = getEdgeLinkD2(p.data(), localLinkId);
1104 case EdgePosition::D3_3D:
1105 linkId = getEdgeLinkD3(p.data(), localLinkId);
1107 case EdgePosition::D4_3D:
1108 linkId = getEdgeLinkD4(p.data(), localLinkId);
1110 case EdgePosition::L_2D:
1111 linkId = getEdgeLink2dL(p.data(), localLinkId);
1113 case EdgePosition::H_2D:
1114 linkId = getEdgeLink2dH(p.data(), localLinkId);
1116 case EdgePosition::D1_2D:
1117 linkId = getEdgeLink2dD1(p.data(), localLinkId);
1126const vector<vector<SimplexId>> *
1127 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
getEdgeLinks)() {
1129 if(edgeLinkList_.empty()) {
1132 edgeLinkList_.resize(edgeNumber_);
1133 for(
SimplexId i = 0; i < edgeNumber_; ++i) {
1139 printMsg(
"Built " + to_string(edgeNumber_) +
" edge links.", 1,
1143 return &edgeLinkList_;
1146template <
typename Derived>
1150#ifndef TTK_ENABLE_KAMIKAZE
1151 if(edgeId < 0 or edgeId >= edgeNumber_)
1155 switch(this->underlying().getEdgePosition(edgeId)) {
1156 case EdgePosition::L_3D:
1157 case EdgePosition::H_3D:
1158 case EdgePosition::P_3D:
1159 case EdgePosition::D4_3D:
1161 case EdgePosition::D1_3D:
1162 case EdgePosition::D2_3D:
1163 case EdgePosition::D3_3D:
1165 case EdgePosition::L_2D:
1166 case EdgePosition::H_2D:
1167 case EdgePosition::D1_2D:
1176template <
typename Derived>
1179 const int &localStarId,
1181#ifndef TTK_ENABLE_KAMIKAZE
1187 const auto &p = this->underlying().getEdgeCoords(edgeId);
1189 switch(this->underlying().getEdgePosition(edgeId)) {
1190 case EdgePosition::L_3D:
1191 starId = getEdgeStarL(p.data(), localStarId);
1193 case EdgePosition::H_3D:
1194 starId = getEdgeStarH(p.data(), localStarId);
1196 case EdgePosition::P_3D:
1197 starId = getEdgeStarP(p.data(), localStarId);
1199 case EdgePosition::D1_3D:
1200 starId = getEdgeStarD1(p.data(), localStarId);
1202 case EdgePosition::D2_3D:
1203 starId = getEdgeStarD2(p.data(), localStarId);
1205 case EdgePosition::D3_3D:
1206 starId = getEdgeStarD3(p.data(), localStarId);
1208 case EdgePosition::D4_3D:
1210 = p[2] * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6 + localStarId;
1212 case EdgePosition::L_2D:
1213 starId = getEdgeStar2dL(p.data(), localStarId);
1215 case EdgePosition::H_2D:
1216 starId = getEdgeStar2dH(p.data(), localStarId);
1218 case EdgePosition::D1_2D:
1219 starId = p[0] * 2 + p[1] * tshift_[0] + localStarId;
1228const vector<vector<SimplexId>> *
1229 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
getEdgeStars)() {
1231 if(edgeStarList_.empty()) {
1234 edgeStarList_.resize(edgeNumber_);
1235 for(
SimplexId i = 0; i < edgeNumber_; ++i) {
1241 printMsg(
"Built " + to_string(edgeNumber_) +
" edge stars.", 1,
1245 return &edgeStarList_;
1248template <
typename Derived>
1251 const int &localVertexId,
1253#ifndef TTK_ENABLE_KAMIKAZE
1254 if(triangleId < 0 or triangleId >= triangleNumber_)
1256 if(localVertexId < 0 or localVertexId >= 3)
1261 const auto &p = this->underlying().getTriangleCoords(triangleId);
1262 const SimplexId wrapXRight = (p[0] / 2 == nbvoxels_[Di_]) ? -wrap_[0] : 0;
1263 const SimplexId wrapYBottom = (p[1] == nbvoxels_[Dj_]) ? -wrap_[1] : 0;
1265 switch(this->underlying().getTrianglePosition(triangleId)) {
1266 case TrianglePosition::F_3D:
1267 vertexId = getTriangleVertexF(p.data(), localVertexId);
1269 case TrianglePosition::H_3D:
1270 vertexId = getTriangleVertexH(p.data(), localVertexId);
1272 case TrianglePosition::C_3D:
1273 vertexId = getTriangleVertexC(p.data(), localVertexId);
1275 case TrianglePosition::D1_3D:
1276 vertexId = getTriangleVertexD1(p.data(), localVertexId);
1278 case TrianglePosition::D2_3D:
1279 vertexId = getTriangleVertexD2(p.data(), localVertexId);
1281 case TrianglePosition::D3_3D:
1282 vertexId = getTriangleVertexD3(p.data(), localVertexId);
1284 case TrianglePosition::TOP_2D:
1285 if(localVertexId == 0) {
1286 vertexId = p[0] / 2 + p[1] * vshift_[0];
1287 }
else if(localVertexId == 1) {
1288 vertexId = p[0] / 2 + p[1] * vshift_[0] + 1 + wrapXRight;
1289 }
else if(localVertexId == 2) {
1290 vertexId = p[0] / 2 + p[1] * vshift_[0] + vshift_[0] + wrapYBottom;
1293 case TrianglePosition::BOTTOM_2D:
1294 if(localVertexId == 0) {
1295 vertexId = p[0] / 2 + p[1] * vshift_[0] + 1 + wrapXRight;
1296 }
else if(localVertexId == 1) {
1297 vertexId = p[0] / 2 + p[1] * vshift_[0] + vshift_[0] + 1 + wrapXRight
1299 }
else if(localVertexId == 2) {
1300 vertexId = p[0] / 2 + p[1] * vshift_[0] + vshift_[0] + wrapYBottom;
1310template <
typename Derived>
1313 const int &localEdgeId,
1315#ifndef TTK_ENABLE_KAMIKAZE
1316 if(triangleId < 0 or triangleId >= triangleNumber_)
1318 if(localEdgeId < 0 or localEdgeId >= 3)
1323 const auto &p = this->underlying().getTriangleCoords(triangleId);
1324 const SimplexId wrapXRight = (p[0] / 2 == nbvoxels_[Di_]) ? -wrap_[0] : 0;
1325 const SimplexId wrapYBottom = (p[1] == nbvoxels_[Dj_]) ? -wrap_[1] : 0;
1328 switch(this->underlying().getTrianglePosition(triangleId)) {
1329 case TrianglePosition::F_3D:
1330 edgeId = (
id == 1) ? getTriangleEdgeF_1(p.data(), localEdgeId)
1331 : getTriangleEdgeF_0(p.data(), localEdgeId);
1333 case TrianglePosition::H_3D:
1334 edgeId = (
id == 1) ? getTriangleEdgeH_1(p.data(), localEdgeId)
1335 : getTriangleEdgeH_0(p.data(), localEdgeId);
1337 case TrianglePosition::C_3D:
1338 edgeId = (
id == 1) ? getTriangleEdgeC_1(p.data(), localEdgeId)
1339 : getTriangleEdgeC_0(p.data(), localEdgeId);
1341 case TrianglePosition::D1_3D:
1342 edgeId = (
id == 1) ? getTriangleEdgeD1_1(p.data(), localEdgeId)
1343 : getTriangleEdgeD1_0(p.data(), localEdgeId);
1345 case TrianglePosition::D2_3D:
1346 edgeId = (
id == 1) ? getTriangleEdgeD2_1(p.data(), localEdgeId)
1347 : getTriangleEdgeD2_0(p.data(), localEdgeId);
1349 case TrianglePosition::D3_3D:
1350 edgeId = (
id == 1) ? getTriangleEdgeD3_1(p.data(), localEdgeId)
1351 : getTriangleEdgeD3_0(p.data(), localEdgeId);
1353 case TrianglePosition::TOP_2D:
1354 if(localEdgeId == 0) {
1355 edgeId = p[0] / 2 + p[1] * eshift_[0];
1356 }
else if(localEdgeId == 1) {
1357 edgeId = esetshift_[0] + p[0] / 2 + p[1] * eshift_[2];
1358 }
else if(localEdgeId == 2) {
1359 edgeId = esetshift_[1] + p[0] / 2 + p[1] * eshift_[4];
1362 case TrianglePosition::BOTTOM_2D:
1363 if(localEdgeId == 0) {
1364 edgeId = p[0] / 2 + (p[1] + 1) * eshift_[0] + wrapYBottom;
1365 }
else if(localEdgeId == 1) {
1367 = esetshift_[0] + (p[0] + 1) / 2 + p[1] * eshift_[2] + wrapXRight;
1368 }
else if(localEdgeId == 2) {
1369 edgeId = esetshift_[1] + p[0] / 2 + p[1] * eshift_[4];
1380 vector<vector<SimplexId>> &edges)
const {
1384 for(
int j = 0; j < 3; ++j)
1390const vector<vector<SimplexId>> *
1404const vector<std::array<SimplexId, 3>> *
1405 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
getTriangles)() {
1407 if(triangleList_.empty()) {
1410 triangleList_.resize(triangleNumber_);
1411 for(
SimplexId i = 0; i < triangleNumber_; ++i) {
1412 for(
int j = 0; j < 3; ++j)
1413 getTriangleVertexInternal(i, j, triangleList_[i][j]);
1416 printMsg(
"Built " + to_string(triangleNumber_) +
" triangles.", 1,
1420 return &triangleList_;
1423template <
typename Derived>
1426 const int &localLinkId,
1428#ifndef TTK_ENABLE_KAMIKAZE
1434 const auto &p = this->underlying().getTriangleCoords(triangleId);
1436 switch(this->underlying().getTrianglePosition(triangleId)) {
1437 case TrianglePosition::F_3D:
1438 linkId = getTriangleLinkF(p.data(), localLinkId);
1440 case TrianglePosition::H_3D:
1441 linkId = getTriangleLinkH(p.data(), localLinkId);
1443 case TrianglePosition::C_3D:
1444 linkId = getTriangleLinkC(p.data(), localLinkId);
1446 case TrianglePosition::D1_3D:
1447 linkId = getTriangleLinkD1(p.data(), localLinkId);
1449 case TrianglePosition::D2_3D:
1450 linkId = getTriangleLinkD2(p.data(), localLinkId);
1452 case TrianglePosition::D3_3D:
1453 linkId = getTriangleLinkD3(p.data(), localLinkId);
1462SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
1468const vector<vector<SimplexId>> *
1469 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
1472 if(triangleLinkList_.empty()) {
1475 triangleLinkList_.resize(triangleNumber_);
1476 for(
SimplexId i = 0; i < triangleNumber_; ++i) {
1482 printMsg(
"Built " + to_string(triangleNumber_) +
" triangle links.", 1,
1485 return &triangleLinkList_;
1488template <
typename Derived>
1492#ifndef TTK_ENABLE_KAMIKAZE
1493 if(triangleId < 0 or triangleId >= triangleNumber_)
1499 if(dimensionality_ == 3) {
1505template <
typename Derived>
1508 const int &localStarId,
1510#ifndef TTK_ENABLE_KAMIKAZE
1516 const auto &p = this->underlying().getTriangleCoords(triangleId);
1518 switch(this->underlying().getTrianglePosition(triangleId)) {
1519 case TrianglePosition::F_3D:
1520 starId = getTriangleStarF(p.data(), localStarId);
1522 case TrianglePosition::H_3D:
1523 starId = getTriangleStarH(p.data(), localStarId);
1525 case TrianglePosition::C_3D:
1526 starId = getTriangleStarC(p.data(), localStarId);
1528 case TrianglePosition::D1_3D:
1529 starId = getTriangleStarD1(p.data(), localStarId);
1531 case TrianglePosition::D2_3D:
1532 starId = getTriangleStarD2(p.data(), localStarId);
1534 case TrianglePosition::D3_3D:
1535 starId = getTriangleStarD3(p.data(), localStarId);
1544const vector<vector<SimplexId>> *
1545 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
1548 if(triangleStarList_.empty()) {
1551 triangleStarList_.resize(triangleNumber_);
1552 for(
SimplexId i = 0; i < triangleNumber_; ++i) {
1558 printMsg(
"Built " + to_string(triangleNumber_) +
" triangle stars.", 1,
1561 return &triangleStarList_;
1566#ifndef TTK_ENABLE_KAMIKAZE
1579template <
typename Derived>
1582 const int &localNeighborId,
1584#ifndef TTK_ENABLE_KAMIKAZE
1585 if(localNeighborId < 0
1586 or localNeighborId >= getTriangleNeighborNumber(triangleId))
1591 const auto &p = this->underlying().getTriangleCoords(triangleId);
1593 switch(this->underlying().getTrianglePosition(triangleId)) {
1594 case TrianglePosition::BOTTOM_2D:
1596 if(p[0] / 2 == nbvoxels_[Di_] and p[1] == nbvoxels_[Dj_]) {
1597 if(localNeighborId == 0) {
1598 neighborId = triangleId - 1;
1599 }
else if(localNeighborId == 1) {
1600 neighborId = triangleId + 1 - wrap_[0] * 2;
1601 }
else if(localNeighborId == 2) {
1602 neighborId = triangleId + tshift_[0] - 1 - wrap_[1] * 2;
1605 }
else if(p[0] / 2 == nbvoxels_[Di_]) {
1606 if(localNeighborId == 0) {
1607 neighborId = triangleId - 1;
1608 }
else if(localNeighborId == 1) {
1609 neighborId = triangleId + 1 - wrap_[0] * 2;
1610 }
else if(localNeighborId == 2) {
1611 neighborId = triangleId + tshift_[0] - 1;
1614 }
else if(p[1] == nbvoxels_[Dj_]) {
1615 if(localNeighborId == 0) {
1616 neighborId = triangleId - 1;
1617 }
else if(localNeighborId == 1) {
1618 neighborId = triangleId + 1;
1619 }
else if(localNeighborId == 2) {
1620 neighborId = triangleId + tshift_[0] - 1 - wrap_[1] * 2;
1624 if(localNeighborId == 0) {
1625 neighborId = triangleId - 1;
1626 }
else if(localNeighborId == 1) {
1627 neighborId = triangleId + 1;
1628 }
else if(localNeighborId == 2) {
1629 neighborId = triangleId + tshift_[0] - 1;
1634 case TrianglePosition::TOP_2D:
1636 if(p[0] / 2 == 0 and p[1] == 0) {
1637 if(localNeighborId == 0) {
1638 neighborId = triangleId + 1;
1639 }
else if(localNeighborId == 1) {
1640 neighborId = triangleId - 1 + wrap_[0] * 2;
1641 }
else if(localNeighborId == 2) {
1642 neighborId = triangleId - tshift_[0] + 1 + wrap_[1] * 2;
1645 }
else if(p[0] / 2 == 0) {
1646 if(localNeighborId == 0) {
1647 neighborId = triangleId + 1;
1648 }
else if(localNeighborId == 1) {
1649 neighborId = triangleId - 1 + wrap_[0] * 2;
1650 }
else if(localNeighborId == 2) {
1651 neighborId = triangleId - tshift_[0] + 1;
1654 }
else if(p[1] == 0) {
1655 if(localNeighborId == 0) {
1656 neighborId = triangleId + 1;
1657 }
else if(localNeighborId == 1) {
1658 neighborId = triangleId - 1;
1659 }
else if(localNeighborId == 2) {
1660 neighborId = triangleId - tshift_[0] + 1 + wrap_[1] * 2;
1664 if(localNeighborId == 0) {
1665 neighborId = triangleId + 1;
1666 }
else if(localNeighborId == 1) {
1667 neighborId = triangleId - 1;
1668 }
else if(localNeighborId == 2) {
1669 neighborId = triangleId - tshift_[0] + 1;
1681 vector<vector<SimplexId>> &neighbors) {
1691template <
typename Derived>
1694#ifndef TTK_ENABLE_KAMIKAZE
1695 if(tetId < 0 or tetId >= tetrahedronNumber_)
1697 if(localVertexId < 0 or localVertexId >= 4)
1703 if(dimensionality_ == 3) {
1704 const auto &p = this->underlying().getTetrahedronCoords(tetId);
1709 vertexId = getTetrahedronVertexABCG(p.data(), localVertexId);
1712 vertexId = getTetrahedronVertexBCDG(p.data(), localVertexId);
1715 vertexId = getTetrahedronVertexABEG(p.data(), localVertexId);
1718 vertexId = getTetrahedronVertexBEFG(p.data(), localVertexId);
1721 vertexId = getTetrahedronVertexBFGH(p.data(), localVertexId);
1724 vertexId = getTetrahedronVertexBDGH(p.data(), localVertexId);
1731template <
typename Derived>
1734#ifndef TTK_ENABLE_KAMIKAZE
1735 if(tetId < 0 or tetId >= tetrahedronNumber_)
1737 if(localEdgeId < 0 or localEdgeId >= 6)
1743 if(dimensionality_ == 3) {
1744 const auto &p = this->underlying().getTetrahedronCoords(tetId);
1749 edgeId = getTetrahedronEdgeABCG(p.data(), localEdgeId);
1752 edgeId = getTetrahedronEdgeBCDG(p.data(), localEdgeId);
1755 edgeId = getTetrahedronEdgeABEG(p.data(), localEdgeId);
1758 edgeId = getTetrahedronEdgeBEFG(p.data(), localEdgeId);
1761 edgeId = getTetrahedronEdgeBFGH(p.data(), localEdgeId);
1764 edgeId = getTetrahedronEdgeBDGH(p.data(), localEdgeId);
1773 vector<vector<SimplexId>> &edges)
const {
1777 for(
int j = 0; j < 6; ++j)
1784template <
typename Derived>
1787 const int &localTriangleId,
1789#ifndef TTK_ENABLE_KAMIKAZE
1790 if(tetId < 0 or tetId >= tetrahedronNumber_)
1792 if(localTriangleId < 0 or localTriangleId >= 4)
1798 if(dimensionality_ == 3) {
1799 const auto &p = this->underlying().getTetrahedronCoords(tetId);
1804 triangleId = getTetrahedronTriangleABCG(p.data(), localTriangleId);
1807 triangleId = getTetrahedronTriangleBCDG(p.data(), localTriangleId);
1810 triangleId = getTetrahedronTriangleABEG(p.data(), localTriangleId);
1813 triangleId = getTetrahedronTriangleBEFG(p.data(), localTriangleId);
1816 triangleId = getTetrahedronTriangleBFGH(p.data(), localTriangleId);
1819 triangleId = getTetrahedronTriangleBDGH(p.data(), localTriangleId);
1828 vector<vector<SimplexId>> &triangles)
const {
1831 triangles[i].resize(4);
1832 for(
int j = 0; j < 4; ++j)
1841#ifndef TTK_ENABLE_KAMIKAZE
1854template <
typename Derived>
1857 const int &localNeighborId,
1859#ifndef TTK_ENABLE_KAMIKAZE
1860 if(localNeighborId < 0
1861 or localNeighborId >= getTetrahedronNeighborNumber(tetId))
1867 if(dimensionality_ == 3) {
1868 const auto &p = this->underlying().getTetrahedronCoords(tetId);
1874 = getTetrahedronNeighborABCG(tetId, p.data(), localNeighborId);
1878 = getTetrahedronNeighborBCDG(tetId, p.data(), localNeighborId);
1882 = getTetrahedronNeighborABEG(tetId, p.data(), localNeighborId);
1886 = getTetrahedronNeighborBEFG(tetId, p.data(), localNeighborId);
1890 = getTetrahedronNeighborBFGH(tetId, p.data(), localNeighborId);
1894 = getTetrahedronNeighborBDGH(tetId, p.data(), localNeighborId);
1903 vector<vector<SimplexId>> &neighbors) {
1914SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
1917 return dimensionality_ + 1;
1922 const int &localVertexId,
1925 if(dimensionality_ == 3)
1926 getTetrahedronVertex(cellId, localVertexId, vertexId);
1927 else if(dimensionality_ == 2)
1928 getTriangleVertexInternal(cellId, localVertexId, vertexId);
1929 else if(dimensionality_ == 1)
1930 getEdgeVertexInternal(cellId, localVertexId, vertexId);
1957const vector<vector<SimplexId>> *
1976 const int &localTriangleId,
1984const vector<vector<SimplexId>> *
1999SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
2002 if(dimensionality_ == 3)
2003 return getTetrahedronNeighborNumber(cellId);
2004 else if(dimensionality_ == 2)
2005 return getTriangleNeighborNumber(cellId);
2006 else if(dimensionality_ == 1) {
2007 printErr(
"getCellNeighborNumber() not implemented in 1D! (TODO)");
2016 const int &localNeighborId,
2019 if(dimensionality_ == 3)
2020 getTetrahedronNeighbor(cellId, localNeighborId, neighborId);
2021 else if(dimensionality_ == 2)
2022 getTriangleNeighbor(cellId, localNeighborId, neighborId);
2023 else if(dimensionality_ == 1) {
2024 printErr(
"getCellNeighbor() not implemented in 1D! (TODO)");
2031const vector<vector<SimplexId>> *
2032 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
2035 if(cellNeighborList_.empty()) {
2038 if(dimensionality_ == 3)
2039 getTetrahedronNeighbors(cellNeighborList_);
2040 else if(dimensionality_ == 2)
2041 getTriangleNeighbors(cellNeighborList_);
2042 else if(dimensionality_ == 1) {
2043 printErr(
"getCellNeighbors() not implemented in 1D! (TODO)");
2047 printMsg(
"Built " + to_string(cellNumber_) +
" cell neighbors.", 1,
2051 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
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
int PeriodicImplicitTriangulationCRTP< Derived >::TTK_TRIANGULATION_INTERNAL() getVertexNeighbor(const SimplexId &vertexId, const int &localNeighborId, SimplexId &neighborId) 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 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 vertexToPosition(const SimplexId vertex, SimplexId p[3]) 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::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)