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
527 stars 105 forks source link

`TimeSeriesCallback` for dimensions other than 2D #1869

Open andrewwinters5000 opened 6 months ago

andrewwinters5000 commented 6 months ago

Further extensions of the functionality from #1855 are possible. Adding the ability of having gauge points on, e.g., a 1D TreeMesh should be straightforward. For instance, one does not need a Newton iteration as the affine mapping between computational coordinates and physical coordinates is easily inverted exactly.

Instead of using the barycenters, it could be possible to use the available normal directions instead. See this discussion where this idea is partially implemented for the UnstructuredMesh2D.

For 3D meshes, like P4estMesh, a bit more is involved but it should still be straightforward. The search to locate which element a given (x,y,z) points lives is likely easily extended from the strategy in #1855. However, it might become more performance critical, especially if AMR is used. This is because the search would need to be redone after each time the AMRCallback is applied. The Newton iteration to compute the reference coordinates could reuse the existing straight_side_quad_map, straight_side_quad_map_metrics, transfinite_quad_map, and transfinite_quad_map_metrics functions that are working in 3D. However, an efficient Newton iteration may need implemented that requires inverting a 3x3 matrix.

patrickersing commented 6 months ago

I have opened PR #1873 to extend the TimeSeriesCallback to other dimensions specifically for TreeMesh