trixi-framework / trixi-framework/Trixi.jl

How to calculate function values at certain coordinate?

Open
#939 12 comments 0 reactions 0 assignees View on GitHub
possible student project
Dominant language
Julia
Stars
731
Forks
167
Avg merge
2d 18h
Merged PRs (30d)
25

Description

I'm a bit confused about the usage of the obtained `ODESolution`. Let's take `joinpath(examples_dir(), "tree_1d_dgsem", "elixir_euler_source_terms_nonperiodic.jl")` as example, how to calculate the function values at, say, x=1.1? Is it possible to obtain something like [`InterpolatingFunction`](https://reference.wolfram.com/language/ref/InterpolatingFunction.html) in *Mathematica*? (I guess the counterpart in julia is [`Interpolations.interpolate`](https://juliamath.github.io/Interpolations.jl/stable/)?)

BTW, where's the info of `x`? Is it stored inside `sol`? By reading
https://diffeq.sciml.ai/stable/tutorials/ode_example/
I can somewhat understand the list of `t` and `u`(?) can be obtained with
```
sol.t
sol.u
```
But I can't figure out how to extract list of `x`.

Also, how is `sol.u` arranged? Seems that `sol.u[2][1:3:end]` corresponds to `rho` at end time? If so, what's `sol.u[2][2:3:end]` and ` sol.u[2][3:3:end]`? Clearly they're not `v1` and `p`.

Contributor guide

Open the contributing guide

Research direction

Start with the referenced tree_1d_dgsem/elixir_euler_source_terms_nonperiodic.jl example and the ODE tutorial's sol.t and sol.u API. Trace how ODESolution stores spatial coordinates and variables, then document coordinate lookup or interpolation and the layout of sol.u; done means a newcomer can evaluate values at x=1.1 and identify each stored component.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
developer-experience
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.