ForestClaw / forestclaw

Quadtree/octree adaptive PDE solver based based on p4est.
http://www.forestclaw.org
BSD 2-Clause "Simplified" License
57 stars 21 forks source link

Mesh overlap feature and example #249

Closed hannesbrandt closed 1 year ago

hannesbrandt commented 1 year ago

We provide functionality to query interpolation data from a domain for a process-dependent local set of points. To query the interpolation data, the user must provide a domain, an array of query-points and an interpolation-callback to fclaw2d_overlap_exchange.

This can be used to facilitate working with two overlapping domains at the same time. In this case, we distinguish a consumer side (which "consumes" interpolation data and posts the query points) and a producer side (which produces the interpolation data). Both domains must operate on the same communicator.

The filament_swirl example was extended to include the exchange functionalities. Here, the swirl domain represents the consumer side and the filament domain represents the producer side. The exchange-functionalities are not yet integrated into the time loop and are only called once at the start of the program.

The consumer creates a process-local array of query points - the center points of all local cells. The interpolation callback applies the inverse mapping of the filament-side to the query point, before intersecting it with the patch boundaries. Currently, we do not implement actual interpolation of the point data. Instead, the interpolation value is set to the respective rank on the producer side.

What the example still leaves to be desired is the proper implementation of a non-trivial consumer mapping and producer inverse mapping. Furthermore, actual interpolation including the producer side cells should be added.