21#include <unordered_map>
23#ifdef TTK_ENABLE_KAMIKAZE
24#define TTK_TRIANGULATION_INTERNAL(NAME) NAME
26#define TTK_TRIANGULATION_INTERNAL(NAME) NAME##Internal
29#define ttkTemplateMacroCase(triangulationType, triangulationClass, call) \
30 case triangulationType: { \
31 using TTK_TT = triangulationClass; \
35#define ttkTemplateMacro(triangulationType, call) \
36 switch(triangulationType) { \
37 ttkTemplateMacroCase( \
38 ttk::Triangulation::Type::EXPLICIT, ttk::ExplicitTriangulation, call); \
39 ttkTemplateMacroCase( \
40 ttk::Triangulation::Type::IMPLICIT, ttk::ImplicitNoPreconditions, call); \
41 ttkTemplateMacroCase(ttk::Triangulation::Type::HYBRID_IMPLICIT, \
42 ttk::ImplicitWithPreconditions, call); \
43 ttkTemplateMacroCase( \
44 ttk::Triangulation::Type::PERIODIC, ttk::PeriodicNoPreconditions, call); \
45 ttkTemplateMacroCase(ttk::Triangulation::Type::HYBRID_PERIODIC, \
46 ttk::PeriodicWithPreconditions, call); \
47 ttkTemplateMacroCase( \
48 ttk::Triangulation::Type::COMPACT, ttk::CompactTriangulation, call); \
102 const int &localEdgeId,
105#ifndef TTK_ENABLE_KAMIKAZE
139#ifndef TTK_ENABLE_KAMIKAZE
180 virtual inline const std::vector<std::vector<SimplexId>> *
getCellEdges() {
181#ifndef TTK_ENABLE_KAMIKAZE
214 const int &localNeighborId,
217#ifndef TTK_ENABLE_KAMIKAZE
244#ifndef TTK_ENABLE_KAMIKAZE
276 virtual inline const std::vector<std::vector<SimplexId>> *
278#ifndef TTK_ENABLE_KAMIKAZE
308 const int &localTriangleId,
310#ifndef TTK_ENABLE_KAMIKAZE
345#ifndef TTK_ENABLE_KAMIKAZE
389 virtual inline const std::vector<std::vector<SimplexId>> *
391#ifndef TTK_ENABLE_KAMIKAZE
416 const int &localVertexId,
464 virtual inline const std::vector<std::array<SimplexId, 2>> *
getEdges() {
465#ifndef TTK_ENABLE_KAMIKAZE
495 const int &localLinkId,
497#ifndef TTK_ENABLE_KAMIKAZE
525#ifndef TTK_ENABLE_KAMIKAZE
558 virtual inline const std::vector<std::vector<SimplexId>> *
getEdgeLinks() {
559#ifndef TTK_ENABLE_KAMIKAZE
592 const int &localStarId,
595#ifndef TTK_ENABLE_KAMIKAZE
626#ifndef TTK_ENABLE_KAMIKAZE
664 virtual inline const std::vector<std::vector<SimplexId>> *
getEdgeStars() {
665#ifndef TTK_ENABLE_KAMIKAZE
695 const int &localTriangleId,
697#ifndef TTK_ENABLE_KAMIKAZE
708 return getEdgeStar(edgeId, localTriangleId, triangleId);
729#ifndef TTK_ENABLE_KAMIKAZE
768 virtual inline const std::vector<std::vector<SimplexId>> *
770#ifndef TTK_ENABLE_KAMIKAZE
802 const int &localVertexId,
804#ifndef TTK_ENABLE_KAMIKAZE
857#ifndef TTK_ENABLE_KAMIKAZE
881#ifndef TTK_ENABLE_KAMIKAZE
924 virtual inline const std::vector<std::array<SimplexId, 3>> *
getTriangles() {
925#ifndef TTK_ENABLE_KAMIKAZE
951 const int &localEdgeId,
953#ifndef TTK_ENABLE_KAMIKAZE
983#ifndef TTK_ENABLE_KAMIKAZE
1019 virtual inline const std::vector<std::vector<SimplexId>> *
1021#ifndef TTK_ENABLE_KAMIKAZE
1052 const int &localLinkId,
1054#ifndef TTK_ENABLE_KAMIKAZE
1084#ifndef TTK_ENABLE_KAMIKAZE
1118 virtual inline const std::vector<std::vector<SimplexId>> *
1120#ifndef TTK_ENABLE_KAMIKAZE
1151 const int &localStarId,
1153#ifndef TTK_ENABLE_KAMIKAZE
1182#ifndef TTK_ENABLE_KAMIKAZE
1217 virtual inline const std::vector<std::vector<SimplexId>> *
1219#ifndef TTK_ENABLE_KAMIKAZE
1247 const int &localVertexId,
1249#ifndef TTK_ENABLE_KAMIKAZE
1293 const int &localEdgeId,
1296#ifndef TTK_ENABLE_KAMIKAZE
1325#ifndef TTK_ENABLE_KAMIKAZE
1362#ifndef TTK_ENABLE_KAMIKAZE
1392 const int &localLinkId,
1394#ifndef TTK_ENABLE_KAMIKAZE
1420#ifndef TTK_ENABLE_KAMIKAZE
1452#ifndef TTK_ENABLE_KAMIKAZE
1476 const int &localNeighborId,
1478#ifndef TTK_ENABLE_KAMIKAZE
1501#ifndef TTK_ENABLE_KAMIKAZE
1531 virtual inline const std::vector<std::vector<SimplexId>> *
1533#ifndef TTK_ENABLE_KAMIKAZE
1574 const int &localStarId,
1576#ifndef TTK_ENABLE_KAMIKAZE
1602#ifndef TTK_ENABLE_KAMIKAZE
1635#ifndef TTK_ENABLE_KAMIKAZE
1663 const int &localTriangleId,
1665#ifndef TTK_ENABLE_KAMIKAZE
1676 return getVertexStar(vertexId, localTriangleId, triangleId);
1697#ifndef TTK_ENABLE_KAMIKAZE
1736 virtual inline const std::vector<std::vector<SimplexId>> *
1738#ifndef TTK_ENABLE_KAMIKAZE
1776#ifndef TTK_ENABLE_KAMIKAZE
1793#ifndef TTK_ENABLE_KAMIKAZE
1851#ifndef TTK_ENABLE_KAMIKAZE
1876#ifndef TTK_ENABLE_KAMIKAZE
2027#ifndef TTK_ENABLE_KAMIKAZE
2086#ifndef TTK_ENABLE_KAMIKAZE
2117#ifndef TTK_ENABLE_KAMIKAZE
2150#ifndef TTK_ENABLE_KAMIKAZE
2188#ifndef TTK_ENABLE_KAMIKAZE
2223#ifndef TTK_ENABLE_KAMIKAZE
2257#ifndef TTK_ENABLE_KAMIKAZE
2288#ifndef TTK_ENABLE_KAMIKAZE
2430#ifndef TTK_ENABLE_KAMIKAZE
2448 float incenter[3])
const {
2449 std::array<SimplexId, 2> vertexId{};
2453 std::array<float, 6> p{};
2457 incenter[0] = 0.5 * p[0] + 0.5 * p[3];
2458 incenter[1] = 0.5 * p[1] + 0.5 * p[4];
2459 incenter[2] = 0.5 * p[2] + 0.5 * p[5];
2468 float incenter[3])
const {
2470 std::array<SimplexId, 3> vertexId{};
2481 std::array<float, 9> p{};
2486 std::array<float, 3> d{};
2490 const float sum = d[0] + d[1] + d[2];
2496 incenter[0] = d[0] * p[0] + d[1] * p[3] + d[2] * p[6];
2497 incenter[1] = d[0] * p[1] + d[1] * p[4] + d[2] * p[7];
2498 incenter[2] = d[0] * p[2] + d[1] * p[5] + d[2] * p[8];
2508 float incenter[3])
const {
2513 std::array<float, 3> p{};
2514 for(
int i = 0; i < 4; ++i) {
2518 incenter[0] += p[0];
2519 incenter[1] += p[1];
2520 incenter[2] += p[2];
2523 incenter[0] /= 4.0f;
2524 incenter[1] /= 4.0f;
2525 incenter[2] /= 4.0f;
2535 float incenter[3])
const {
2555#ifndef TTK_ENABLE_KAMIKAZE
2562#ifdef TTK_ENABLE_MPI
2566 inline void setVertexGhostArray(
const unsigned char *
const data) {
2567 this->vertexGhost_ = data;
2570 inline void setCellGhostArray(
const unsigned char *
const data) {
2571 this->cellGhost_ = data;
2584 virtual int preconditionGlobalBoundary() {
2586 if(!hasPreconditionedGlobalBoundary_) {
2587 preconditionGlobalBoundaryInternal();
2588 hasPreconditionedGlobalBoundary_ =
true;
2593 virtual inline int preconditionGlobalBoundaryInternal() {
2598 virtual int preconditionDistributedVertices() {
2601 virtual int preconditionDistributedCells() {
2605 inline void setBoundingBox(
const double *
const bBox) {
2607 = {bBox[0], bBox[1], bBox[2], bBox[3], bBox[4], bBox[5]};
2613 virtual int preconditionExchangeGhostCells() {
2620 virtual int preconditionExchangeGhostVertices() {
2624 virtual int setVertexRankArray(
const int *
ttkNotUsed(rankArray)) {
2628 virtual int setCellRankArray(
const int *
ttkNotUsed(rankArray)) {
2632 virtual int preconditionEdgeRankArray() {
2636 virtual int preconditionTriangleRankArray() {
2643 if(!ttk::isRunningWithMPI()) {
2646#ifndef TTK_ENABLE_KAMIKAZE
2649 this->
printErr(
"Only 1D, 2D and 3D datasets are supported");
2652 if(!this->hasPreconditionedDistributedVertices_) {
2653 this->
printErr(
"VertexGlobalId query without pre-process!");
2655 "Please call preconditionDistributedVertices() in a pre-process.");
2662 return this->getVertexGlobalIdInternal(lvid);
2666 if(!ttk::isRunningWithMPI()) {
2669#ifndef TTK_ENABLE_KAMIKAZE
2672 this->
printErr(
"Only 1D, 2D and 3D datasets are supported");
2675 if(!this->hasPreconditionedDistributedVertices_) {
2676 this->
printErr(
"VertexLocalId query without pre-process!");
2678 "Please call preconditionDistributedVertices() in a pre-process.");
2682 return this->getVertexLocalIdInternal(gvid);
2686#ifndef TTK_ENABLE_KAMIKAZE
2689 this->
printErr(
"Only 1D, 2D and 3D datasets are supported");
2692 if(!this->hasPreconditionedDistributedCells_) {
2693 this->
printErr(
"CellGlobalId query without pre-process!");
2695 "Please call preconditionDistributedCells() in a pre-process.");
2702 if(!ttk::isRunningWithMPI()) {
2705 return this->getCellGlobalIdInternal(lcid);
2708#ifndef TTK_ENABLE_KAMIKAZE
2711 this->
printErr(
"Only 1D, 2D and 3D datasets are supported");
2714 if(!this->hasPreconditionedDistributedCells_) {
2715 this->
printErr(
"CellLocalId query without pre-process!");
2717 "Please call preconditionDistributedCells() in a pre-process.");
2721 if(!ttk::isRunningWithMPI()) {
2724 return this->getCellLocalIdInternal(gcid);
2729#ifndef TTK_ENABLE_KAMIKAZE
2730 if(dim != 1 && dim != 2 && dim != 3) {
2731 this->
printErr(
"Only 1D, 2D and 3D datasets are supported");
2734 if(!this->hasPreconditionedDistributedEdges_) {
2735 this->
printErr(
"EdgeGlobalId query without pre-process!");
2737 "Please call preconditionDistributedEdges() in a pre-process.");
2744 if(!ttk::isRunningWithMPI()) {
2747 if(dim == 2 || dim == 3) {
2748 return this->getEdgeGlobalIdInternal(leid);
2749 }
else if(dim == 1) {
2750 return this->getCellGlobalIdInternal(leid);
2756#ifndef TTK_ENABLE_KAMIKAZE
2757 if(dim != 1 && dim != 2 && dim != 3) {
2758 this->
printErr(
"Only 1D, 2D and 3D datasets are supported");
2761 if(!this->hasPreconditionedDistributedEdges_) {
2762 this->
printErr(
"EdgeLocalId query without pre-process!");
2764 "Please call preconditionDistributedEdges() in a pre-process.");
2768 if(!ttk::isRunningWithMPI()) {
2771 if(dim == 2 || dim == 3) {
2772 return this->getEdgeLocalIdInternal(geid);
2773 }
else if(dim == 1) {
2774 return this->getCellLocalIdInternal(geid);
2781#ifndef TTK_ENABLE_KAMIKAZE
2782 if(dim != 3 && dim != 2) {
2783 this->
printErr(
"Only 2D and 3D datasets are supported");
2786 if(!this->hasPreconditionedDistributedEdges_) {
2787 this->
printErr(
"TriangleGlobalId query without pre-process!");
2789 "Please call preconditionDistributedTriangles() in a pre-process.");
2796 if(!ttk::isRunningWithMPI()) {
2800 return this->getTriangleGlobalIdInternal(ltid);
2801 }
else if(dim == 2) {
2802 return this->getCellGlobalIdInternal(ltid);
2808#ifndef TTK_ENABLE_KAMIKAZE
2809 if(dim != 3 && dim != 2) {
2810 this->
printErr(
"Only 2D and 3D datasets are supported");
2813 if(!this->hasPreconditionedDistributedEdges_) {
2814 this->
printErr(
"TriangleLocalId query without pre-process!");
2816 "Please call preconditionDistributedTriangles() in a pre-process.");
2820 if(!ttk::isRunningWithMPI()) {
2824 return this->getTriangleLocalIdInternal(gtid);
2825 }
else if(dim == 2) {
2826 return this->getCellLocalIdInternal(gtid);
2831 virtual inline int getVertexRank(
const SimplexId lvid)
const {
2833 if(!ttk::isRunningWithMPI()) {
2836#ifndef TTK_ENABLE_KAMIKAZE
2839 this->
printErr(
"Only 1D, 2D and 3D datasets are supported");
2842 if(!this->hasPreconditionedDistributedVertices_) {
2843 this->
printErr(
"VertexRankId query without pre-process!");
2845 "Please call preconditionDistributedVertices() in a pre-process.");
2852 return this->getVertexRankInternal(lvid);
2855 virtual inline int getCellRank(
const SimplexId lcid)
const {
2856#ifndef TTK_ENABLE_KAMIKAZE
2859 this->
printErr(
"Only 1D, 2D and 3D datasets are supported");
2862 if(!this->hasPreconditionedDistributedCells_) {
2863 this->
printErr(
"CellRankId query without pre-process!");
2865 "Please call preconditionDistributedCells() in a pre-process.");
2872 if(!ttk::isRunningWithMPI()) {
2875 return this->getCellRankInternal(lcid);
2878 virtual inline const std::vector<int> &getNeighborRanks()
const {
2879 return this->neighborRanks_;
2881 virtual inline std::vector<int> &getNeighborRanks() {
2882 return this->neighborRanks_;
2885 virtual inline std::map<int, int> &getNeighborsToId() {
2886 return this->neighborsToId_;
2889 virtual inline const std::map<int, int> &getNeighborsToId()
const {
2890 return this->neighborsToId_;
2893 virtual inline const std::vector<std::array<ttk::SimplexId, 6>> &
2894 getNeighborVertexBBoxes()
const {
2895 return this->neighborVertexBBoxes_;
2898 virtual inline const std::vector<std::vector<SimplexId>> &
2899 getGhostCellsPerOwner()
const {
2900 if(!hasPreconditionedExchangeGhostCells_) {
2901 printErr(
"The ghostCellsOwner_ attribute has not been populated!");
2903 "Please call preconditionExchangeGhostCells in a pre-process.");
2905 return this->ghostCellsPerOwner_;
2908 virtual inline const std::vector<std::vector<SimplexId>> &
2909 getRemoteGhostCells()
const {
2910 if(!hasPreconditionedExchangeGhostCells_) {
2911 printErr(
"The remoteGhostCells_ attribute has not been populated!");
2913 "Please call preconditionExchangeGhostCells in a pre-process.");
2915 return this->remoteGhostCells_;
2918 virtual inline const std::vector<std::vector<SimplexId>> &
2919 getGhostVerticesPerOwner()
const {
2920 if(!hasPreconditionedExchangeGhostVertices_) {
2922 "The ghostVerticesPerOwner_ attribute has not been populated!");
2924 "Please call preconditionExchangeGhostVertices in a pre-process.");
2926 return this->ghostVerticesPerOwner_;
2929 virtual inline const std::vector<std::vector<SimplexId>> &
2930 getRemoteGhostVertices()
const {
2931 if(!hasPreconditionedExchangeGhostVertices_) {
2932 printErr(
"The remoteGhostVertices_ attribute has not been populated!");
2934 "Please call preconditionExchangeGhostVertices in a pre-process.");
2936 return this->remoteGhostVertices_;
2939 virtual inline void setHasPreconditionedDistributedVertices(
bool flag) {
2940 this->hasPreconditionedDistributedVertices_ = flag;
2943 virtual inline bool hasPreconditionedDistributedVertices()
const {
2944 return this->hasPreconditionedDistributedVertices_;
2946 virtual inline bool hasPreconditionedDistributedCells()
const {
2947 return this->hasPreconditionedDistributedCells_;
2950 inline int getDistributedGlobalCellId(
const SimplexId &localCellId,
2953 if(ttk::hasInitializedMPI()) {
2956 globalCellId = this->getVertexGlobalIdInternal(localCellId);
2959 globalCellId = this->getEdgeGlobalIdInternal(localCellId);
2963 globalCellId = this->getCellGlobalIdInternal(localCellId);
2966 globalCellId = this->getTriangleGlobalIdInternal(localCellId);
2970 globalCellId = this->getCellGlobalIdInternal(localCellId);
2978 globalCellId = localCellId;
2983 inline bool isOrderArrayGlobal(
const void *data)
const {
2984#ifndef TTK_ENABLE_KAMIKAZE
2985 if(isOrderArrayGlobal_.find(data) != isOrderArrayGlobal_.end())
2987 return isOrderArrayGlobal_.at(data);
2988#ifndef TTK_ENABLE_KAMIKAZE
2990 printErr(
"No global array flag has been found for this scalar field");
2996 inline void setIsOrderArrayGlobal(
const void *data,
bool flag) {
2997 isOrderArrayGlobal_[data] = flag;
3064 virtual inline bool isTriangleOnGlobalBoundaryInternal(
3083 virtual inline const std::vector<std::vector<SimplexId>> *
3100 virtual inline const std::vector<std::vector<SimplexId>> *
3117 virtual inline const std::vector<std::vector<SimplexId>> *
3138 virtual inline const std::vector<std::array<SimplexId, 2>> *
3155 virtual inline const std::vector<std::vector<SimplexId>> *
3172 virtual inline const std::vector<std::vector<SimplexId>> *
3189 virtual inline const std::vector<std::vector<SimplexId>> *
3217 virtual inline const std::vector<std::array<SimplexId, 3>> *
3234 virtual inline const std::vector<std::vector<SimplexId>> *
3251 virtual inline const std::vector<std::vector<SimplexId>> *
3268 virtual inline const std::vector<std::vector<SimplexId>> *
3292 virtual inline const std::vector<std::vector<SimplexId>> *
3309 virtual inline const std::vector<std::vector<SimplexId>> *
3326 virtual inline const std::vector<std::vector<SimplexId>> *
3351 virtual inline const std::vector<std::vector<SimplexId>> *
3368 virtual inline const std::vector<std::vector<SimplexId>> *
3390#ifndef TTK_ENABLE_KAMIKAZE
3393 printMsg(
"BoundaryEdge query without pre-process!",
3395 printMsg(
"Please call preconditionBoundaryEdges() in a pre-process.",
3404#ifndef TTK_ENABLE_KAMIKAZE
3407 printMsg(
"BoundaryTriangle query without pre-process!",
3410 "Please call preconditionBoundaryTriangles() in a pre-process.",
3418#ifndef TTK_ENABLE_KAMIKAZE
3421 printMsg(
"BoundaryVertex query without pre-process!",
3423 printMsg(
"Please call preconditionBoundaryVertices() in a pre-process.",
3432#ifndef TTK_ENABLE_KAMIKAZE
3438 printMsg(
"Please call preconditionCellEdges() in a pre-process.",
3447#ifndef TTK_ENABLE_KAMIKAZE
3450 printMsg(
"CellNeighbor query without pre-process!",
3452 printMsg(
"Please call preconditionCellNeighbors() in a pre-process.",
3460#ifndef TTK_ENABLE_KAMIKAZE
3465 printMsg(
"CellTriangle query without pre-process!",
3467 printMsg(
"Please call preconditionCellTriangles() in a pre-process.",
3477#ifndef TTK_ENABLE_KAMIKAZE
3482 printMsg(
"Please call preconditionEdgeLinks() in a pre-process.",
3490#ifndef TTK_ENABLE_KAMIKAZE
3495 printMsg(
"Please call preconditionEdgeStars() in a pre-process.",
3503#ifndef TTK_ENABLE_KAMIKAZE
3508 printMsg(
"EdgeTriangle query without pre-process!",
3510 printMsg(
"Please call preconditionEdgeTriangles() in a pre-process.",
3520#ifndef TTK_ENABLE_KAMIKAZE
3525 printMsg(
"Please call preconditionEdges() in a pre-process.",
3535#ifndef TTK_ENABLE_KAMIKAZE
3540 printMsg(
"Please call preconditionTriangles() in a pre-process.",
3550#ifndef TTK_ENABLE_KAMIKAZE
3555 printMsg(
"TriangleEdge query without pre-process!",
3557 printMsg(
"Please call preconditionTriangleEdges() in a pre-process.",
3567#ifndef TTK_ENABLE_KAMIKAZE
3570 printMsg(
"TriangleLink query without pre-process!",
3572 printMsg(
"Please call preconditionTriangleLinks() in a pre-process.",
3580#ifndef TTK_ENABLE_KAMIKAZE
3583 printMsg(
"TriangleStar query without pre-process!",
3585 printMsg(
"Please call preconditionTriangleStars() in a pre-process.",
3593#ifndef TTK_ENABLE_KAMIKAZE
3597 printMsg(
"VertexEdge query without pre-process!",
3599 printMsg(
"Please call preconditionVertexEdges() in a pre-process.",
3609#ifndef TTK_ENABLE_KAMIKAZE
3612 printMsg(
"VertexLink query without pre-process!",
3614 printMsg(
"Please call preconditionVertexLinks() in a pre-process.",
3622#ifndef TTK_ENABLE_KAMIKAZE
3625 printMsg(
"VertexNeighbor query without pre-process!",
3627 printMsg(
"Please call preconditionVertexNeighbors() in a pre-process.",
3635#ifndef TTK_ENABLE_KAMIKAZE
3638 printMsg(
"VertexStar query without pre-process!",
3640 printMsg(
"Please call preconditionVertexStars() in a pre-process.",
3648#ifndef TTK_ENABLE_KAMIKAZE
3653 printMsg(
"VertexTriangle query without pre-process!",
3655 printMsg(
"Please call preconditionVertexTriangles() in a pre-process.",
3665#ifndef TTK_ENABLE_KAMIKAZE
3667 this->
printMsg(
"isManifold query without pre-process!",
3669 this->
printMsg(
"Please call preconditionManifold() in a pre-process.",
3763#ifndef TTK_ENABLE_KAMIKAZE
3772 template <
class itemType>
3774 const std::string &tableName =
"",
3775 std::ostream &stream = std::cout)
const {
3777 std::stringstream msg;
3778 if((table.size()) && (tableName.length())) {
3779 msg << tableName <<
": " << table.size() *
sizeof(itemType) <<
" bytes";
3784 return table.size() *
sizeof(itemType);
3787 template <
class itemType>
3789 const std::string &tableName =
"",
3790 std::ostream &stream = std::cout)
const;
3836#ifdef TTK_ENABLE_MPI
3840 virtual int preconditionDistributedEdges() {
3843 virtual int preconditionDistributedTriangles() {
3848 const unsigned char *vertexGhost_{};
3850 const unsigned char *cellGhost_{};
3853 std::vector<int> neighborRanks_{};
3855 std::map<int, int> neighborsToId_{};
3857 std::vector<std::vector<SimplexId>> ghostCellsPerOwner_{};
3860 std::vector<std::vector<SimplexId>> remoteGhostCells_{};
3862 std::vector<std::vector<SimplexId>> ghostVerticesPerOwner_{};
3865 std::vector<std::vector<SimplexId>> remoteGhostVertices_{};
3867 std::vector<std::array<SimplexId, 6>> neighborVertexBBoxes_{};
3869 std::vector<std::array<double, 6>> neighborCellBBoxes_{};
3870 std::array<double, 6> boundingBox_{};
3872 bool hasPreconditionedDistributedCells_{
false};
3873 bool hasPreconditionedExchangeGhostCells_{
false};
3874 bool hasPreconditionedDistributedEdges_{
false};
3875 bool hasPreconditionedDistributedTriangles_{
false};
3876 bool hasPreconditionedDistributedVertices_{
false};
3877 bool hasPreconditionedExchangeGhostVertices_{
false};
3878 bool hasPreconditionedGlobalBoundary_{
false};
3879 std::map<const void *, bool> isOrderArrayGlobal_;
3886#ifdef TTK_ENABLE_DCG_OPTIMIZE_MEMORY
#define ttkNotUsed(x)
Mark function/method parameters that are not used in the function body at all.
AbstractTriangulation is an interface class that defines an interface for efficient traversal methods...
bool hasPreconditionedEdgeTriangles_
virtual const std::vector< std::vector< SimplexId > > * getCellNeighborsInternal()
virtual const std::vector< std::vector< SimplexId > > * getVertexNeighbors()
virtual int preconditionEdgeStars()
virtual int preconditionVertexLinksInternal()
virtual int getVertexPoint(const SimplexId &vertexId, float &x, float &y, float &z) const
std::vector< std::vector< SimplexId > > vertexStarList_
virtual SimplexId getVertexEdgeNumberInternal(const SimplexId &ttkNotUsed(vertexId)) const
std::pair< const void *, size_t > gradientKeyType
Key type for gradientCacheType.
virtual int preconditionBoundaryEdges()
virtual int getEdgeLink(const SimplexId &edgeId, const int &localLinkId, SimplexId &linkId) const
bool hasPreconditionedCellEdges_
bool hasPreconditionedBoundaryVertices_
virtual int getEdgeVertexInternal(const SimplexId &ttkNotUsed(edgeId), const int &ttkNotUsed(localVertexId), SimplexId &ttkNotUsed(vertexId)) const
virtual SimplexId getVertexTriangleNumber(const SimplexId &vertexId) const
virtual const std::vector< std::vector< SimplexId > > * getCellNeighbors()
virtual int getVertexTriangle(const SimplexId &vertexId, const int &localTriangleId, SimplexId &triangleId) const
bool hasPreconditionedBoundaryEdges_
virtual const std::vector< std::vector< SimplexId > > * getCellEdgesInternal()
virtual int getVertexEdge(const SimplexId &vertexId, const int &localEdgeId, SimplexId &edgeId) const
int getCellIncenter(const SimplexId cellid, const int dim, float incenter[3]) const
virtual SimplexId getEdgeTriangleNumber(const SimplexId &edgeId) const
virtual int preconditionTriangleLinksInternal()
virtual const std::array< SimplexId, 3 > & getGridDimensions() const
virtual int preconditionCellTriangles()
virtual bool isTriangleOnBoundary(const SimplexId &triangleId) const
virtual int preconditionTriangleLinks()
virtual SimplexId getVertexTriangleNumberInternal(const SimplexId &ttkNotUsed(vertexId)) const
bool hasPreconditionedBoundaryTriangles() const
bool hasPreconditionedCellNeighbors_
virtual const std::vector< std::vector< SimplexId > > * getVertexStars()
int getEdgeVertexNumber(const SimplexId ttkNotUsed(edgeId)) const
bool hasPreconditionedEdges_
virtual const std::vector< std::vector< SimplexId > > * getEdgeStars()
virtual int getTriangleLinkInternal(const SimplexId &ttkNotUsed(triangleId), const int &ttkNotUsed(localLinkId), SimplexId &ttkNotUsed(linkId)) const
virtual SimplexId getNumberOfEdgesInternal() const
virtual int preconditionEdgeLinksInternal()
bool hasPeriodicBoundaries_
virtual const std::vector< std::vector< SimplexId > > * getVertexLinks()
virtual int preconditionVertexStars()
bool hasPreconditionedVertexStars() const
virtual const std::vector< std::array< SimplexId, 2 > > * getEdgesInternal()
virtual const std::vector< std::vector< SimplexId > > * getVertexTriangles()
virtual int getTriangleStar(const SimplexId &triangleId, const int &localStarId, SimplexId &starId) const
virtual SimplexId getVertexNeighborNumber(const SimplexId &vertexId) const
bool hasPeriodicBoundaries() const
Returns true if the grid uses period boundary conditions.
virtual int getEdgeTriangle(const SimplexId &edgeId, const int &localTriangleId, SimplexId &triangleId) const
virtual const std::vector< std::vector< SimplexId > > * getTriangleEdgesInternal()
std::vector< std::array< SimplexId, 3 > > triangleList_
virtual int getCellEdgeInternal(const SimplexId &ttkNotUsed(cellId), const int &ttkNotUsed(localEdgeId), SimplexId &ttkNotUsed(edgeId)) const
virtual int getEdgeVertex(const SimplexId &edgeId, const int &localVertexId, SimplexId &vertexId) const
bool hasPreconditionedVertexLinks_
virtual int preconditionVertexEdges()
bool hasPreconditionedEdgeLinks_
virtual const std::vector< std::vector< SimplexId > > * getVertexStarsInternal()
virtual int preconditionBoundaryVertices()
bool hasPreconditionedEdgeLinks() const
bool hasPreconditionedCellTriangles() const
bool hasPreconditionedCellEdges() const
virtual int preconditionVertexNeighbors()
bool hasPreconditionedCellNeighbors() const
virtual int preconditionVertexTrianglesInternal()
virtual int getEdgeLinkInternal(const SimplexId &ttkNotUsed(edgeId), const int &ttkNotUsed(localLinkId), SimplexId &ttkNotUsed(linkId)) const
~AbstractTriangulation() override
virtual int preconditionEdgeLinks()
bool hasPreconditionedVertexNeighbors() const
AbstractTriangulation & operator=(AbstractTriangulation &&)=default
std::vector< bool > boundaryEdges_
bool hasPreconditionedVertexNeighbors_
virtual SimplexId getNumberOfVerticesInternal() const
virtual const std::vector< std::array< SimplexId, 2 > > * getEdges()
virtual bool isVertexOnBoundaryInternal(const SimplexId &ttkNotUsed(vertexId)) const
bool hasPreconditionedManifold() const
virtual int getTriangleEdge(const SimplexId &triangleId, const int &localEdgeId, SimplexId &edgeId) const
bool hasPreconditionedVertexEdges() const
bool hasPreconditionedManifold_
virtual SimplexId getTriangleLinkNumberInternal(const SimplexId &ttkNotUsed(triangleId)) const
virtual SimplexId getNumberOfCellsInternal() const
virtual int preconditionEdgeTriangles()
std::vector< bool > boundaryTriangles_
std::vector< std::array< SimplexId, 4 > > tetraTriangleList_
bool hasPreconditionedBoundaryTriangles_
int updateProgress(const float &ttkNotUsed(progress)) override
virtual SimplexId getTriangleLinkNumber(const SimplexId &triangleId) const
AbstractTriangulation & operator=(const AbstractTriangulation &)=default
bool hasPreconditionedVertexLinks() const
std::vector< std::vector< SimplexId > > triangleLinkList_
virtual int getTriangleStarInternal(const SimplexId &ttkNotUsed(triangleId), const int &ttkNotUsed(localStarId), SimplexId &ttkNotUsed(starId)) const
virtual bool isVertexOnBoundary(const SimplexId &vertexId) const
virtual bool isEmpty() const
virtual const std::vector< std::vector< SimplexId > > * getVertexEdgesInternal()
virtual const std::vector< std::vector< SimplexId > > * getTriangleLinks()
virtual SimplexId getCellEdgeNumber(const SimplexId &cellId) const
std::vector< std::vector< SimplexId > > vertexNeighborList_
bool hasPreconditionedTriangleStars_
std::vector< std::vector< SimplexId > > vertexLinkList_
virtual int getVertexTriangleInternal(const SimplexId &ttkNotUsed(vertexId), const int &ttkNotUsed(localTriangleId), SimplexId &ttkNotUsed(triangleId)) const
bool hasPreconditionedVertexTriangles() const
gradientCacheType * getGradientCacheHandler() const
virtual SimplexId getEdgeStarNumberInternal(const SimplexId &ttkNotUsed(edgeId)) const
virtual const std::vector< std::vector< SimplexId > > * getEdgeTrianglesInternal()
virtual bool isEdgeOnBoundary(const SimplexId &edgeId) const
virtual int getVertexNeighborInternal(const SimplexId &ttkNotUsed(vertexId), const int &ttkNotUsed(localNeighborId), SimplexId &ttkNotUsed(neighborId)) const
virtual int preconditionManifold()
virtual int getCellNeighborInternal(const SimplexId &ttkNotUsed(cellId), const int &ttkNotUsed(localNeighborId), SimplexId &ttkNotUsed(neighborId)) const
AbstractTriangulation(const AbstractTriangulation &)=default
virtual int preconditionTriangleStars()
virtual const std::vector< std::vector< SimplexId > > * getEdgeTriangles()
virtual SimplexId getCellVertexNumberInternal(const SimplexId &ttkNotUsed(cellId)) const
virtual int getCellVTKIDInternal(const int &ttkId, int &vtkId) const
virtual const std::vector< std::array< SimplexId, 3 > > * getTriangles()
virtual int getTriangleLink(const SimplexId &triangleId, const int &localLinkId, SimplexId &linkId) const
virtual const std::vector< std::array< SimplexId, 3 > > * getTrianglesInternal()
virtual SimplexId getEdgeLinkNumberInternal(const SimplexId &ttkNotUsed(edgeId)) const
virtual int getVertexPointInternal(const SimplexId &ttkNotUsed(vertexId), float &ttkNotUsed(x), float &ttkNotUsed(y), float &ttkNotUsed(z)) const
virtual int preconditionTriangleEdges()
virtual int preconditionVertexStarsInternal()
virtual const std::vector< std::vector< SimplexId > > * getEdgeLinks()
virtual int getTriangleVertexInternal(const SimplexId &ttkNotUsed(triangleId), const int &ttkNotUsed(localVertexId), SimplexId &ttkNotUsed(vertexId)) const
std::vector< std::vector< SimplexId > > edgeLinkList_
virtual int getVertexLinkInternal(const SimplexId &ttkNotUsed(vertexId), const int &ttkNotUsed(localLinkId), SimplexId &ttkNotUsed(linkId)) const
std::vector< bool > boundaryVertices_
std::vector< std::vector< SimplexId > > vertexEdgeList_
virtual int preconditionEdges()
std::vector< std::vector< SimplexId > > triangleEdgeVector_
std::vector< std::vector< SimplexId > > triangleStarList_
virtual SimplexId getNumberOfCells() const
virtual SimplexId getCellTriangleNumber(const SimplexId &cellId) const
virtual SimplexId getNumberOfVertices() const
virtual int preconditionTrianglesInternal()
virtual SimplexId getVertexNeighborNumberInternal(const SimplexId &ttkNotUsed(vertexId)) const
virtual int preconditionVertexNeighborsInternal()
virtual SimplexId getNumberOfTrianglesInternal() const
virtual int getEdgeStarInternal(const SimplexId &ttkNotUsed(edgeId), const int &ttkNotUsed(localStarId), SimplexId &ttkNotUsed(starId)) const
virtual int preconditionEdgesInternal()
virtual SimplexId getCellNeighborNumber(const SimplexId &cellId) const
bool hasPreconditionedTriangleEdges() const
bool hasPreconditionedTriangles() const
virtual int getDimensionality() const
virtual int getCellEdge(const SimplexId &cellId, const int &localEdgeId, SimplexId &edgeId) const
virtual int getEdgeStar(const SimplexId &edgeId, const int &localStarId, SimplexId &starId) const
virtual int getVertexNeighbor(const SimplexId &vertexId, const int &localNeighborId, SimplexId &neighborId) const
virtual SimplexId getCellEdgeNumberInternal(const SimplexId &ttkNotUsed(cellId)) const
std::vector< std::vector< SimplexId > > cellNeighborList_
virtual SimplexId getEdgeLinkNumber(const SimplexId &edgeId) const
bool hasPreconditionedEdgeStars() const
virtual const std::vector< std::vector< SimplexId > > * getVertexEdges()
virtual int preconditionTriangleStarsInternal()
bool hasPreconditionedVertexStars_
virtual const std::vector< std::vector< SimplexId > > * getCellTrianglesInternal()
virtual bool isTriangleOnBoundaryInternal(const SimplexId &ttkNotUsed(triangleId)) const
virtual int preconditionCellEdgesInternal()
virtual int getCellTriangleInternal(const SimplexId &ttkNotUsed(cellId), const int &ttkNotUsed(localTriangleId), SimplexId &ttkNotUsed(triangleId)) const
virtual int preconditionVertexTriangles()
bool hasPreconditionedEdges() const
virtual int getVertexStar(const SimplexId &vertexId, const int &localStarId, SimplexId &starId) const
virtual SimplexId getTriangleStarNumber(const SimplexId &triangleId) const
std::vector< std::array< SimplexId, 2 > > edgeList_
virtual int getCellVertex(const SimplexId &cellId, const int &localVertexId, SimplexId &vertexId) const
virtual int preconditionCellNeighborsInternal()
virtual SimplexId getCellVertexNumber(const SimplexId &cellId) const
int getTriangleIncenter(const SimplexId triangleId, float incenter[3]) const
virtual int preconditionCellTrianglesInternal()
bool hasPreconditionedBoundaryVertices() const
virtual const std::vector< std::vector< SimplexId > > * getTriangleStars()
virtual const std::vector< std::vector< SimplexId > > * getTriangleLinksInternal()
virtual SimplexId getVertexLinkNumberInternal(const SimplexId &ttkNotUsed(vertexId)) const
std::vector< std::array< SimplexId, 6 > > tetraEdgeList_
std::array< SimplexId, 3 > gridDimensions_
virtual SimplexId getVertexStarNumberInternal(const SimplexId &ttkNotUsed(vertexId)) const
std::vector< std::vector< SimplexId > > edgeStarList_
virtual const std::vector< std::vector< SimplexId > > * getVertexTrianglesInternal()
virtual SimplexId getNumberOfTriangles() const
size_t tableFootprint(const std::vector< itemType > &table, const std::string &tableName="", std::ostream &stream=std::cout) const
virtual int getTriangleVertex(const SimplexId &triangleId, const int &localVertexId, SimplexId &vertexId) const
virtual int getTriangleEdgeInternal(const SimplexId &ttkNotUsed(triangleId), const int &ttkNotUsed(localEdgeId), SimplexId &ttkNotUsed(edgeId)) const
gradientCacheType gradientCache_
virtual int preconditionTriangleEdgesInternal()
virtual SimplexId getVertexStarNumber(const SimplexId &vertexId) const
virtual int getCellVTKID(const int &ttkId, int &vtkId) const
virtual SimplexId getCellTriangleNumberInternal(const SimplexId &ttkNotUsed(cellId)) const
virtual SimplexId getCellNeighborNumberInternal(const SimplexId &ttkNotUsed(cellId)) const
virtual SimplexId getEdgeTriangleNumberInternal(const SimplexId &ttkNotUsed(edgeId)) const
bool hasPreconditionedTriangleStars() const
virtual int preconditionBoundaryTrianglesInternal()
virtual bool isEdgeOnBoundaryInternal(const SimplexId &ttkNotUsed(edgeId)) const
int getTriangleVertexNumber(const SimplexId ttkNotUsed(triangleId)) const
virtual int preconditionTriangles()
virtual int getEdgeTriangleInternal(const SimplexId &ttkNotUsed(edgeId), const int &ttkNotUsed(localTriangleId), SimplexId &ttkNotUsed(triangleId)) const
int getEdgeIncenter(const SimplexId edgeId, float incenter[3]) const
virtual int getCellTriangle(const SimplexId &cellId, const int &localTriangleId, SimplexId &triangleId) const
virtual const std::vector< std::vector< SimplexId > > * getTriangleEdges()
virtual const std::vector< std::vector< SimplexId > > * getEdgeStarsInternal()
virtual int preconditionBoundaryTriangles()
virtual int preconditionCellNeighbors()
bool needsToAbort() override
virtual int getVertexEdgeInternal(const SimplexId &ttkNotUsed(vertexId), const int &ttkNotUsed(localEdgeId), SimplexId &ttkNotUsed(edgeId)) const
virtual SimplexId getVertexLinkNumber(const SimplexId &vertexId) const
virtual const std::vector< std::vector< SimplexId > > * getVertexLinksInternal()
virtual SimplexId getVertexEdgeNumber(const SimplexId &vertexId) const
bool hasPreconditionedTriangleEdges_
virtual int preconditionEdgeTrianglesInternal()
virtual SimplexId getTriangleEdgeNumberInternal(const SimplexId &ttkNotUsed(triangleId)) const
std::array< std::vector< gradIdType >, 6 > gradientType
Discrete gradient internal struct.
bool hasPreconditionedCellTriangles_
std::vector< std::vector< SimplexId > > vertexTriangleList_
bool hasPreconditionedTriangles_
virtual SimplexId getNumberOfEdges() const
virtual bool isManifold() const
std::vector< std::vector< SimplexId > > cellEdgeVector_
bool hasPreconditionedVertexTriangles_
bool hasPreconditionedTriangleLinks() const
size_t footprint(size_t size=0) const
std::vector< std::vector< SimplexId > > cellTriangleVector_
size_t tableTableFootprint(const std::vector< std::vector< itemType > > &table, const std::string &tableName="", std::ostream &stream=std::cout) const
virtual int preconditionCellEdges()
bool hasPreconditionedVertexEdges_
bool hasPreconditionedEdgeStars_
virtual const std::vector< std::vector< SimplexId > > * getCellTriangles()
bool hasPreconditionedEdgeTriangles() const
int getTetraIncenter(const SimplexId tetraId, float incenter[3]) const
virtual const std::vector< std::vector< SimplexId > > * getTriangleStarsInternal()
virtual SimplexId getTriangleEdgeNumber(const SimplexId &triangleId) const
bool hasPreconditionedTriangleLinks_
virtual int preconditionBoundaryVerticesInternal()
virtual int preconditionManifoldInternal()
virtual int getCellNeighbor(const SimplexId &cellId, const int &localNeighborId, SimplexId &neighborId) const
virtual int preconditionBoundaryEdgesInternal()
virtual const std::vector< std::vector< SimplexId > > * getVertexNeighborsInternal()
virtual int preconditionVertexLinks()
virtual int preconditionVertexEdgesInternal()
virtual int getVertexLink(const SimplexId &vertexId, const int &localLinkId, SimplexId &linkId) const
std::vector< std::array< SimplexId, 3 > > triangleEdgeList_
virtual int getVertexStarInternal(const SimplexId &ttkNotUsed(vertexId), const int &ttkNotUsed(localStarId), SimplexId &ttkNotUsed(starId)) const
virtual int preconditionEdgeStarsInternal()
virtual SimplexId getEdgeStarNumber(const SimplexId &edgeId) const
virtual int getCellVertexInternal(const SimplexId &ttkNotUsed(cellId), const int &ttkNotUsed(localVertexId), SimplexId &ttkNotUsed(vertexId)) const
std::vector< std::vector< SimplexId > > edgeTriangleList_
bool hasPreconditionedBoundaryEdges() const
virtual const std::vector< std::vector< SimplexId > > * getEdgeLinksInternal()
virtual SimplexId getTriangleStarNumberInternal(const SimplexId &ttkNotUsed(triangleId)) const
virtual const std::vector< std::vector< SimplexId > > * getCellEdges()
AbstractTriangulation(AbstractTriangulation &&)=default
virtual int getDimensionalityInternal() const
int printErr(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
Wrapper class to wrap ttk code.
TTK discreteGradient processing package.
T distance(const T *p0, const T *p1, const int &dimension=3)
int SimplexId
Identifier type for simplices of any dimension.
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)