44 return std::tie(this->
dim_, this->
id_)
45 == std::tie(other.
dim_, other.
id_);
49 return '{' + std::to_string(this->
dim_) +
' '
50 + std::to_string(this->
id_) +
'}';
67 const std::array<SimplexId, 3> &lowVerts,
68 const std::array<uint8_t, 3> &faces)
78 const std::array<uint8_t, 3>
faces_{};
94 hasMPISupport_ =
true;
102 template <
typename triangulationType>
104 bool bypassCache =
false,
105 const std::vector<bool> *updateMask =
nullptr);
116 const size_t mTime) {
124 if(data !=
nullptr) {
138 }
else if(dim == 3) {
190 template <
typename triangulationType>
192 const triangulationType &triangulation)
const;
197 template <
typename triangulationType>
199 const triangulationType &triangulation)
const;
212 template <
typename triangulationType>
214 const triangulationType &triangulation,
215 bool isReverse =
false)
const;
220 template <
typename triangulationType>
222 std::vector<Cell> &vpath,
223 const triangulationType &triangulation,
224 const bool enableCycleDetector =
false)
const;
229 template <
typename triangulationType>
231 std::vector<Cell> &vpath,
232 const triangulationType &triangulation)
const;
238 template <
typename triangulationType>
241 const std::vector<bool> &isVisited,
242 std::vector<Cell> *
const vpath,
243 const triangulationType &triangulation,
244 const bool stopIfMultiConnected =
false,
245 const bool enableCycleDetector
252 template <
typename triangulationType>
255 const std::vector<bool> &isVisited,
256 std::vector<Cell> *
const vpath,
257 const triangulationType &triangulation,
258 const bool stopIfMultiConnected =
false,
259 const bool enableCycleDetector =
false,
260 bool *
const cycleFound =
nullptr)
const;
266 template <
typename triangulationType>
268 const triangulationType &triangulation)
const;
273 template <
typename triangulationType>
276 const triangulationType &triangulation,
277 std::vector<Cell> *
const wall =
nullptr,
278 std::vector<SimplexId> *
const saddles
284 template <
typename triangulationType>
287 const triangulationType &triangulation,
288 std::vector<Cell> *
const wall =
nullptr,
289 std::vector<SimplexId> *
const saddles
296 template <
typename triangulationType>
299 const triangulationType &triangulation)
const;
305 template <
typename triangulationType>
308 const triangulationType &triangulation)
const;
318 template <
typename triangulationType>
320 const std::array<std::vector<SimplexId>, 4> &criticalCellsByDim,
321 std::vector<std::array<float, 3>> &points,
322 std::vector<char> &cellDimensions,
323 std::vector<SimplexId> &cellIds,
324 std::vector<char> &isOnBoundary,
325 std::vector<SimplexId> &PLVertexIdentifiers,
326 const triangulationType &triangulation)
const;
332 template <
typename triangulationType>
334 std::vector<char> &cellDimensions,
335 std::vector<SimplexId> &cellIds,
336 std::vector<char> &isOnBoundary,
337 std::vector<SimplexId> &PLVertexIdentifiers,
338 const triangulationType &triangulation)
const;
343 template <
typename triangulationType>
345 std::array<std::vector<SimplexId>, 4> &criticalCellsByDim,
346 const triangulationType &triangulation)
const;
352 void setCellToGhost(
const int cellDim,
const SimplexId cellId);
359 const std::array<std::vector<SimplexId>, 4> &criticalCellsByDim,
360 const SimplexId *
const ascendingManifold,
361 const SimplexId *
const descendingManifold,
362 std::vector<SimplexId> &manifoldSize)
const;
367 template <
typename triangulationType>
369 std::vector<char> &points_pairOrigins,
370 std::vector<char> &cells_pairTypes,
371 std::vector<SimplexId> &cellsIds,
372 std::vector<char> &cellsDimensions,
373 const triangulationType &triangulation)
const;
379 using lowerStarType = std::array<std::vector<CellExt>, 4>;
390 template <
typename triangulationType>
391 inline void lowerStar(lowerStarType &ls,
394 const triangulationType &triangulation)
const;
405 template <
typename triangulationType>
406 inline void lowerStarWithMask(lowerStarType &ls,
409 const triangulationType &triangulation,
410 const std::vector<bool> *updateMask
422 std::pair<size_t, SimplexId>
423 numUnpairedFaces(
const CellExt &c,
const lowerStarType &ls)
const;
424 std::pair<size_t, SimplexId>
425 numUnpairedFacesTriangle(
const CellExt &c,
426 const lowerStarType &ls)
const;
427 std::pair<size_t, SimplexId>
428 numUnpairedFacesTetra(
const CellExt &c,
const lowerStarType &ls)
const;
434 CriticalType criticalTypeFromCellDimension(
const int dim)
const;
442 template <
typename triangulationType>
443 inline void pairCells(
CellExt &alpha,
445 const triangulationType &triangulation);
453 template <
typename triangulationType>
454 int processLowerStars(
const SimplexId *
const offsets,
455 const triangulationType &triangulation);
463 template <
typename triangulationType>
464 int processLowerStarsWithMask(
const SimplexId *
const offsets,
465 const triangulationType &triangulation,
466 const std::vector<bool> *updateMask
478 template <
typename dataType,
typename triangulationType>
481 const dataType *
const scalars,
482 const triangulationType &triangulation)
const;
511 template <
typename triangulationType>
513 const triangulationType &triangulation)
const;
518 template <
typename triangulationType>
520 const triangulationType &triangulation)
const;
525 template <
typename triangulationType>
527 const triangulationType &triangulation,
528 bool cancelReversal =
false)
const;
533 template <
typename triangulationType>
535 const std::vector<Cell> &vpath,
536 const triangulationType &triangulation)
const;
AbstractTriangulation is an interface class that defines an interface for efficient traversal methods...
virtual int preconditionEdgeStars()
std::pair< const void *, size_t > gradientKeyType
Key type for gradientCacheType.
virtual int preconditionBoundaryEdges()
virtual int preconditionCellTriangles()
virtual int preconditionVertexStars()
virtual int preconditionVertexEdges()
virtual int preconditionBoundaryVertices()
virtual int preconditionVertexNeighbors()
virtual int preconditionEdgeTriangles()
virtual int preconditionTriangleStars()
virtual int preconditionTriangleEdges()
virtual int preconditionEdges()
virtual int getDimensionality() const
virtual int preconditionVertexTriangles()
gradientCacheType gradientCache_
virtual int preconditionTriangles()
virtual int preconditionBoundaryTriangles()
std::array< std::vector< gradIdType >, 6 > gradientType
Discrete gradient internal struct.
virtual int preconditionCellEdges()
Minimalist debugging class.
void setDebugMsgPrefix(const std::string &prefix)
TTK discreteGradient processing package.
SimplexId getCellLowerVertex(const Cell c, const triangulationType &triangulation) const
int reverseAscendingPath(const std::vector< Cell > &vpath, const triangulationType &triangulation) const
bool isMinimum(const Cell &cell) const
void setInputOffsets(const SimplexId *const data)
int reverseDescendingPath(const std::vector< Cell > &vpath, const triangulationType &triangulation) const
int setGradientGlyphs(std::vector< std::array< float, 3 > > &points, std::vector< char > &points_pairOrigins, std::vector< char > &cells_pairTypes, std::vector< SimplexId > &cellsIds, std::vector< char > &cellsDimensions, const triangulationType &triangulation) const
int reverseAscendingPathOnWall(const std::vector< Cell > &vpath, const triangulationType &triangulation, bool cancelReversal=false) const
bool getDescendingPathThroughWall(const Cell &saddle2, const Cell &saddle1, const std::vector< bool > &isVisited, std::vector< Cell > *const vpath, const triangulationType &triangulation, const bool stopIfMultiConnected=false, const bool enableCycleDetector=false) const
bool isSaddle1(const Cell &cell) const
bool isMaximum(const Cell &cell) const
bool isSaddle2(const Cell &cell) const
AbstractTriangulation::gradientKeyType inputScalarField_
int setManifoldSize(const std::array< std::vector< SimplexId >, 4 > &criticalCellsByDim, const SimplexId *const ascendingManifold, const SimplexId *const descendingManifold, std::vector< SimplexId > &manifoldSize) const
void setInputScalarField(const void *const data, const size_t mTime)
SimplexId getNumberOfCells(const int dimension, const triangulationType &triangulation) const
void setLocalGradient()
Use local storage instead of cache.
SimplexId numberOfVertices_
bool isBoundary(const Cell &cell, const triangulationType &triangulation) const
bool isCellCritical(const int cellDim, const SimplexId cellId) const
SimplexId getPairedCell(const Cell &cell, const triangulationType &triangulation, bool isReverse=false) const
int getAscendingWall(const Cell &cell, VisitedMask &mask, const triangulationType &triangulation, std::vector< Cell > *const wall=nullptr, std::vector< SimplexId > *const saddles=nullptr) const
int reverseDescendingPathOnWall(const std::vector< Cell > &vpath, const triangulationType &triangulation) const
SimplexId getCellGreaterVertex(const Cell c, const triangulationType &triangulation) const
int getCriticalPoints(std::array< std::vector< SimplexId >, 4 > &criticalCellsByDim, const triangulationType &triangulation) const
int buildGradient(const triangulationType &triangulation, bool bypassCache=false, const std::vector< bool > *updateMask=nullptr)
static void clearCache(const AbstractTriangulation &triangulation)
bool getAscendingPathThroughWall(const Cell &saddle1, const Cell &saddle2, const std::vector< bool > &isVisited, std::vector< Cell > *const vpath, const triangulationType &triangulation, const bool stopIfMultiConnected=false, const bool enableCycleDetector=false, bool *const cycleFound=nullptr) const
void preconditionTriangulation(AbstractTriangulation *const data)
dataType getPersistence(const Cell &up, const Cell &down, const dataType *const scalars, const triangulationType &triangulation) const
int setCriticalPoints(const std::array< std::vector< SimplexId >, 4 > &criticalCellsByDim, std::vector< std::array< float, 3 > > &points, std::vector< char > &cellDimensions, std::vector< SimplexId > &cellIds, std::vector< char > &isOnBoundary, std::vector< SimplexId > &PLVertexIdentifiers, const triangulationType &triangulation) const
int getDimensionality() const
int getDescendingPath(const Cell &cell, std::vector< Cell > &vpath, const triangulationType &triangulation) const
bool detectGradientCycle(const Cell &cell, const triangulationType &triangulation) const
int getAscendingPath(const Cell &cell, std::vector< Cell > &vpath, const triangulationType &triangulation, const bool enableCycleDetector=false) const
AbstractTriangulation::gradientType localGradient_
int getNumberOfDimensions() const
int getDescendingWall(const Cell &cell, VisitedMask &mask, const triangulationType &triangulation, std::vector< Cell > *const wall=nullptr, std::vector< SimplexId > *const saddles=nullptr) const
AbstractTriangulation::gradientType * gradient_
const SimplexId * inputOffsets_
CriticalType
default value for critical index
int SimplexId
Identifier type for simplices of any dimension.
Auto-cleaning re-usable graph propagations data structure.
Extended Cell structure for processLowerStars.
CellExt(const int dim, const SimplexId id, const std::array< SimplexId, 3 > &lowVerts, const std::array< uint8_t, 3 > &faces)
CellExt(const int dim, const SimplexId id)
const std::array< SimplexId, 3 > lowVerts_
const std::array< uint8_t, 3 > faces_
std::string to_string() const
bool operator==(const Cell &other) const
Cell(const int dim, const SimplexId id)