Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2324 +/- ##
==========================================
+ Coverage 83.04% 83.24% +0.20%
==========================================
Files 148 149 +1
Lines 22153 22395 +242
==========================================
+ Hits 18396 18642 +246
+ Misses 3757 3753 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| t8_cmesh_t bbox_cmesh; | ||
| t8_cmesh_init (&bbox_cmesh); | ||
|
|
||
| std::vector<double> vertices |
|
|
||
| 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); |
There was a problem hiding this comment.
| 0.0f); | |
| 0); |
|
|
||
| t8_debugf ("starting tree reindexing\n"); |
There was a problem hiding this comment.
| 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; |
| 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]); |
There was a problem hiding this comment.
| 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; |
There was a problem hiding this comment.
| const double eps = T8_PRECISION_SQRT_EPS; | |
| constexpr double eps = T8_PRECISION_SQRT_EPS; |
| t8_locidx_t num_trees = class_entries->elem_count, ltree; | ||
|
|
||
| if (cmesh->reindex_trees) { | ||
| t8_cmesh_tree_perform_reindex_inplace (stash, t8_cmesh_reindex_tree (cmesh)); |
There was a problem hiding this comment.
With one function I meant more like
t8_cmesh_reindex_trees (cmesh);
| std::map<t8_gloidx_t, t8_gloidx_t> | ||
| t8_cmesh_reindex_tree (t8_cmesh_t cmesh, sc_MPI_Comm comm) | ||
| { | ||
| T8_ASSERT (cmesh != nullptr); |
There was a problem hiding this comment.
some more comments on what happens her would be nice. Like a comment at the start which describes the whole procedure and then more comments in the code which show which sections do what
| } | ||
|
|
||
| /* Non-empty leaves contain exactly one original tree ID at this point. */ | ||
| tree_reindex.emplace (element_data.tree_ids.front (), new_tree_index); |
There was a problem hiding this comment.
What happens when your element reaches maxlevels, but there are still multiple points in there? In this case your code only reindexes the first one and the rest is droppet. I suggest that all the trees in that element get the order they are already in. You could test this by two trees having the same center coordinate
|
|
||
| /* Determine which old tree centers lie in the current child element. */ | ||
| std::vector<int> point_inside (old_element_data.tree_centers.size (), 0); | ||
| t8_forest_element_points_inside (forest_new, which_tree, new_element, point_coordinates.data (), |
There was a problem hiding this comment.
I just saw, that tolerance 0 should not be used here. I suggest defining a tolerance in you data which is max_extent*T8_PRECISION_EPS. That points are handled twice is already solved by your implementation.
| t8_ax (tree_center, 1.0 / static_cast<double> (num_vertices)); | ||
| tree_to_center.emplace (attribute->id, tree_center); | ||
| } | ||
|
|
There was a problem hiding this comment.
Here would be a good place to check with SC_CHECK_ABORTF that the number of tree centers is the same as the number of eclasses in the stash. This algo only works if every tree has vertices in their attributes and this would be a quick way to check for that
Closes #2325
Describe your changes here:
All these boxes must be checked by the AUTHOR before requesting review:
Documentation:,Bugfix:,Feature:,Improvement:orOther:.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
Tests
If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):
Scripts and Wiki
scripts/internal/find_all_source_files.shto check the indentation of these files.License
doc/(or already has one).