Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert further TOML examples to elixirs #245

Closed
wants to merge 10 commits into from
Closed

Conversation

sloede
Copy link
Member

@sloede sloede commented Oct 22, 2020

This commit addresses the first three example files in #219.

@sloede sloede self-assigned this Oct 22, 2020
@sloede
Copy link
Member Author

sloede commented Oct 22, 2020

@ranocha I get a UndefRefError from DiffEq and I don't even know how to start looking for the problem - maybe you can help me out here (next week of course)?

julia> trixi_include("examples/1d/elixir_euler_density_wave.jl")
...
#t/s:    400 | dt: 2.3050e-03 | Sim. time: 9.6349e-01 | Run time: 5.3188e-02 s
#t/s:    600 | dt: 2.5417e-03 | Sim. time: 1.5615e+00 | Run time: 8.0304e-02 s
#t/s:    800 | dt: 1.6237e-03 | Sim. time: 1.9400e+00 | Run time: 1.0488e-01 s

--------------------------------------------------------------------------------
 Simulation running 'CompressibleEulerEquations1D' with POLYDEG = 5
--------------------------------------------------------------------------------
 #timesteps:                837                run time:       1.13033195e-01 s
 dt:             7.03360551e-04                Time/DOF/rhs!:  1.01607521e-06 s
 sim. time:      2.00000000e+00

ERROR: LoadError: UndefRefError: access to undefined reference
Stacktrace:
 [1] getproperty at ./Base.jl:33 [inlined]
 [2] get_du at /home/mschlott/.julia/packages/OrdinaryDiffEq/VPJBD/src/integrators/integrator_interface.jl:62 [inlined]
 [3] macro expansion at /home/mschlott/gdrive/work/code/hackathon/master-Trixi.jl/src/callbacks/analysis.jl:210 [inlined]
 [4] macro expansion at /home/mschlott/.julia/packages/TimerOutputs/dVnaw/src/TimerOutput.jl:190 [inlined]
 [5] (::AnalysisCallback{Trixi.LobattoLegendreAnalyzer{Float64,11,Array{Float64,2}},Tuple{typeof(Trixi.entropy_timederivative)},StaticArrays.SArray{Tuple{3},Float64,1,3}})(::OrdinaryDiffEq.ODEIntegrator{CarpenterKennedy2N54,true,Array{Float64,1},Nothing,Float64,SemidiscretizationHyperbolic{TreeMesh{1},CompressibleEulerEquations1D{Float64},typeof(initial_conditions_density_wave),Nothing,Nothing,DG{Float64,LobattoLegendreBasis{Float64,6,Array{Float64,2},StaticArrays.SArray{Tuple{6,2},Float64,2,12},StaticArrays.SArray{Tuple{6,6},Float64,2,36}},Trixi.LobattoLegendreMortarL2{Float64,6,StaticArrays.SArray{Tuple{6,6},Float64,2,36}},typeof(flux_lax_friedrichs),VolumeIntegralWeakForm},NamedTuple{(:elements, :interfaces, :boundaries),Tuple{Trixi.ElementContainer1D{Float64,3,5},Trixi.InterfaceContainer1D{Float64,3,5},Trixi.BoundaryContainer1D{Float64,3,5}}}},Float64,Float64,Float64,Array{Array{Float64,1},1},ODESolution{Float64,2,Array{Array{Float64,1},1},Nothing,Nothing,Array{Float64,1},Array{Array{Array{Float64,1},1},1},ODEProblem{Array{Float64,1},Tuple{Float64,Float64},true,SemidiscretizationHyperbolic{TreeMesh{1},CompressibleEulerEquations1D{Float64},typeof(initial_conditions_density_wave),Nothing,Nothing,DG{Float64,LobattoLegendreBasis{Float64,6,Array{Float64,2},StaticArrays.SArray{Tuple{6,2},Float64,2,12},StaticArrays.SArray{Tuple{6,6},Float64,2,36}},Trixi.LobattoLegendreMortarL2{Float64,6,StaticArrays.SArray{Tuple{6,6},Float64,2,36}},typeof(flux_lax_friedrichs),VolumeIntegralWeakForm},NamedTuple{(:elements, :interfaces, :boundaries),Tuple{Trixi.ElementContainer1D{Float64,3,5},Trixi.InterfaceContainer1D{Float64,3,5},Trixi.BoundaryContainer1D{Float64,3,5}}}},ODEFunction{true,typeof(Trixi.rhs!),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}},DiffEqBase.StandardODEProblem},CarpenterKennedy2N54,OrdinaryDiffEq.InterpolationData{ODEFunction{true,typeof(Trixi.rhs!),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Array{Float64,1},1},Array{Float64,1},Array{Array{Array{Float64,1},1},1},OrdinaryDiffEq.LowStorageRK2NCache{Array{Float64,1},Array{Float64,1},OrdinaryDiffEq.LowStorageRK2NConstantCache{4,Float64,Float64}}},DiffEqBase.DEStats},ODEFunction{true,typeof(Trixi.rhs!),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},OrdinaryDiffEq.LowStorageRK2NCache{Array{Float64,1},Array{Float64,1},OrdinaryDiffEq.LowStorageRK2NConstantCache{4,Float64,Float64}},OrdinaryDiffEq.DEOptions{Float64,Float64,Float64,Float64,typeof(DiffEqBase.ODE_DEFAULT_NORM),typeof(LinearAlgebra.opnorm),CallbackSet{Tuple{},Tuple{DiscreteCallback{typeof(Trixi.summary_callback),typeof(Trixi.summary_callback),typeof(Trixi.initialize_summary_callback)},DiscreteCallback{Trixi.var"#341#342",StepsizeCallback{Float64},typeof(Trixi.initialize!)},DiscreteCallback{Trixi.var"#344#345"{Int64,Bool},SaveSolutionCallback,typeof(Trixi.initialize!)},DiscreteCallback{Trixi.var"#350#352"{Int64},AnalysisCallback{Trixi.LobattoLegendreAnalyzer{Float64,11,Array{Float64,2}},Tuple{typeof(Trixi.entropy_timederivative)},StaticArrays.SArray{Tuple{3},Float64,1,3}},typeof(Trixi.initialize!)},DiscreteCallback{Trixi.var"#375#376"{Int64,Int64},AliveCallback,typeof(Trixi.initialize!)}}},typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN),typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE),typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK),DataStructures.BinaryHeap{Float64,DataStructures.LessThan},DataStructures.BinaryHeap{Float64,DataStructures.LessThan},Nothing,Nothing,Int64,Tuple{},Tuple{},Tuple{}},Array{Float64,1},Float64,Nothing,OrdinaryDiffEq.DefaultInit}) at /home/mschlott/gdrive/work/code/hackathon/master-Trixi.jl/src/callbacks/analysis.jl:153
 [6] apply_discrete_callback! at /home/mschlott/.julia/packages/DiffEqBase/V7P18/src/callbacks.jl:830 [inlined]
