This repository was archived by the owner on Jul 19, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree File renamed without changes.
Original file line number Diff line number Diff line change @@ -37,12 +37,15 @@ using ModelingToolkit: Differential
3737
3838 # Method of lines discretization
3939 dx = 0.1 ; dy = 0.2
40- discretization = MOLFiniteDifference ([x=> dx,y=> dy],t)
41- prob = ModelingToolkit. discretize (pdesys,discretization)
42- sol = solve (prob,Tsit5 ())
43-
44- # Test against exact solution
45- # TODO : do this properly when sol[u] with reshape etc works
46- @test sol. u[1 ][1 ] ≈ analytic_sol_func (sol. t[1 ],0.1 ,0.2 )
47- @test sol. u[1 ][2 ] ≈ analytic_sol_func (sol. t[1 ],0.2 ,0.2 )
40+ for order in [2 ,4 ,6 ]
41+ discretization = MOLFiniteDifference ([x=> dx,y=> dy],t;centered_order= order)
42+ prob = ModelingToolkit. discretize (pdesys,discretization)
43+ sol = solve (prob,Tsit5 ())
44+
45+ # Test against exact solution
46+ # TODO : do this properly when sol[u] with reshape etc works
47+ @test sol. u[1 ][1 ] ≈ analytic_sol_func (sol. t[1 ],0.1 ,0.2 )
48+ @test sol. u[1 ][2 ] ≈ analytic_sol_func (sol. t[1 ],0.2 ,0.2 )
49+
50+ end
4851end
Original file line number Diff line number Diff line change 3838if GROUP == " All" || GROUP == " MOLFiniteDifference"
3939 @time @safetestset " MOLFiniteDifference Interface" begin include (" MOL/MOLtest.jl" ) end
4040 # @time @safetestset "MOLFiniteDifference Interface: Linear Convection" begin include("MOL/MOL_1D_Linear_Convection.jl") end
41- @time @safetestset " MOLFiniteDifference Interface: Linear Diffusion" begin include (" MOL/MOL_1D_Linear_Diffusion.jl" ) end
41+ @time @safetestset " MOLFiniteDifference Interface: 1D Diffusion" begin include (" MOL/MOL_1D_Diffusion.jl" ) end
42+ @time @safetestset " MOLFiniteDifference Interface: 2D Diffusion" begin include (" MOL/MOL_2D_Diffusion.jl" ) end
4243end
4344
4445if GROUP == " All" || GROUP == " Misc"
You can’t perform that action at this time.
0 commit comments