Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature coordinates canonicalize #336

Merged
merged 20 commits into from
Feb 7, 2025

Conversation

cburstedde
Copy link
Owner

Add function to uniquify coordinates at tree boundaries

Add p4est_connectivity_coordinates_canonicalize.

Proposed changes

Quadrant coordinates are in the tree reference, basically an integer cube from the origin to P4EST_MAXLEVEL.
At a tree boundary, multiple tree coordinate systems may meet which lead to different coordinates for the same topological point in the mesh. We add a function to impose a canonical convention and transformation of any (coordinate, tree) pair such that it becomes unique across all touching trees.

We add some minor cleanup of documentation and tests along the way.

This function makes a coordinate tuple and its origin tree index unique
by, if on a tree boundary and touching a lower-numbered-tree, returning
the lowest-numbered such tree and transforming the coordinates to it.
The function p4est_coordinates_canonicalize is changed to work out-of-place.
It takes separate input and output arguments.

We begin implementing it based on code of p4est_node_canonicalize.
Reinstate the usual way of including p4est_to_p8est and in the next line
the corresponding p4est .c file.  We needed to add a static prototype.
While at it, we remove some redundancy between the 2D and 3D files by
including common dimension-independent code of the 2D file for 3D.
mkirilin
mkirilin previously approved these changes Feb 7, 2025
@cburstedde
Copy link
Owner Author

Thanks for the review!

@cburstedde cburstedde force-pushed the feature-coordinates-canonicalize branch from e2d714c to c49e9c8 Compare February 7, 2025 16:49
@cburstedde cburstedde force-pushed the feature-coordinates-canonicalize branch from 414c3c9 to 082bea2 Compare February 7, 2025 16:58
@cburstedde cburstedde merged commit e6c965a into develop Feb 7, 2025
24 checks passed
@cburstedde cburstedde deleted the feature-coordinates-canonicalize branch February 7, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants