Uh oh!
There was an error while loading. Please reload this page.
FEAT: Add mesh properties, fail on mismatched meshes - #2848
FEAT: Add mesh properties, fail on mismatched meshes#2848VeckoTheGecko wants to merge 9 commits into
mesh properties, fail on mismatched meshes#2848Conversation
if you have capacity @wyatt-fluidnumerics , it would be great to have your review |
mesh properties, and fail on mismatched meshesmesh properties, fail on mismatched meshes| def __init__(self, models: list[ModelData]): | ||
| if models == []: | ||
| raise ValueError("List of models can't be empty.") |
There was a problem hiding this comment.
With this change we can't have fieldsets with only constant fields (which is very reasonable), since that would result in an ambigious fieldset mesh.
Hence I also removed test_fieldset_time_interval_constant_fields
There was a problem hiding this comment.
I realise now that our docs relied on "empty, constant only" fieldsets.
docs/user_guide/examples/tutorial_interaction.ipynb
I assume that you wrote this @erikvansebille . I'll postpone merging, and leave this open until you're back
There was a problem hiding this comment.
Actually, I think there are use cases where we have empty fieldsets - like indeed in the particle-particle interaction tutorial. If users want to use parcels as an Agent-Based-Model engine, they typically don't have/use Fields.
How problematic is it to support empty fieldsets? Perhaps we should change the interaction-tutorial to not have any fields at all (instead of only constant fields)? Or will that be a major endeavour (for another PR)?
There was a problem hiding this comment.
If users want to use parcels as an Agent-Based-Model engine, they typically don't have/use Fields.
I'm not quite sure I understand this - I feel that this is scope creep for the project. Why would users want to use Parcels as an engine for agent based modelling? (instead of other libraries in Python for this)
There was a problem hiding this comment.
OK, you're right that this may be project scope creep. But what do we do then about the particle-particle interaction tutorial? That just needs a flat Field with a constant value for diffusivity everywhere
There was a problem hiding this comment.
Perhaps we can recontextualize it in the context of FADs or a usecase with flow fields? Or just add an grid with no attached data to show off the interactivity, and mention that you would want to specify the flow fields yourself as well.
Would you like to work on a diff or would you like me to?
There was a problem hiding this comment.
I just pushed 2bd7bf7 - which now uses a very simple UV dataset. Hope this fixes the issue
There was a problem hiding this comment.
That seems to have worked
wyatt-fluidnumerics
left a comment
There was a problem hiding this comment.
This all looks great to me. I think this would also be a good time to remove the mesh argument from add_constant_field like you mentioned in the original issue.
VeckoTheGecko
commented
Aug 25, 2026
Yeah sure, I can wrap that into here :) |
Actually, I remember why I didn't - I wanted to do it after #2845 as that would make things easier (I also wanted to expand testing for Separate PR would be better I think |
erikvansebille
left a comment
There was a problem hiding this comment.
Looks good - except that I think we should support empty FieldSets. but that could perhaps be annother PR? See below
| def __init__(self, models: list[ModelData]): | ||
| if models == []: | ||
| raise ValueError("List of models can't be empty.") |
There was a problem hiding this comment.
Actually, I think there are use cases where we have empty fieldsets - like indeed in the particle-particle interaction tutorial. If users want to use parcels as an Agent-Based-Model engine, they typically don't have/use Fields.
How problematic is it to support empty fieldsets? Perhaps we should change the interaction-tutorial to not have any fields at all (instead of only constant fields)? Or will that be a major endeavour (for another PR)?
VeckoTheGecko
commented
Sep 2, 2026
OK - running into a separate (unrelated) problem surfaced by this change which I think runs deeper...
This is in lon/lat space, so I updated to use Adapting the plot I was able to find the grid search failure locations ![]() Using an LLM it was talking about there being a bug in the point-in-cell check, but to be honest I don't know how accurate that is. LLM outputSpherical UxGrid search fails for large trianglesWhen using Bug 1: SpatialHash Cartesian bounding box too tight
Suggested fix: Include great-circle edge midpoints (average vertex Cartesian coords, renormalize to unit sphere) in the bounding box computation. Bug 2: |

Description
Changes:
ModelDatabase classassert_models_have_same_mesh(which raisesIncompatibleMeshesException)Checklist
mainfor normal development,v3-supportfor v3 support)AI Disclosure
None used