21 std::vector<SimplexId> numberOfCells(numberOfDimensions);
22 for(
int i = 0; i < numberOfDimensions; ++i) {
27#ifdef TTK_ENABLE_OPENMP
28#pragma omp parallel master num_threads(threadNumber_)
32#ifdef TTK_ENABLE_OPENMP
36 (*gradient_)[2 * i].clear();
37 (*gradient_)[2 * i].resize(numberOfCells[i], -1);
39#ifdef TTK_ENABLE_OPENMP
43 (*gradient_)[2 * i + 1].clear();
44 (*gradient_)[2 * i + 1].resize(numberOfCells[i + 1], -1);
49 std::vector<std::vector<std::string>> rows{
50 {
"#Vertices", std::to_string(numberOfCells[0])},
51 {
"#Edges", std::to_string(numberOfCells[1])},
56 std::vector<std::string>{
"#Triangles", std::to_string(numberOfCells[2])});
61 std::vector<std::string>{
"#Tetras", std::to_string(numberOfCells[3])});
65 this->
printMsg(
"Initialized discrete gradient memory", 1.0,
66 tm.getElapsedTime(), this->threadNumber_);
69std::pair<size_t, SimplexId>
70 DiscreteGradient::numUnpairedFaces(
const CellExt &c,
71 const lowerStarType &ls)
const {
74 return numUnpairedFacesTriangle(c, ls);
75 }
else if(c.
dim_ == 3) {
76 return numUnpairedFacesTetra(c, ls);
82std::pair<size_t, SimplexId>
83 DiscreteGradient::numUnpairedFacesTriangle(
const CellExt &c,
84 const lowerStarType &ls)
const {
86 std::pair<size_t, SimplexId> res{0, -1};
90 for(
size_t i = 0; i < 2; ++i) {
91 if(!ls[1][c.
faces_[i]].paired_) {
100std::pair<size_t, SimplexId>
101 DiscreteGradient::numUnpairedFacesTetra(
const CellExt &c,
102 const lowerStarType &ls)
const {
104 std::pair<size_t, SimplexId> res{0, -1};
107 for(
const auto f : c.faces_) {
108 if(!ls[2][f].paired_) {
118 DiscreteGradient::criticalTypeFromCellDimension(
const int dim)
const {
121 }
else if(dim == 1) {
177 if(cellDim > this->dimensionality_) {
209 const std::array<std::vector<SimplexId>, 4> &criticalCellsByDim,
210 const SimplexId *
const ascendingManifold,
211 const SimplexId *
const descendingManifold,
212 std::vector<SimplexId> &manifoldSize)
const {
214 const auto nCritPoints{
215 criticalCellsByDim[0].size() + criticalCellsByDim[1].size()
216 + criticalCellsByDim[2].size() + criticalCellsByDim[3].size()};
218 const auto dim{this->dimensionality_};
221 || (criticalCellsByDim[0].empty() && criticalCellsByDim[dim].empty())) {
226 manifoldSize.resize(nCritPoints, 0);
229 if(!criticalCellsByDim[0].empty()) {
231 if(descendingManifold[i] != -1) {
232 manifoldSize[descendingManifold[i]]++;
237 if(!criticalCellsByDim[dim].empty()) {
239 const auto nFirstMaximum{nCritPoints - criticalCellsByDim[dim].size()};
243 if(ascendingManifold[i] != -1) {
244 manifoldSize[ascendingManifold[i] + nFirstMaximum]++;
253void DiscreteGradient::setCellToGhost(
const int cellDim,
AbstractTriangulation is an interface class that defines an interface for efficient traversal methods...
bool isMinimum(const Cell &cell) const
bool isSaddle1(const Cell &cell) const
bool isMaximum(const Cell &cell) const
bool isSaddle2(const Cell &cell) const
int setManifoldSize(const std::array< std::vector< SimplexId >, 4 > &criticalCellsByDim, const SimplexId *const ascendingManifold, const SimplexId *const descendingManifold, std::vector< SimplexId > &manifoldSize) const
SimplexId getNumberOfCells(const int dimension, const triangulationType &triangulation) const
SimplexId numberOfVertices_
bool isCellCritical(const int cellDim, const SimplexId cellId) const
int getDimensionality() const
int getNumberOfDimensions() const
AbstractTriangulation::gradientType * gradient_
CriticalType
default value for critical index
int SimplexId
Identifier type for simplices of any dimension.
Extended Cell structure for processLowerStars.
const std::array< uint8_t, 3 > faces_
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)