ELPHE-WW / unstructured-mesh-parcels-sandbox

A sandbox repository to draft unstructured mesh IO, connectivity & neighbor search methods, and interpolation schemes.
1 stars 0 forks source link

Consider pys2index, maybe through xoak #4

Open willirath opened 1 week ago

willirath commented 1 week ago

A few years ago, GEOMAR funded the creation of https://github.com/benbovy/pys2index and https://github.com/xarray-contrib/xoak

At least for the initial assignment of particles to cells, this could save some development. We could also think about linking to s2geometry for JIT mode.

I'm not sure it's wise to accept this external dependency though, because if I remember correctly, building and maintaining the s2 conda package was full of surprises 😀

fluidnumerics-joe commented 1 week ago

I'll give this a go so that we have a full survey of approaches documented to help inform decisions. I'll be mindful of the potential for entering dependency hell, so to speak.

Spatial hashing is fairly easy to implement, requiring only a handful of short methods alongside a hash table to map hash cells to the unstructured grid. With the way I'm looking at it right now, barycentric interpolation with spatial hashing is simple to implement.

I'm keen on finding tools that have the interpolation work covered, which has led me down a rabbit hole of particle-in-cell methods.

fluidnumerics-joe commented 1 week ago

The baked in parallelism in xoak is nice though :+1:

erikvansebille commented 1 week ago

Thanks for these links; I can see they may be useful for the python side of the Parcels implementation.

Note, however, that we will also need a C-version for the JITParticle class and all the functions in parcels.h. Are there any packages that provide both python and C?