Creating a Nested Grid Tutorial#2439
Merged
erikvansebille merged 13 commits intov4-devfrom Jan 6, 2026
Merged
Conversation
Using idealised flow fields
erikvansebille
commented
Dec 17, 2025
Contributor
There was a problem hiding this comment.
Very cool notebook, and so exciting to see this feature in v4! My comments are mostly considering the cases other people will use this feature for.
- When showing the velocity fields in rectangles with the Grid polygons in red, maybe add a note (admonition) discussing the case when the fields come from a nested model: the velocity fields would then be defined for the polygons only, and you would only need to pass the bounding coordinates?
- The triangulation function seems to be the core function that people will use (copy?) to set up their own nested fields. I was thinking about how to make this robust, maybe we can at least link to the documentation of the
trianglefunction used: https://rufat.be/triangle/delaunay.html - The
AdvectionEE_NestedGridswill also be used a lot I assume. The copying of the variables is not so bad, but maybe we should add the errorcodeTODOas a box to be checked to Refactor particleset attributes and particle data for vectorized kernels #2143? Alternatively, is there not a way to passparticles[mask]as a fifth argument?
After writing this I also think it is okay to fix some of these challenges once people start implementing their own nested setups in v4 and come with feedback.
Member
Author
Review suggestions by @reint-fischer
fluidnumerics-joe
approved these changes
Dec 19, 2025
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR creates a tutorial for how to do nesting in Parcels v4, using a combination of unstructured (for the nest localisation) and structured (for the hydrodynamic data) Fields.
It is different from #2436 in that it uses idealised flow fields, so can be run in CI