Skip to content

Documentation: Developer notes - unstructured grid spatial hashing documentation#2522

Open
fluidnumerics-joe wants to merge 6 commits intomainfrom
documentation/developer-notes-spatial-hashing
Open

Documentation: Developer notes - unstructured grid spatial hashing documentation#2522
fluidnumerics-joe wants to merge 6 commits intomainfrom
documentation/developer-notes-spatial-hashing

Conversation

@fluidnumerics-joe
Copy link
Contributor

This PR adds a "Developer Notes" section to the Development page. In this section, I've added documentation that adds some more detailed descriptions of the spatial hashing algorithm.

Copy link
Member

@erikvansebille erikvansebille left a comment

Choose a reason for hiding this comment

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

Very nice write-up, @fluidnumerics-joe! Even though this is a draft, I already provided some feedback that I noted as I was reading through (because I was so curious).


4. **Gather candidates.** For each query with a valid hit, use `starts[pos]` and `counts[pos]` to gather the candidate face indices `(j_all, i_all)` from the sorted arrays. This is done fully vectorised using a CSR traversal with `np.repeat` and cumulative sums.

5. **Point-in-cell test.** Call `self._point_in_cell` (either `curvilinear_point_in_cell` or `uxgrid_point_in_cell`) on all candidates simultaneously. The first candidate per query that passes is taken as the result.
Copy link
Member

Choose a reason for hiding this comment

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

Should we rename curvilinear_point_in_cell to xgrid_point_in_cell, to keep the symmetry between the two types of grids?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

xgrid's can also be rectilinear, but we don't leverage the point in cell checks for rectilinear grids. I'm not necessarily opposed to a name change, so long as docstrings indicate clearly the intention of the function to be used on curvilinear grids. What do you think @VeckoTheGecko ?

@fluidnumerics-joe
Copy link
Contributor Author

@erikvansebille - I'll leave the comments/suggestions as unresolved. If it looks like I've addressed them, please mark them resolved. Otherwise, additional feedback is welcome

@fluidnumerics-joe
Copy link
Contributor Author

It's not clear to me why the unit tests are suddenly failing while all I've changed are docs..

@fluidnumerics-joe fluidnumerics-joe marked this pull request as ready for review March 3, 2026 23:49
@fluidnumerics-joe fluidnumerics-joe changed the title [DRAFT] Documentation: Developer notes - unstructured grid spatial hashing documentation Documentation: Developer notes - unstructured grid spatial hashing documentation Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation unstructured grids Development of unstructured grids support

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants