Skip to content

Commit

Permalink
Fix Tableau and convergence tests passing
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarsh530 committed Feb 25, 2020
1 parent 01e1cbf commit 1f870c8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
25 changes: 10 additions & 15 deletions src/perform_step/high_order_rk_perform_step.jl
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ end

@muladd function perform_step!(integrator, cache::PFRK87ConstantCache, repeat_step=false)
@unpack t,dt,uprev,u,f,p = integrator
@unpack α0201, α0301, α0401, α0501, α0601, α0701, α0302, α0403, α0503, α0504, α0604, α0704, α0605, α0705, α0706, α1108, α1208, α1308, α1009, α1109, α1209, α1309, α1110, α1210, α1310, α1211, α1311, β1, β6, β7, β8, β9, β10, β11, β12, β13, β1tilde, β6tilde, β7tilde, β8tilde, β9tilde, β10tilde, β11tilde, β12tilde, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13 = cache
@unpack α0201, α0301, α0401, α0501, α0601, α0701, α0302, α0403, α0503, α0504, α0604, α0704, α0605, α0705, α0706, α0908, α1008, α1108, α1208, α1308, α1009, α1109, α1209, α1309, α1110, α1210, α1310, α1211, α1311, β1, β6, β7, β8, β9, β10, β11, β12, β13, β1tilde, β6tilde, β7tilde, β8tilde, β9tilde, β10tilde, β11tilde, β12tilde, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13 = cache
alg = unwrap_alg(integrator, true)
ν = alg.omega*dt
νsq = ν^2
Expand All @@ -631,16 +631,14 @@ end
α0806 = 0.21311136 + 0.093456*α0807
α0901 = 0.07239997637512857 + 0.01913119863380767*α0807
α0904 = -0.688400520601143 - 0.3135390887207368*α0807
α0905 = -0.688400520601143 - 0.3135390887207368*α0807
α0906 = -0.17301267570583073 - 0.06840852844816077*α0807
α0907 = 0.1440060555560846 + 0.031009360422930017*α0807
α0908 = 0.9982362892760762 + 0.33180705811215994*α0807
α0905 = -0.17301267570583073 - 0.06840852844816077*α0807
α0906 = 0.1440060555560846 + 0.031009360422930017*α0807
α0907 = 0.9982362892760762 + 0.33180705811215994*α0807
α1001 = 0.16261514523236525 - 0.12125171966747463*α0807
α1004 = -2.1255544052061124 + 1.9871809612169453*α0807
α1005 = -0.216403903283323 + 0.43356675517460624*α0807
α1006 = -0.060417230254934076 - 0.1965343807796979*α0807
α1007 = -0.060417230254934076 - 0.1965343807796979*α0807
α1008 = 2.4846281621788395 - 2.102961615944379*α0807
α1007 = 2.4846281621788395 - 2.102961615944379*α0807
α1101 = -1.0320124180911034 + 1.061943768952537*α0807
α1104 = 13.666683232895137 - 17.40407843561103*α0807
α1105 = 0.25990355211486116 - 3.797253476860588*α0807
Expand Down Expand Up @@ -698,7 +696,7 @@ end

@muladd function perform_step!(integrator, cache::PFRK87Cache, repeat_step=false)
@unpack t,dt,uprev,u,f,p = integrator
@unpack α0201, α0301, α0401, α0501, α0601, α0701, α0302, α0403, α0503, α0504, α0604, α0704, α0605, α0705, α0706, α1108, α1208, α1308, α1009, α1109, α1209, α1309, α1110, α1210, α1310, α1211, α1311, β1, β6, β7, β8, β9, β10, β11, β12, β13, β1tilde, β6tilde, β7tilde, β8tilde, β9tilde, β10tilde, β11tilde, β12tilde, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13 = cache.tab
@unpack α0201, α0301, α0401, α0501, α0601, α0701, α0302, α0403, α0503, α0504, α0604, α0704, α0605, α0705, α0706, α0908, α1008, α1108, α1208, α1308, α1009, α1109, α1209, α1309, α1110, α1210, α1310, α1211, α1311, β1, β6, β7, β8, β9, β10, β11, β12, β13, β1tilde, β6tilde, β7tilde, β8tilde, β9tilde, β10tilde, β11tilde, β12tilde, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13 = cache.tab
@unpack k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12,k13,utilde,tmp,atmp,k = cache

alg = unwrap_alg(integrator, true)
Expand All @@ -715,17 +713,14 @@ end
α0806 = 0.21311136 + 0.093456*α0807
α0901 = 0.07239997637512857 + 0.01913119863380767*α0807
α0904 = -0.688400520601143 - 0.3135390887207368*α0807
α0905 = -0.688400520601143 - 0.3135390887207368*α0807
α0906 = -0.17301267570583073 - 0.06840852844816077*α0807
α0907 = 0.1440060555560846 + 0.031009360422930017*α0807
α0908 = 0.9982362892760762 + 0.33180705811215994*α0807
α0905 = -0.17301267570583073 - 0.06840852844816077*α0807
α0906 = 0.1440060555560846 + 0.031009360422930017*α0807
α0907 = 0.9982362892760762 + 0.33180705811215994*α0807
α1001 = 0.16261514523236525 - 0.12125171966747463*α0807
α1004 = -2.1255544052061124 + 1.9871809612169453*α0807
α1005 = -0.216403903283323 + 0.43356675517460624*α0807

α1006 = -0.060417230254934076 - 0.1965343807796979*α0807
α1007 = -0.060417230254934076 - 0.1965343807796979*α0807
α1008 = 2.4846281621788395 - 2.102961615944379*α0807
α1007 = 2.4846281621788395 - 2.102961615944379*α0807
α1101 = -1.0320124180911034 + 1.061943768952537*α0807
α1104 = 13.666683232895137 - 17.40407843561103*α0807
α1105 = 0.25990355211486116 - 3.797253476860588*α0807
Expand Down
6 changes: 5 additions & 1 deletion src/tableaus/high_order_rk_tableaus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,8 @@ struct PFRK87ConstantCache{T1,T2} <: OrdinaryDiffEqConstantCache

α0706::T1

α0908::T1
α1008::T1
α1108::T1
α1208::T1
α1308::T1
Expand Down Expand Up @@ -1118,6 +1120,8 @@ function PFRK87ConstantCache(T1::Type, T2::Type)

α0706 = convert(T1, 23124283//1800000000)

α0908 = convert(T1, 800635310//3783071287)
α1008 = convert(T1, 393006217//1396673457)
α1108 = convert(T1, 15336726248//1032824649)
α1208 = convert(T1, 5232866602//850066563)
α1308 = convert(T1, -13158990841//6184727034)
Expand Down Expand Up @@ -1166,5 +1170,5 @@ function PFRK87ConstantCache(T1::Type, T2::Type)
c12 = convert(T2, 1//1)
c13 = convert(T2, 1//1)

PFRK87ConstantCache(α0201, α0301, α0401, α0501, α0601, α0701, α0302, α0403, α0503, α0504, α0604, α0704, α0605, α0705, α0706, α1108, α1208, α1308, α1009, α1109, α1209, α1309, α1110, α1210, α1310, α1211, α1311, β1, β6, β7, β8, β9, β10, β11, β12, β13, β1tilde, β6tilde, β7tilde, β8tilde, β9tilde, β10tilde, β11tilde, β12tilde, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13)
PFRK87ConstantCache(α0201, α0301, α0401, α0501, α0601, α0701, α0302, α0403, α0503, α0504, α0604, α0704, α0605, α0705, α0706, α0908, α1008, α1108, α1208, α1308, α1009, α1109, α1209, α1309, α1110, α1210, α1310, α1211, α1311, β1, β6, β7, β8, β9, β10, β11, β12, β13, β1tilde, β6tilde, β7tilde, β8tilde, β9tilde, β10tilde, β11tilde, β12tilde, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13)
end
4 changes: 4 additions & 0 deletions test/algconvergence/ode_convergence_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dts1 = 1 .//2 .^(9:-1:5)
dts2 = 1 .//2 .^(7:-1:3)
dts3 = 1 .//2 .^(12:-1:7)
dts4 = 1 .//2 .^(5:-1:3)
dts5 = 1 .//2 .^(3:-1:1)
testTol = 0.2

@testset "Explicit Solver Convergence Tests ($(["out-of-place", "in-place"][i]))" for i in 1:2
Expand Down Expand Up @@ -40,6 +41,9 @@ testTol = 0.2
sim3 = test_convergence(dts4,prob,FRK65())
@test sim3.𝒪est[:l∞] 6 atol=0.6

sim3 = test_convergence(dts5,prob,PFRK87())
@test sim3.𝒪est[:l∞] 8.4 atol=0.2

sim4 = test_convergence(dts,prob,BS3())
@test sim4.𝒪est[:l2] 3 atol=testTol
sim5 = test_convergence(dts, prob, AB3())
Expand Down

0 comments on commit 1f870c8

Please sign in to comment.