trixi-framework / Trixi.jl

Trixi.jl: Adaptive high-order numerical simulations of conservation laws in Julia
https://trixi-framework.github.io/Trixi.jl
MIT License
505 stars 98 forks source link

`AnalysisSurfaceIntegral` not ready for AMR #1955

Open DanielDoehring opened 1 month ago

DanielDoehring commented 1 month ago

Currently, we query the boundary elements once at construction

https://github.com/trixi-framework/Trixi.jl/blob/5359525685966ab79a9abfca7f20920ee25c0505/src/callbacks_step/analysis_surface_integral_2d.jl#L32-L48

and never update, even when the grid changes. Thus, in the case of AMR, the current results are garbage.

Ideally, we would have access to has_changed in this callback to re-compute the boundaries only if necessary. The alternative would be to reconstruct the indices every time the callback is used.

In any case, we also need to pass semi and for the first version most likely also integrator around.

DanielDoehring commented 1 month ago

I will provide a draft PR for the second approach soon.