trixi-framework / trixi-framework/Trixi.jl
StructuredMesh with CodeTracking does not seem to work in Jupyter notebooks
- Dominant language
- Julia
- Stars
- 731
- Forks
- 167
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 25
Description
In the example file `IAU6j\examples\structured_1d_dgsem\elixir_euler_source_terms_nonperiodic.jl`, the following lines
```
f1() = SVector(0.0)
f2() = SVector(2.0)
mesh = StructuredMesh((16,), (f1, f2), periodicity=false)
```
cause the error
```
MethodError: no method matching getindex(::Nothing, ::Int64)
```
Modifying the code to
```
mesh = StructuredMesh((16,),(0.0,), (2.0,), periodicity=false)
```
seems to fix the problem. (I found the syntax in `examples\structured_1d_dgsem\elixir_euler_source_terms.jl` BTW. )
Contributor guide
Research direction
Start with examples/structured_1d_dgsem/elixir_euler_source_terms_nonperiodic.jl and compare its StructuredMesh call with examples/structured_1d_dgsem/elixir_euler_source_terms.jl. Reproduce the failure in a Jupyter notebook with CodeTracking enabled and determine whether the function-based constructor should work; done means the reported example runs without the getindex(::Nothing, ::Int64) error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100