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) {
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) {
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) {
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);
673 localBBox_y_min{this->localGridOffset_[1] + this->
dimensions_[1]},
674 localBBox_z_min{this->localGridOffset_[2] + this->
dimensions_[2]};
676 localBBox_y_max{this->localGridOffset_[1]},
677 localBBox_z_max{this->localGridOffset_[2]};
678 const auto &dims{this->metaGrid_->getGridDimensions()};
679#ifdef TTK_ENABLE_OPENMP
680#pragma omp parallel for reduction( \
682 : localBBox_x_min, localBBox_y_min, localBBox_z_min) \
684 : localBBox_x_max, localBBox_y_max, localBBox_z_max)
686 for(
SimplexId lcid = 0; lcid < nLocCells; ++lcid) {
688 if(this->cellGhost_[lcid / nTetraPerCube] != 0) {
692 std::array<SimplexId, 3> p{};
703 p[0] += this->localGridOffset_[0];
704 p[1] += this->localGridOffset_[1];
705 p[2] += this->localGridOffset_[2];
707 if(p[0] < localBBox_x_min) {
710 if(p[0] > localBBox_x_max) {
711 localBBox_x_max = min(p[0], dims[0]);
713 if(p[1] < localBBox_y_min) {
716 if(p[1] > localBBox_y_max) {
717 localBBox_y_max = min(p[1], dims[1]);
719 if(p[2] < localBBox_z_min) {
722 if(p[2] > localBBox_z_max) {
723 localBBox_z_max = min(p[2], dims[2]);
726 localBBox_x_min -= isBoundaryPeriodic[0];
728 localBBox_y_min -= isBoundaryPeriodic[2];
730 localBBox_z_min -= isBoundaryPeriodic[4];
738 localBBox_x_min, localBBox_x_max, localBBox_y_min,
739 localBBox_y_max, localBBox_z_min, localBBox_z_max,
742 for(
size_t i = 0; i < this->neighborRanks_.size(); ++i) {
743 const auto neigh{this->neighborRanks_[i]};
744 MPI_Sendrecv(this->neighborCellBBoxes_[
ttk::MPIrank_].data(), 6,
746 this->neighborCellBBoxes_[neigh].data(), 6,
747 ttk::getMPIType(
SimplexId{}), neigh, neigh, ttk::MPIcomm_,
751 this->hasPreconditionedDistributedCells_ =
true;
756std::array<SimplexId, 3> PeriodicImplicitTriangulation::getVertGlobalCoords(
759 std::array<SimplexId, 3> p{};
766 p[0] += this->localGridOffset_[0];
767 p[1] += this->localGridOffset_[1];
768 p[2] += this->localGridOffset_[2];
770 const auto &dims{this->metaGrid_->getGridDimensions()};
772 p[0] = (p[0] + dims[0]) % dims[0];
774 p[1] = (p[1] + dims[1]) % dims[1];
776 p[2] = (p[2] + dims[2]) % dims[2];
782std::array<SimplexId, 3> PeriodicImplicitTriangulation::getVertLocalCoords(
785 std::array<SimplexId, 3> pGlobal{};
787 this->metaGrid_->vertexToPosition(gvid, pGlobal.data());
789 this->metaGrid_->vertexToPosition2d(gvid, pGlobal.data());
791 std::array<SimplexId, 3> p{pGlobal};
793 p[0] -= this->localGridOffset_[0];
794 p[1] -= this->localGridOffset_[1];
795 p[2] -= this->localGridOffset_[2];
799 if(p[0] >= 0 && p[1] >= 0 && p[2] >= 0 && p[0] <= dims[0] - 1
800 && p[1] <= dims[1] - 1 && p[2] <= dims[2] - 1) {
803 for(
int i = 0; i < 3; i++) {
804 if((p[i] < 0 || p[i] > dims[i] - 1) && pGlobal[i] == 0) {
807 if((p[i] < 0 || p[i] > dims[i] - 1)
808 && pGlobal[i] == this->metaGrid_->dimensions_[i] - 1) {
813 if(p[0] >= 0 && p[1] >= 0 && p[2] >= 0 && p[0] <= dims[0] - 1
814 && p[1] <= dims[1] - 1 && p[2] <= dims[2] - 1) {
815 if(this->vertexGhost_[p[0] + p[1] * dims[0] + p[2] * dims[0] * dims[1]]
820 return std::array<SimplexId, 3>{-1, -1, -1};
823int ttk::PeriodicImplicitTriangulation::getCellRankInternal(
826 const int nTetraPerCube{this->dimensionality_ == 3 ? 6 : 2};
827 const auto locCubeId{lcid / nTetraPerCube};
829 if(this->cellGhost_[locCubeId] == 0) {
833#ifndef TTK_ENABLE_KAMIKAZE
834 if(this->neighborRanks_.empty()) {
835 this->printErr(
"Empty neighborsRanks_!");
841 std::vector<bool> inRank(nVertsCell);
842 std::map<int, int> neighborOccurrences;
843 for(
const auto neigh : this->neighborRanks_) {
844 std::fill(inRank.begin(), inRank.end(),
false);
845 const auto &bbox{this->neighborCellBBoxes_[neigh]};
846 for(
SimplexId i = 0; i < nVertsCell; ++i) {
849 if(this->vertexGhost_[v] == 0) {
852 const auto p{this->getVertGlobalCoords(v)};
853 if(p[0] >= bbox[0] && p[0] <= bbox[1] && p[1] >= bbox[2]
854 && p[1] <= bbox[3] && p[2] >= bbox[4] && p[2] <= bbox[5]) {
860 inRank.begin(), inRank.end(), [](
const bool v) { return v; })) {
863 neighborOccurrences[neigh]
864 = std::accumulate(inRank.begin(), inRank.end(), 0);
867 auto pr = std::max_element(
868 std::begin(neighborOccurrences), std::end(neighborOccurrences),
869 [](
const std::pair<int, int> &p1,
const std::pair<int, int> &p2) {
870 return p1.second < p2.second;
877template <
typename Derived>
883#ifndef TTK_ENABLE_KAMIKAZE
884 if(vertexId < 0 or vertexId >= vertexNumber_)
888 if(dimensionality_ == 3) {
889 const auto &p = this->underlying().getVertexCoords(vertexId);
891 x = origin_[0] + spacing_[0] * p[0];
892 y = origin_[1] + spacing_[1] * p[1];
893 z = origin_[2] + spacing_[2] * p[2];
894 }
else if(dimensionality_ == 2) {
895 const auto &p = this->underlying().getVertexCoords(vertexId);
897 if(dimensions_[0] > 1 and dimensions_[1] > 1) {
898 x = origin_[0] + spacing_[0] * p[0];
899 y = origin_[1] + spacing_[1] * p[1];
901 }
else if(dimensions_[1] > 1 and dimensions_[2] > 1) {
903 y = origin_[1] + spacing_[1] * p[0];
904 z = origin_[2] + spacing_[2] * p[1];
905 }
else if(dimensions_[0] > 1 and dimensions_[2] > 1) {
906 x = origin_[0] + spacing_[0] * p[0];
908 z = origin_[2] + spacing_[2] * p[1];
910 }
else if(dimensionality_ == 1) {
911 if(dimensions_[0] > 1) {
912 x = origin_[0] + spacing_[0] * vertexId;
915 }
else if(dimensions_[1] > 1) {
917 y = origin_[1] + spacing_[1] * vertexId;
919 }
else if(dimensions_[2] > 1) {
922 z = origin_[2] + spacing_[2] * vertexId;
929template <
typename Derived>
932 const int &localVertexId,
934#ifndef TTK_ENABLE_KAMIKAZE
935 if(edgeId < 0 or edgeId >= edgeNumber_)
937 if(localVertexId < 0 or localVertexId >= 2)
942 const auto &p = this->underlying().getEdgeCoords(edgeId);
943 const SimplexId wrapXRight = (p[0] == nbvoxels_[0] ? -wrap_[0] : 0);
944 const SimplexId wrapYBottom = (p[1] == nbvoxels_[1] ? -wrap_[1] : 0);
945 const SimplexId wrapZFront = (p[2] == nbvoxels_[2] ? -wrap_[2] : 0);
946 const auto a = p[0] + this->underlying().getEdgeVertexAccelerated(edgeId);
948 switch(this->underlying().getEdgePosition(edgeId)) {
949 case EdgePosition::L_3D:
950 vertexId = a + (localVertexId == 0 ? 0 : (1 + wrapXRight));
952 case EdgePosition::H_3D:
953 vertexId = a + (localVertexId == 0 ? 0 : (vshift_[0] + wrapYBottom));
955 case EdgePosition::P_3D:
956 vertexId = a + (localVertexId == 0 ? 0 : (vshift_[1] + wrapZFront));
958 case EdgePosition::D1_3D:
960 + (localVertexId == 0 ? (1 + wrapXRight)
961 : (vshift_[0] + wrapYBottom));
963 case EdgePosition::D2_3D:
965 + (localVertexId == 0
967 : (vshift_[0] + wrapYBottom + vshift_[1] + wrapZFront));
969 case EdgePosition::D3_3D:
972 + (localVertexId == 0 ? (1 + wrapXRight) : (vshift_[1] + wrapZFront));
974 case EdgePosition::D4_3D:
976 + (localVertexId == 0
978 : (vshift_[0] + wrapYBottom + vshift_[1] + wrapZFront));
980 case EdgePosition::L_2D:
981 vertexId = a + (localVertexId == 0 ? 0 : (1 + wrapXRight));
983 case EdgePosition::H_2D:
984 vertexId = a + (localVertexId == 0 ? 0 : (vshift_[0] + wrapYBottom));
986 case EdgePosition::D1_2D:
988 + (localVertexId == 0 ? (1 + wrapXRight)
989 : (vshift_[0] + wrapYBottom));
991 case EdgePosition::FIRST_EDGE_1D:
992 vertexId = localVertexId == 0 ? 0 : 1;
994 case EdgePosition::LAST_EDGE_1D:
995 vertexId = localVertexId == 0 ? edgeId : 0;
997 case EdgePosition::CENTER_1D:
998 vertexId = localVertexId == 0 ? edgeId : edgeId + 1;
1007const vector<std::array<SimplexId, 2>> *
1008 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
getEdges)() {
1010 if(edgeList_.empty()) {
1013 edgeList_.resize(edgeNumber_);
1014 for(
SimplexId i = 0; i < edgeNumber_; ++i) {
1016 getEdgeVertexInternal(i, 0, id0);
1017 getEdgeVertexInternal(i, 1, id1);
1018 edgeList_[i] = {id0, id1};
1028template <
typename Derived>
1032#ifndef TTK_ENABLE_KAMIKAZE
1033 if(edgeId < 0 or edgeId >= edgeNumber_)
1037 switch(this->underlying().getEdgePosition(edgeId)) {
1038 case EdgePosition::L_3D:
1039 case EdgePosition::H_3D:
1040 case EdgePosition::P_3D:
1041 case EdgePosition::D4_3D:
1043 case EdgePosition::D1_3D:
1044 case EdgePosition::D2_3D:
1045 case EdgePosition::D3_3D:
1047 case EdgePosition::L_2D:
1048 case EdgePosition::H_2D:
1049 case EdgePosition::D1_2D:
1056template <
typename Derived>
1059 const int &localTriangleId,
1061#ifndef TTK_ENABLE_KAMIKAZE
1062 if(localTriangleId < 0
1063 or localTriangleId >= getEdgeTriangleNumberInternal(edgeId))
1068 const auto &p = this->underlying().getEdgeCoords(edgeId);
1070 switch(this->underlying().getEdgePosition(edgeId)) {
1071 case EdgePosition::L_3D:
1072 triangleId = getEdgeTriangle3dL(p.data(), localTriangleId);
1074 case EdgePosition::H_3D:
1075 triangleId = getEdgeTriangle3dH(p.data(), localTriangleId);
1077 case EdgePosition::P_3D:
1078 triangleId = getEdgeTriangle3dP(p.data(), localTriangleId);
1080 case EdgePosition::D1_3D:
1081 triangleId = getEdgeTriangle3dD1(p.data(), localTriangleId);
1083 case EdgePosition::D2_3D:
1084 triangleId = getEdgeTriangle3dD2(p.data(), localTriangleId);
1086 case EdgePosition::D3_3D:
1087 triangleId = getEdgeTriangle3dD3(p.data(), localTriangleId);
1089 case EdgePosition::D4_3D:
1090 triangleId = getEdgeTriangle3dD4(p.data(), localTriangleId);
1092 case EdgePosition::L_2D:
1093 triangleId = getEdgeTriangle2dL(p.data(), localTriangleId);
1095 case EdgePosition::H_2D:
1096 triangleId = getEdgeTriangle2dH(p.data(), localTriangleId);
1098 case EdgePosition::D1_2D:
1099 triangleId = getEdgeTriangle2dD1(p.data(), localTriangleId);
1108const vector<vector<SimplexId>> *
1127SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
1133template <
typename Derived>
1136 const int &localLinkId,
1138#ifndef TTK_ENABLE_KAMIKAZE
1144 const auto &p = this->underlying().getEdgeCoords(edgeId);
1146 switch(this->underlying().getEdgePosition(edgeId)) {
1147 case EdgePosition::L_3D:
1148 linkId = getEdgeLinkL(p.data(), localLinkId);
1150 case EdgePosition::H_3D:
1151 linkId = getEdgeLinkH(p.data(), localLinkId);
1153 case EdgePosition::P_3D:
1154 linkId = getEdgeLinkP(p.data(), localLinkId);
1156 case EdgePosition::D1_3D:
1157 linkId = getEdgeLinkD1(p.data(), localLinkId);
1159 case EdgePosition::D2_3D:
1160 linkId = getEdgeLinkD2(p.data(), localLinkId);
1162 case EdgePosition::D3_3D:
1163 linkId = getEdgeLinkD3(p.data(), localLinkId);
1165 case EdgePosition::D4_3D:
1166 linkId = getEdgeLinkD4(p.data(), localLinkId);
1168 case EdgePosition::L_2D:
1169 linkId = getEdgeLink2dL(p.data(), localLinkId);
1171 case EdgePosition::H_2D:
1172 linkId = getEdgeLink2dH(p.data(), localLinkId);
1174 case EdgePosition::D1_2D:
1175 linkId = getEdgeLink2dD1(p.data(), localLinkId);
1184const vector<vector<SimplexId>> *
1185 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
getEdgeLinks)() {
1187 if(edgeLinkList_.empty()) {
1190 edgeLinkList_.resize(edgeNumber_);
1191 for(
SimplexId i = 0; i < edgeNumber_; ++i) {
1201 return &edgeLinkList_;
1204template <
typename Derived>
1208#ifndef TTK_ENABLE_KAMIKAZE
1209 if(edgeId < 0 or edgeId >= edgeNumber_)
1213 switch(this->underlying().getEdgePosition(edgeId)) {
1214 case EdgePosition::L_3D:
1215 case EdgePosition::H_3D:
1216 case EdgePosition::P_3D:
1217 case EdgePosition::D4_3D:
1219 case EdgePosition::D1_3D:
1220 case EdgePosition::D2_3D:
1221 case EdgePosition::D3_3D:
1223 case EdgePosition::L_2D:
1224 case EdgePosition::H_2D:
1225 case EdgePosition::D1_2D:
1234template <
typename Derived>
1237 const int &localStarId,
1239#ifndef TTK_ENABLE_KAMIKAZE
1245 const auto &p = this->underlying().getEdgeCoords(edgeId);
1247 switch(this->underlying().getEdgePosition(edgeId)) {
1248 case EdgePosition::L_3D:
1249 starId = getEdgeStarL(p.data(), localStarId);
1251 case EdgePosition::H_3D:
1252 starId = getEdgeStarH(p.data(), localStarId);
1254 case EdgePosition::P_3D:
1255 starId = getEdgeStarP(p.data(), localStarId);
1257 case EdgePosition::D1_3D:
1258 starId = getEdgeStarD1(p.data(), localStarId);
1260 case EdgePosition::D2_3D:
1261 starId = getEdgeStarD2(p.data(), localStarId);
1263 case EdgePosition::D3_3D:
1264 starId = getEdgeStarD3(p.data(), localStarId);
1266 case EdgePosition::D4_3D:
1268 = p[2] * tetshift_[1] + p[1] * tetshift_[0] + p[0] * 6 + localStarId;
1270 case EdgePosition::L_2D:
1271 starId = getEdgeStar2dL(p.data(), localStarId);
1273 case EdgePosition::H_2D:
1274 starId = getEdgeStar2dH(p.data(), localStarId);
1276 case EdgePosition::D1_2D:
1277 starId = p[0] * 2 + p[1] * tshift_[0] + localStarId;
1286const vector<vector<SimplexId>> *
1287 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
getEdgeStars)() {
1289 if(edgeStarList_.empty()) {
1292 edgeStarList_.resize(edgeNumber_);
1293 for(
SimplexId i = 0; i < edgeNumber_; ++i) {
1303 return &edgeStarList_;
1306template <
typename Derived>
1309 const int &localVertexId,
1311#ifndef TTK_ENABLE_KAMIKAZE
1312 if(triangleId < 0 or triangleId >= triangleNumber_)
1314 if(localVertexId < 0 or localVertexId >= 3)
1319 const auto &p = this->underlying().getTriangleCoords(triangleId);
1320 const SimplexId wrapXRight = (p[0] / 2 == nbvoxels_[Di_]) ? -wrap_[0] : 0;
1321 const SimplexId wrapYBottom = (p[1] == nbvoxels_[Dj_]) ? -wrap_[1] : 0;
1323 switch(this->underlying().getTrianglePosition(triangleId)) {
1324 case TrianglePosition::F_3D:
1325 vertexId = getTriangleVertexF(p.data(), localVertexId);
1327 case TrianglePosition::H_3D:
1328 vertexId = getTriangleVertexH(p.data(), localVertexId);
1330 case TrianglePosition::C_3D:
1331 vertexId = getTriangleVertexC(p.data(), localVertexId);
1333 case TrianglePosition::D1_3D:
1334 vertexId = getTriangleVertexD1(p.data(), localVertexId);
1336 case TrianglePosition::D2_3D:
1337 vertexId = getTriangleVertexD2(p.data(), localVertexId);
1339 case TrianglePosition::D3_3D:
1340 vertexId = getTriangleVertexD3(p.data(), localVertexId);
1342 case TrianglePosition::TOP_2D:
1343 if(localVertexId == 0) {
1344 vertexId = p[0] / 2 + p[1] * vshift_[0];
1345 }
else if(localVertexId == 1) {
1346 vertexId = p[0] / 2 + p[1] * vshift_[0] + 1 + wrapXRight;
1347 }
else if(localVertexId == 2) {
1348 vertexId = p[0] / 2 + p[1] * vshift_[0] + vshift_[0] + wrapYBottom;
1351 case TrianglePosition::BOTTOM_2D:
1352 if(localVertexId == 0) {
1353 vertexId = p[0] / 2 + p[1] * vshift_[0] + 1 + wrapXRight;
1354 }
else if(localVertexId == 1) {
1355 vertexId = p[0] / 2 + p[1] * vshift_[0] + vshift_[0] + 1 + wrapXRight
1357 }
else if(localVertexId == 2) {
1358 vertexId = p[0] / 2 + p[1] * vshift_[0] + vshift_[0] + wrapYBottom;
1368template <
typename Derived>
1371 const int &localEdgeId,
1373#ifndef TTK_ENABLE_KAMIKAZE
1374 if(triangleId < 0 or triangleId >= triangleNumber_)
1376 if(localEdgeId < 0 or localEdgeId >= 3)
1381 const auto &p = this->underlying().getTriangleCoords(triangleId);
1382 const SimplexId wrapXRight = (p[0] / 2 == nbvoxels_[Di_]) ? -wrap_[0] : 0;
1383 const SimplexId wrapYBottom = (p[1] == nbvoxels_[Dj_]) ? -wrap_[1] : 0;
1386 switch(this->underlying().getTrianglePosition(triangleId)) {
1387 case TrianglePosition::F_3D:
1388 edgeId = (
id == 1) ? getTriangleEdgeF_1(p.data(), localEdgeId)
1389 : getTriangleEdgeF_0(p.data(), localEdgeId);
1391 case TrianglePosition::H_3D:
1392 edgeId = (
id == 1) ? getTriangleEdgeH_1(p.data(), localEdgeId)
1393 : getTriangleEdgeH_0(p.data(), localEdgeId);
1395 case TrianglePosition::C_3D:
1396 edgeId = (
id == 1) ? getTriangleEdgeC_1(p.data(), localEdgeId)
1397 : getTriangleEdgeC_0(p.data(), localEdgeId);
1399 case TrianglePosition::D1_3D:
1400 edgeId = (
id == 1) ? getTriangleEdgeD1_1(p.data(), localEdgeId)
1401 : getTriangleEdgeD1_0(p.data(), localEdgeId);
1403 case TrianglePosition::D2_3D:
1404 edgeId = (
id == 1) ? getTriangleEdgeD2_1(p.data(), localEdgeId)
1405 : getTriangleEdgeD2_0(p.data(), localEdgeId);
1407 case TrianglePosition::D3_3D:
1408 edgeId = (
id == 1) ? getTriangleEdgeD3_1(p.data(), localEdgeId)
1409 : getTriangleEdgeD3_0(p.data(), localEdgeId);
1411 case TrianglePosition::TOP_2D:
1412 if(localEdgeId == 0) {
1413 edgeId = p[0] / 2 + p[1] * eshift_[0];
1414 }
else if(localEdgeId == 1) {
1415 edgeId = esetshift_[0] + p[0] / 2 + p[1] * eshift_[2];
1416 }
else if(localEdgeId == 2) {
1417 edgeId = esetshift_[1] + p[0] / 2 + p[1] * eshift_[4];
1420 case TrianglePosition::BOTTOM_2D:
1421 if(localEdgeId == 0) {
1422 edgeId = p[0] / 2 + (p[1] + 1) * eshift_[0] + wrapYBottom;
1423 }
else if(localEdgeId == 1) {
1425 = esetshift_[0] + (p[0] + 1) / 2 + p[1] * eshift_[2] + wrapXRight;
1426 }
else if(localEdgeId == 2) {
1427 edgeId = esetshift_[1] + p[0] / 2 + p[1] * eshift_[4];
1438 vector<vector<SimplexId>> &edges)
const {
1442 for(
int j = 0; j < 3; ++j)
1448const vector<vector<SimplexId>> *
1462const vector<std::array<SimplexId, 3>> *
1463 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
getTriangles)() {
1465 if(triangleList_.empty()) {
1468 triangleList_.resize(triangleNumber_);
1469 for(
SimplexId i = 0; i < triangleNumber_; ++i) {
1470 for(
int j = 0; j < 3; ++j)
1471 getTriangleVertexInternal(i, j, triangleList_[i][j]);
1478 return &triangleList_;
1481template <
typename Derived>
1484 const int &localLinkId,
1486#ifndef TTK_ENABLE_KAMIKAZE
1492 const auto &p = this->underlying().getTriangleCoords(triangleId);
1494 switch(this->underlying().getTrianglePosition(triangleId)) {
1495 case TrianglePosition::F_3D:
1496 linkId = getTriangleLinkF(p.data(), localLinkId);
1498 case TrianglePosition::H_3D:
1499 linkId = getTriangleLinkH(p.data(), localLinkId);
1501 case TrianglePosition::C_3D:
1502 linkId = getTriangleLinkC(p.data(), localLinkId);
1504 case TrianglePosition::D1_3D:
1505 linkId = getTriangleLinkD1(p.data(), localLinkId);
1507 case TrianglePosition::D2_3D:
1508 linkId = getTriangleLinkD2(p.data(), localLinkId);
1510 case TrianglePosition::D3_3D:
1511 linkId = getTriangleLinkD3(p.data(), localLinkId);
1520SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
1526const vector<vector<SimplexId>> *
1527 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
1530 if(triangleLinkList_.empty()) {
1533 triangleLinkList_.resize(triangleNumber_);
1534 for(
SimplexId i = 0; i < triangleNumber_; ++i) {
1543 return &triangleLinkList_;
1546template <
typename Derived>
1550#ifndef TTK_ENABLE_KAMIKAZE
1551 if(triangleId < 0 or triangleId >= triangleNumber_)
1557 if(dimensionality_ == 3) {
1563template <
typename Derived>
1566 const int &localStarId,
1568#ifndef TTK_ENABLE_KAMIKAZE
1574 const auto &p = this->underlying().getTriangleCoords(triangleId);
1576 switch(this->underlying().getTrianglePosition(triangleId)) {
1577 case TrianglePosition::F_3D:
1578 starId = getTriangleStarF(p.data(), localStarId);
1580 case TrianglePosition::H_3D:
1581 starId = getTriangleStarH(p.data(), localStarId);
1583 case TrianglePosition::C_3D:
1584 starId = getTriangleStarC(p.data(), localStarId);
1586 case TrianglePosition::D1_3D:
1587 starId = getTriangleStarD1(p.data(), localStarId);
1589 case TrianglePosition::D2_3D:
1590 starId = getTriangleStarD2(p.data(), localStarId);
1592 case TrianglePosition::D3_3D:
1593 starId = getTriangleStarD3(p.data(), localStarId);
1602const vector<vector<SimplexId>> *
1603 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
1606 if(triangleStarList_.empty()) {
1609 triangleStarList_.resize(triangleNumber_);
1610 for(
SimplexId i = 0; i < triangleNumber_; ++i) {
1619 return &triangleStarList_;
1624#ifndef TTK_ENABLE_KAMIKAZE
1637template <
typename Derived>
1640 const int &localNeighborId,
1642#ifndef TTK_ENABLE_KAMIKAZE
1643 if(localNeighborId < 0
1644 or localNeighborId >= getTriangleNeighborNumber(triangleId))
1649 const auto &p = this->underlying().getTriangleCoords(triangleId);
1651 switch(this->underlying().getTrianglePosition(triangleId)) {
1652 case TrianglePosition::BOTTOM_2D:
1654 if(p[0] / 2 == nbvoxels_[Di_] and p[1] == nbvoxels_[Dj_]) {
1655 if(localNeighborId == 0) {
1656 neighborId = triangleId - 1;
1657 }
else if(localNeighborId == 1) {
1658 neighborId = triangleId + 1 - wrap_[0] * 2;
1659 }
else if(localNeighborId == 2) {
1660 neighborId = triangleId + tshift_[0] - 1 - wrap_[1] * 2;
1663 }
else if(p[0] / 2 == nbvoxels_[Di_]) {
1664 if(localNeighborId == 0) {
1665 neighborId = triangleId - 1;
1666 }
else if(localNeighborId == 1) {
1667 neighborId = triangleId + 1 - wrap_[0] * 2;
1668 }
else if(localNeighborId == 2) {
1669 neighborId = triangleId + tshift_[0] - 1;
1672 }
else if(p[1] == nbvoxels_[Dj_]) {
1673 if(localNeighborId == 0) {
1674 neighborId = triangleId - 1;
1675 }
else if(localNeighborId == 1) {
1676 neighborId = triangleId + 1;
1677 }
else if(localNeighborId == 2) {
1678 neighborId = triangleId + tshift_[0] - 1 - wrap_[1] * 2;
1682 if(localNeighborId == 0) {
1683 neighborId = triangleId - 1;
1684 }
else if(localNeighborId == 1) {
1685 neighborId = triangleId + 1;
1686 }
else if(localNeighborId == 2) {
1687 neighborId = triangleId + tshift_[0] - 1;
1692 case TrianglePosition::TOP_2D:
1694 if(p[0] / 2 == 0 and p[1] == 0) {
1695 if(localNeighborId == 0) {
1696 neighborId = triangleId + 1;
1697 }
else if(localNeighborId == 1) {
1698 neighborId = triangleId - 1 + wrap_[0] * 2;
1699 }
else if(localNeighborId == 2) {
1700 neighborId = triangleId - tshift_[0] + 1 + wrap_[1] * 2;
1703 }
else if(p[0] / 2 == 0) {
1704 if(localNeighborId == 0) {
1705 neighborId = triangleId + 1;
1706 }
else if(localNeighborId == 1) {
1707 neighborId = triangleId - 1 + wrap_[0] * 2;
1708 }
else if(localNeighborId == 2) {
1709 neighborId = triangleId - tshift_[0] + 1;
1712 }
else if(p[1] == 0) {
1713 if(localNeighborId == 0) {
1714 neighborId = triangleId + 1;
1715 }
else if(localNeighborId == 1) {
1716 neighborId = triangleId - 1;
1717 }
else if(localNeighborId == 2) {
1718 neighborId = triangleId - tshift_[0] + 1 + wrap_[1] * 2;
1722 if(localNeighborId == 0) {
1723 neighborId = triangleId + 1;
1724 }
else if(localNeighborId == 1) {
1725 neighborId = triangleId - 1;
1726 }
else if(localNeighborId == 2) {
1727 neighborId = triangleId - tshift_[0] + 1;
1739 vector<vector<SimplexId>> &neighbors) {
1749template <
typename Derived>
1752#ifndef TTK_ENABLE_KAMIKAZE
1753 if(tetId < 0 or tetId >= tetrahedronNumber_)
1755 if(localVertexId < 0 or localVertexId >= 4)
1761 if(dimensionality_ == 3) {
1762 const auto &p = this->underlying().getTetrahedronCoords(tetId);
1767 vertexId = getTetrahedronVertexABCG(p.data(), localVertexId);
1770 vertexId = getTetrahedronVertexBCDG(p.data(), localVertexId);
1773 vertexId = getTetrahedronVertexABEG(p.data(), localVertexId);
1776 vertexId = getTetrahedronVertexBEFG(p.data(), localVertexId);
1779 vertexId = getTetrahedronVertexBFGH(p.data(), localVertexId);
1782 vertexId = getTetrahedronVertexBDGH(p.data(), localVertexId);
1789template <
typename Derived>
1792#ifndef TTK_ENABLE_KAMIKAZE
1793 if(tetId < 0 or tetId >= tetrahedronNumber_)
1795 if(localEdgeId < 0 or localEdgeId >= 6)
1801 if(dimensionality_ == 3) {
1802 const auto &p = this->underlying().getTetrahedronCoords(tetId);
1807 edgeId = getTetrahedronEdgeABCG(p.data(), localEdgeId);
1810 edgeId = getTetrahedronEdgeBCDG(p.data(), localEdgeId);
1813 edgeId = getTetrahedronEdgeABEG(p.data(), localEdgeId);
1816 edgeId = getTetrahedronEdgeBEFG(p.data(), localEdgeId);
1819 edgeId = getTetrahedronEdgeBFGH(p.data(), localEdgeId);
1822 edgeId = getTetrahedronEdgeBDGH(p.data(), localEdgeId);
1831 vector<vector<SimplexId>> &edges)
const {
1835 for(
int j = 0; j < 6; ++j)
1842template <
typename Derived>
1845 const int &localTriangleId,
1847#ifndef TTK_ENABLE_KAMIKAZE
1848 if(tetId < 0 or tetId >= tetrahedronNumber_)
1850 if(localTriangleId < 0 or localTriangleId >= 4)
1856 if(dimensionality_ == 3) {
1857 const auto &p = this->underlying().getTetrahedronCoords(tetId);
1862 triangleId = getTetrahedronTriangleABCG(p.data(), localTriangleId);
1865 triangleId = getTetrahedronTriangleBCDG(p.data(), localTriangleId);
1868 triangleId = getTetrahedronTriangleABEG(p.data(), localTriangleId);
1871 triangleId = getTetrahedronTriangleBEFG(p.data(), localTriangleId);
1874 triangleId = getTetrahedronTriangleBFGH(p.data(), localTriangleId);
1877 triangleId = getTetrahedronTriangleBDGH(p.data(), localTriangleId);
1886 vector<vector<SimplexId>> &triangles)
const {
1889 triangles[i].resize(4);
1890 for(
int j = 0; j < 4; ++j)
1899#ifndef TTK_ENABLE_KAMIKAZE
1912template <
typename Derived>
1915 const int &localNeighborId,
1917#ifndef TTK_ENABLE_KAMIKAZE
1918 if(localNeighborId < 0
1919 or localNeighborId >= getTetrahedronNeighborNumber(tetId))
1925 if(dimensionality_ == 3) {
1926 const auto &p = this->underlying().getTetrahedronCoords(tetId);
1932 = getTetrahedronNeighborABCG(tetId, p.data(), localNeighborId);
1936 = getTetrahedronNeighborBCDG(tetId, p.data(), localNeighborId);
1940 = getTetrahedronNeighborABEG(tetId, p.data(), localNeighborId);
1944 = getTetrahedronNeighborBEFG(tetId, p.data(), localNeighborId);
1948 = getTetrahedronNeighborBFGH(tetId, p.data(), localNeighborId);
1952 = getTetrahedronNeighborBDGH(tetId, p.data(), localNeighborId);
1961 vector<vector<SimplexId>> &neighbors) {
1972SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
1975 return dimensionality_ + 1;
1980 const int &localVertexId,
1983 if(dimensionality_ == 3)
1984 getTetrahedronVertex(cellId, localVertexId, vertexId);
1985 else if(dimensionality_ == 2)
1986 getTriangleVertexInternal(cellId, localVertexId, vertexId);
1987 else if(dimensionality_ == 1)
1988 getEdgeVertexInternal(cellId, localVertexId, vertexId);
2015const vector<vector<SimplexId>> *
2034 const int &localTriangleId,
2042const vector<vector<SimplexId>> *
2057SimplexId PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
2060 if(dimensionality_ == 3)
2061 return getTetrahedronNeighborNumber(cellId);
2062 else if(dimensionality_ == 2)
2063 return getTriangleNeighborNumber(cellId);
2064 else if(dimensionality_ == 1) {
2065 printErr(
"getCellNeighborNumber() not implemented in 1D! (TODO)");
2074 const int &localNeighborId,
2077 if(dimensionality_ == 3)
2078 getTetrahedronNeighbor(cellId, localNeighborId, neighborId);
2079 else if(dimensionality_ == 2)
2080 getTriangleNeighbor(cellId, localNeighborId, neighborId);
2081 else if(dimensionality_ == 1) {
2082 printErr(
"getCellNeighbor() not implemented in 1D! (TODO)");
2089const vector<vector<SimplexId>> *
2090 PeriodicImplicitTriangulation::TTK_TRIANGULATION_INTERNAL(
2093 if(cellNeighborList_.empty()) {
2096 if(dimensionality_ == 3)
2097 getTetrahedronNeighbors(cellNeighborList_);
2098 else if(dimensionality_ == 2)
2099 getTriangleNeighbors(cellNeighborList_);
2100 else if(dimensionality_ == 1) {
2101 printErr(
"getCellNeighbors() not implemented in 1D! (TODO)");
2109 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 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
std::string to_string(__int128)
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)