Open xzczd opened 2 years ago
@ranocha I'm using Trixi v0.4.2 (Checked with using Pkg;Pkg.status("Trixi")
).
The complete error message is as follows:
MethodError: no method matching getindex(::Nothing, ::Int64)
Closest candidates are:
getindex(::Any, ::Unrolled.FixedRange{A, B}) where {A, B} at C:\Users\xzczd\.julia\packages\Unrolled\26uDc\src\range.jl:23
Stacktrace:
[1] code_string(f::Function, t::Tuple{})
@ CodeTracking C:\Users\xzczd\.julia\packages\CodeTracking\15lQK\src\CodeTracking.jl:299
[2] (::Trixi.var"#face2substring#211"{Int64})(face::Function)
@ Trixi C:\Users\xzczd\.julia\packages\Trixi\IAU6j\src\meshes\structured_mesh.jl:95
[3] |>
@ .\operators.jl:858 [inlined]
[4] _broadcast_getindex_evalf
@ .\broadcast.jl:648 [inlined]
[5] _broadcast_getindex
@ .\broadcast.jl:621 [inlined]
[6] _getindex
@ .\broadcast.jl:644 [inlined]
[7] _broadcast_getindex
@ .\broadcast.jl:620 [inlined]
[8] (::Base.Broadcast.var"#19#20"{Base.Broadcast.Broadcasted{Base.Broadcast.Style{Tuple}, Nothing, typeof(|>), Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.Style{Tuple}, Nothing, typeof(|>), Tuple{Tuple{typeof(f1), typeof(f2)}, Base.RefValue{Trixi.var"#face2substring#211"{Int64}}}}, Base.RefValue{typeof(string)}}}})(k::Int64)
@ Base.Broadcast .\broadcast.jl:1098
[9] ntuple
@ .\ntuple.jl:49 [inlined]
[10] copy
@ .\broadcast.jl:1098 [inlined]
[11] materialize
@ .\broadcast.jl:883 [inlined]
[12] StructuredMesh(cells_per_dimension::Tuple{Int64}, faces::Tuple{typeof(f1), typeof(f2)}; RealT::Type, periodicity::Bool)
@ Trixi C:\Users\xzczd\.julia\packages\Trixi\IAU6j\src\meshes\structured_mesh.jl:98
[13] top-level scope
@ In[51]:3
[14] eval
@ .\boot.jl:360 [inlined]
[15] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1116
using Pkg; Pkg.activate(temp=true); Pkg.add("Trixi"); Pkg.update()
?using Pkg; Pkg.status(mode=PKGMODE_MANIFEST)
?For me,
julia> using Trixi
julia> include(joinpath(examples_dir(), "structured_1d_dgsem", "elixir_euler_source_terms_nonperiodic.jl"))
works fine using Trixi v0.4.2.
@ranocha …This is strange. Seems that it's related to jupyter notebook! (Yeah I was testing with IJulia. ) When I tested the example in command-line REPL, the sample just works well. Why?
FWIW, I'm using IJulia v1.23.2, notebook v6.0.3.
Strange... Did you ever experiment with CodeTracking in Jupyter notebooks, @efaulhaber?
A possible first step to debug this seems to be to try experimenting with CodeTracking and Jupyter notebooks...
Maybe related to https://github.com/timholy/CodeTracking.jl/issues/51?
No, I never experimented with experiment with Jupyter notebooks.
This is related to #541, as storing an interpolation of the mapping (just like the P4estMesh
) would solve this issue as well.
In the example file
IAU6j\examples\structured_1d_dgsem\elixir_euler_source_terms_nonperiodic.jl
, the following linescause the error
Modifying the code to
seems to fix the problem. (I found the syntax in
examples\structured_1d_dgsem\elixir_euler_source_terms.jl
BTW. )