Skip to content

Feature: SFC-Based Tree Indexing - #2324

Open
tunxu wants to merge 32 commits into
mainfrom
feature-tree_reindexing
Open

tunxu wants to merge 32 commits into
mainfrom
feature-tree_reindexing

Conversation

@tunxu

@tunxu tunxu commented May 15, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #2325

Describe your changes here:

All these boxes must be checked by the AUTHOR before requesting review:

  • The PR is small enough to be reviewed easily. If not, consider splitting up the changes in multiple PRs.
  • The title starts with one of the following prefixes: Documentation:, Bugfix:, Feature:, Improvement: or Other:.
  • If the PR is related to an issue, make sure to link it.
  • The author made sure that, as a reviewer, he/she would check all boxes below.

All these boxes must be checked by the REVIEWERS before merging the pull request:

As a reviewer please read through all the code lines and make sure that the code is fully understood, bug free, well-documented and well-structured.

General

  • The reviewer executed the new code features at least once and checked the results manually.
  • The code follows the t8code coding guidelines.
  • New source/header files are properly added to the CMake files.
  • The code is well documented. In particular, all function declarations, structs/classes and their members have a proper doxygen documentation. Make sure to add a file documentation for each file!
  • All new algorithms and data structures are sufficiently optimal in terms of memory and runtime (If this should be merged, but there is still potential for optimization, create a new issue).

Tests

  • The code is covered in an existing or new test case using Google Test.
  • The code coverage of the project (reported in the CI) should not decrease. If coverage is decreased, make sure that this is reasonable and acceptable.
  • Valgrind doesn't find any bugs in the new code. This script can be used to check for errors; see also this wiki article.

If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):

  • Should this use case be added to the github action?
  • If not, does the specific use case compile and all tests pass (check manually).

Scripts and Wiki

  • If a new directory with source files is added, it must be covered by the scripts/internal/find_all_source_files.sh to check the indentation of these files.
  • If this PR introduces a new feature, it must be covered in an example or tutorial and a Wiki article.

License

  • The author added a BSD statement to doc/ (or already has one).

@tunxu tunxu changed the title initial Commit Feature: SFC-Based Tree Indexing Jun 15, 2026
@tunxu tunxu self-assigned this Sep 23, 2026
@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.47853% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.95%. Comparing base (bfc4e39) to head (095a340).
⚠️ Report is 211 commits behind head on main.

Files with missing lines Patch % Lines
..._cmesh/t8_cmesh_internal/t8_cmesh_tree_reindex.cxx 94.30% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2324      +/-   ##
==========================================
+ Coverage   82.65%   82.95%   +0.30%     
==========================================
  Files         132      140       +8     
  Lines       21515    21747     +232     
==========================================
+ Hits        17783    18040     +257     
+ Misses       3732     3707      -25     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tunxu
tunxu marked this pull request as ready for review September 23, 2026 13:53
Comment thread src/t8_cmesh/t8_cmesh_internal/t8_cmesh_tree_reindex.cxx Outdated
Comment thread src/t8_cmesh/t8_cmesh_internal/t8_cmesh_tree_reindex.cxx Outdated
t8_cmesh_t bbox_cmesh;
t8_cmesh_init (&bbox_cmesh);

std::vector<double> vertices

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::array

Comment thread src/t8_cmesh/t8_cmesh_internal/t8_cmesh_tree_reindex.cxx Outdated
Comment thread src/t8_cmesh/t8_cmesh_internal/t8_cmesh_tree_reindex.cxx Outdated

t8_forest_element_points_inside (forest_new, which_tree, new_element, point_coords.data (),
static_cast<int> (old_element_data.midpoints.size ()), point_inside.data (),
0.0f);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
0.0f);
0);

Comment on lines +200 to +201

t8_debugf ("starting tree reindexing\n");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
t8_debugf ("starting tree reindexing\n");

t8_cmesh_reindex_tree (t8_cmesh_t cmesh, sc_MPI_Comm comm)
{
std::map<t8_gloidx_t, t8_gloidx_t> tree_reindex;
std::vector<double> flat_vertices;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is never used

Comment on lines +252 to +257
t8_debugf ("Computed center for global tree %li: %f, %f, %.f\n", attr->id, center[0], center[1], center[2]);
}

t8_debugf ("received local cmesh bounding box\n");
t8_debugf ("physical bbox bounds: x=[%.17g, %.17g], y=[%.17g, %.17g], z=[%.17g, %.17g]\n", min_coords[0],
max_coords[0], min_coords[1], max_coords[1], min_coords[2], max_coords[2]);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
t8_debugf ("Computed center for global tree %li: %f, %f, %.f\n", attr->id, center[0], center[1], center[2]);
}
t8_debugf ("received local cmesh bounding box\n");
t8_debugf ("physical bbox bounds: x=[%.17g, %.17g], y=[%.17g, %.17g], z=[%.17g, %.17g]\n", min_coords[0],
max_coords[0], min_coords[1], max_coords[1], min_coords[2], max_coords[2]);
}

const double dy = max_coords[1] - min_coords[1];
const double dz = max_coords[2] - min_coords[2];

const double eps = T8_PRECISION_SQRT_EPS;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const double eps = T8_PRECISION_SQRT_EPS;
constexpr double eps = T8_PRECISION_SQRT_EPS;

@tunxu
tunxu requested a review from sandro-elsweijer October 8, 2026 07:45

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: SFC-Based Tree Indexing

2 participants