Skip to content

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

Merged
fluidnumericsJoe merged 8 commits intomainfrom
documentation/developer-notes-spatial-hashing
Mar 5, 2026
Merged

Documentation: Developer notes - unstructured grid spatial hashing documentation#2522
fluidnumericsJoe merged 8 commits intomainfrom
documentation/developer-notes-spatial-hashing

Conversation

@fluidnumericsJoe
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 ?

@fluidnumericsJoe
Copy link
Copy Markdown
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

@fluidnumericsJoe
Copy link
Copy Markdown
Contributor Author

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

@fluidnumericsJoe fluidnumericsJoe marked this pull request as ready for review March 3, 2026 23:49
@fluidnumericsJoe fluidnumericsJoe changed the title [DRAFT] Documentation: Developer notes - unstructured grid spatial hashing documentation Documentation: Developer notes - unstructured grid spatial hashing documentation Mar 3, 2026
@fluidnumericsJoe fluidnumericsJoe merged commit c5f6ff6 into main Mar 5, 2026
15 checks passed
@fluidnumericsJoe fluidnumericsJoe deleted the documentation/developer-notes-spatial-hashing branch March 5, 2026 20:12
@github-project-automation github-project-automation bot moved this from Backlog to Done in Parcels development Mar 5, 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: Done

Development

Successfully merging this pull request may close these issues.

3 participants