...

The only thing I could figure out so far was that get_du just returns integrator.fsallast, which seems to be an undefined ref. However, I have not worked with the Julia debugger in VS Code and I don't know anything about DiffEq that would help me to start figuring out what's wrong here.

@codecov
Copy link

codecov bot commented Oct 22, 2020

Codecov Report

Merging #245 into dev will not change coverage.
The diff coverage is 50.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev     #245   +/-   ##
=======================================
  Coverage   89.41%   89.41%           
=======================================
  Files          60       60           
  Lines       10585    10585           
=======================================
  Hits         9465     9465           
  Misses       1120     1120           
Impacted Files Coverage Δ
src/callbacks/stepsize_dg2d.jl 88.88% <ø> (ø)
src/run.jl 92.96% <33.33%> (ø)
src/callbacks/stepsize_dg1d.jl 87.50% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b95c122...b086b95. Read the comment docs.

@ranocha
Copy link
Member

ranocha commented Oct 23, 2020

Which version of OrdinaryDiffEq.jl do you use? Did you try to update it?

@ranocha
Copy link
Member

ranocha commented Oct 23, 2020

Your code works for me on Julia v1.5.2 with OrdinaryDiffEq v5.43.0.

@sloede
Copy link
Member Author

sloede commented Oct 23, 2020

Thanks, when I updated OrdinaryDiffEq.jl (it was this package, all other packages I had already updated but to no avail), it now works for me as well 👍

@ranocha
Copy link
Member

ranocha commented Oct 24, 2020

The new examples need to be added to the tests.

@sloede
Copy link
Member Author

sloede commented Nov 4, 2020

Closed in favor or #294.

@sloede sloede closed this Nov 4, 2020
@sloede sloede deleted the msl/port-toml-to-elxir branch November 10, 2020 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants