Dear @ziolai,
thank you very much! That sounds like an interesting application and we would like to know more about it - since we also need a bit more information about the problem to give a good answer. Would you mind opening an issue in our repository?
Some first hints: I guess you want to solve some linear advection equation. If so, you can setup a new equation type as described in our tutorials, e.g., this one on a conservative equation or this one on a non-conservative equation with variable coefficients. Then, you could solve the eikonal equation in whatever way you like and interpolate it to our solution nodes. You could for example wrap the interpolation object as callable function and pass that when creating the semidiscretization of Trixi.jl. Alternatively, you oculd initialize the variable coefficients with some default values and overwrite them after setting up the data, e.g., after setting up the ODE problem (via semidiscretize
). If you do that, you need o get the node coordinates, e.g., via
semi = SemidiscretizationHyperbolic(...)
For example, you can get the following on a TreeMesh
in 2D:
julia> using Trixi
julia> trixi_include(default_example())
julia> semi.cache.elements.node_coordinates # undocumented internal state - be cautious
2×4×4×256 Array{Float64, 4}:
[...]
Here, the first dimension of the array is the spatial dimension (2D in this case), the second and third dimensions are the tensor-product nodes of our Gauss-Lobatto-Legendre nodes in a quad element, and the last dimension of the array is the element index. If you want to have a plain vector of structs, you can wrap this, e.g., as
julia> reinterpret(SVector{2, Float64}, vec(semi.cache.elements.node_coordinates))
4096-element reinterpret(SVector{2, Float64}, ::Vector{Float64}):
[-1.0, -1.0]
[-0.9654508497187474, -1.0]
[-0.9095491502812526, -1.0]
[-0.875, -1.0]
[...]