Deltares / numba_celltree

Celltree data structure for searching for points, lines, boxes, and cells (convex polygons) in a two dimensional unstructured mesh.
https://deltares.github.io/numba_celltree/
MIT License
11 stars 3 forks source link

Add EdgeCellTree2d class #11

Open Huite opened 10 months ago

Huite commented 10 months ago

After discussion with @JoerivanEngelen:

To translate data from networks, e.g. the water level output or bed level from 1D hydraulic simulations, to gridded (MODFLOW) input, we need some tooling that's capable of providing this data at the appropriate scale.

An appropriate method is to intersect the network topology with the grid topology, taking the midpoints of the resulting intersecting edges, and adding these as nodes to the original network. Then, we can apply some form of interpolation along the new network based on the connectivity to propagate features to arbitrary locations.

To insert new vertices efficiently, we need to be capable of searching for edges efficiently. The CellTree is perfectly capable of this:

Easiest way to is duplicate some methods. Inheritance will work somewhat superficially, since I want to rely on just numba + named tuples for the actual work.