@@ -1173,7 +1173,7 @@ function perform_step!(integrator, cache::ImplicitDeuflhardExtrapolationCache,
1173
1173
jacobian2W! (W[1 ], integrator. f. mass_matrix, dt_int, J, true )
1174
1174
integrator. stats. nw += 1
1175
1175
@. . broadcast= false u_temp2= uprev
1176
- @. . broadcast= false linsolve_tmps[1 ]= dt_int * fsalfirst
1176
+ @. . broadcast= false linsolve_tmps[1 ]= fsalfirst
1177
1177
1178
1178
linsolve = cache. linsolve[1 ]
1179
1179
@@ -1188,13 +1188,12 @@ function perform_step!(integrator, cache::ImplicitDeuflhardExtrapolationCache,
1188
1188
cache. linsolve[1 ] = linres. cache
1189
1189
1190
1190
integrator. stats. nsolve += 1
1191
- @. . broadcast= false k= - k
1192
- @. . broadcast= false u_temp1= u_temp2 + k # Euler starting step
1191
+ @. . broadcast= false u_temp1= u_temp2 - k # Euler starting step
1193
1192
@. . broadcast= false diff1[1 ]= u_temp1 - u_temp2
1194
1193
for j in 2 : j_int
1195
1194
f (k, cache. u_temp1, p, t + (j - 1 ) * dt_int)
1196
1195
OrdinaryDiffEqCore. increment_nf! (integrator. stats, 1 )
1197
- @. . broadcast= false linsolve_tmps[1 ]= dt_int * k - (u_temp1 - u_temp2)
1196
+ @. . broadcast= false linsolve_tmps[1 ]= k - (u_temp1 - u_temp2)/ dt_int
1198
1197
1199
1198
linsolve = cache. linsolve[1 ]
1200
1199
@@ -1208,8 +1207,7 @@ function perform_step!(integrator, cache::ImplicitDeuflhardExtrapolationCache,
1208
1207
cache. linsolve[1 ] = linres. cache
1209
1208
1210
1209
integrator. stats. nsolve += 1
1211
- @. . broadcast= false k= - k
1212
- @. . broadcast= false T[i + 1 ]= 2 * u_temp1 - u_temp2 + 2 * k # Explicit Midpoint rule
1210
+ @. . broadcast= false T[i + 1 ]= 2 * u_temp1 - u_temp2 - 2 * k # Explicit Midpoint rule
1213
1211
@. . broadcast= false u_temp2= u_temp1
1214
1212
@. . broadcast= false u_temp1= T[i + 1 ]
1215
1213
if (i <= 1 )
@@ -1245,8 +1243,7 @@ function perform_step!(integrator, cache::ImplicitDeuflhardExtrapolationCache,
1245
1243
jacobian2W! (W[Threads. threadid ()], integrator. f. mass_matrix,
1246
1244
dt_int_temp, J, true )
1247
1245
@. . broadcast= false u_temp4[Threads. threadid ()]= uprev
1248
- @. . broadcast= false linsolve_tmps[Threads. threadid ()]= dt_int_temp *
1249
- fsalfirst
1246
+ @. . broadcast= false linsolve_tmps[Threads. threadid ()]= fsalfirst
1250
1247
1251
1248
linsolve = cache. linsolve[Threads. threadid ()]
1252
1249
@@ -1271,10 +1268,9 @@ function perform_step!(integrator, cache::ImplicitDeuflhardExtrapolationCache,
1271
1268
f (k_tmps[Threads. threadid ()],
1272
1269
cache. u_temp3[Threads. threadid ()],
1273
1270
p, t + (j - 1 ) * dt_int_temp)
1274
- @. . broadcast= false linsolve_tmps[Threads. threadid ()]= dt_int_temp *
1275
- k_tmps[Threads. threadid ()] -
1271
+ @. . broadcast= false linsolve_tmps[Threads. threadid ()]= k_tmps[Threads. threadid ()] -
1276
1272
(u_temp3[Threads. threadid ()] -
1277
- u_temp4[Threads. threadid ()])
1273
+ u_temp4[Threads. threadid ()])/ dt_int_temp
1278
1274
1279
1275
linsolve = cache. linsolve[Threads. threadid ()]
1280
1276
@@ -1290,10 +1286,9 @@ function perform_step!(integrator, cache::ImplicitDeuflhardExtrapolationCache,
1290
1286
end
1291
1287
cache. linsolve[Threads. threadid ()] = linres. cache
1292
1288
1293
- @. . broadcast= false k_tmps[Threads. threadid ()]= - k_tmps[Threads. threadid ()]
1294
1289
@. . broadcast= false T[index + 1 ]= 2 *
1295
1290
u_temp3[Threads. threadid ()] -
1296
- u_temp4[Threads. threadid ()] +
1291
+ u_temp4[Threads. threadid ()] -
1297
1292
2 * k_tmps[Threads. threadid ()] # Explicit Midpoint rule
1298
1293
@. . broadcast= false u_temp4[Threads. threadid ()]= u_temp3[Threads. threadid ()]
1299
1294
@. . broadcast= false u_temp3[Threads. threadid ()]= T[index + 1 ]
@@ -1332,8 +1327,7 @@ function perform_step!(integrator, cache::ImplicitDeuflhardExtrapolationCache,
1332
1327
jacobian2W! (W[Threads. threadid ()], integrator. f. mass_matrix,
1333
1328
dt_int_temp, J, true )
1334
1329
@. . broadcast= false u_temp4[Threads. threadid ()]= uprev
1335
- @. . broadcast= false linsolve_tmps[Threads. threadid ()]= dt_int_temp *
1336
- fsalfirst
1330
+ @. . broadcast= false linsolve_tmps[Threads. threadid ()]= fsalfirst
1337
1331
1338
1332
linsolve = cache. linsolve[Threads. threadid ()]
1339
1333
@@ -1358,10 +1352,9 @@ function perform_step!(integrator, cache::ImplicitDeuflhardExtrapolationCache,
1358
1352
f (k_tmps[Threads. threadid ()],
1359
1353
cache. u_temp3[Threads. threadid ()],
1360
1354
p, t + (j - 1 ) * dt_int_temp)
1361
- @. . broadcast= false linsolve_tmps[Threads. threadid ()]= dt_int_temp *
1362
- k_tmps[Threads. threadid ()] -
1355
+ @. . broadcast= false linsolve_tmps[Threads. threadid ()]= k_tmps[Threads. threadid ()] -
1363
1356
(u_temp3[Threads. threadid ()] -
1364
- u_temp4[Threads. threadid ()])
1357
+ u_temp4[Threads. threadid ()])/ dt_int_temp
1365
1358
1366
1359
linsolve = cache. linsolve[Threads. threadid ()]
1367
1360
@@ -1377,10 +1370,9 @@ function perform_step!(integrator, cache::ImplicitDeuflhardExtrapolationCache,
1377
1370
end
1378
1371
cache. linsolve[Threads. threadid ()] = linres. cache
1379
1372
1380
- @. . broadcast= false k_tmps[Threads. threadid ()]= - k_tmps[Threads. threadid ()]
1381
1373
@. . broadcast= false T[index + 1 ]= 2 *
1382
1374
u_temp3[Threads. threadid ()] -
1383
- u_temp4[Threads. threadid ()] +
1375
+ u_temp4[Threads. threadid ()] -
1384
1376
2 * k_tmps[Threads. threadid ()] # Explicit Midpoint rule
1385
1377
@. . broadcast= false u_temp4[Threads. threadid ()]= u_temp3[Threads. threadid ()]
1386
1378
@. . broadcast= false u_temp3[Threads. threadid ()]= T[index + 1 ]
@@ -1459,7 +1451,7 @@ function perform_step!(integrator, cache::ImplicitDeuflhardExtrapolationCache,
1459
1451
jacobian2W! (W[1 ], integrator. f. mass_matrix, dt_int, J, true )
1460
1452
integrator. stats. nw += 1
1461
1453
@. . broadcast= false u_temp2= uprev
1462
- @. . broadcast= false linsolve_tmps[1 ]= dt_int * fsalfirst
1454
+ @. . broadcast= false linsolve_tmps[1 ]= fsalfirst
1463
1455
1464
1456
linsolve = cache. linsolve[1 ]
1465
1457
linres = dolinsolve (integrator, linsolve; b = _vec (linsolve_tmps[1 ]),
@@ -2545,7 +2537,7 @@ function perform_step!(integrator, cache::ImplicitHairerWannerExtrapolationCache
2545
2537
jacobian2W! (W[1 ], integrator. f. mass_matrix, dt_int, J, true )
2546
2538
integrator. stats. nw += 1
2547
2539
@. . broadcast= false u_temp2= uprev
2548
- @. . broadcast= false linsolve_tmps[1 ]= dt_int * fsalfirst
2540
+ @. . broadcast= false linsolve_tmps[1 ]= fsalfirst
2549
2541
2550
2542
linsolve = cache. linsolve[1 ]
2551
2543
if ! repeat_step
@@ -2558,8 +2550,7 @@ function perform_step!(integrator, cache::ImplicitHairerWannerExtrapolationCache
2558
2550
cache. linsolve[1 ] = linres. cache
2559
2551
2560
2552
integrator. stats. nsolve += 1
2561
- @. . broadcast= false k= - k
2562
- @. . broadcast= false u_temp1= u_temp2 + k # Euler starting step
2553
+ @. . broadcast= false u_temp1= u_temp2 - k # Euler starting step
2563
2554
@. . broadcast= false diff1[1 ]= u_temp1 - u_temp2
2564
2555
for j in 2 : (j_int + 1 )
2565
2556
f (k, cache. u_temp1, p, t + (j - 1 ) * dt_int)
@@ -2619,8 +2610,7 @@ function perform_step!(integrator, cache::ImplicitHairerWannerExtrapolationCache
2619
2610
jacobian2W! (W[Threads. threadid ()], integrator. f. mass_matrix,
2620
2611
dt_int_temp, J, true )
2621
2612
@. . broadcast= false u_temp4[Threads. threadid ()]= uprev
2622
- @. . broadcast= false linsolve_tmps[Threads. threadid ()]= dt_int_temp *
2623
- fsalfirst
2613
+ @. . broadcast= false linsolve_tmps[Threads. threadid ()]= fsalfirst
2624
2614
2625
2615
linsolve = cache. linsolve[Threads. threadid ()]
2626
2616
@@ -2636,8 +2626,7 @@ function perform_step!(integrator, cache::ImplicitHairerWannerExtrapolationCache
2636
2626
end
2637
2627
cache. linsolve[Threads. threadid ()] = linres. cache
2638
2628
2639
- @. . broadcast= false k_tmps[Threads. threadid ()]= - k_tmps[Threads. threadid ()]
2640
- @. . broadcast= false u_temp3[Threads. threadid ()]= u_temp4[Threads. threadid ()] +
2629
+ @. . broadcast= false u_temp3[Threads. threadid ()]= u_temp4[Threads. threadid ()] -
2641
2630
k_tmps[Threads. threadid ()] # Euler starting step
2642
2631
@. . broadcast= false diff1[Threads. threadid ()]= u_temp3[Threads. threadid ()] -
2643
2632
u_temp4[Threads. threadid ()]
@@ -2711,7 +2700,7 @@ function perform_step!(integrator, cache::ImplicitHairerWannerExtrapolationCache
2711
2700
dt_int_temp = dt / j_int_temp # Stepsize of the ith internal discretisation
2712
2701
jacobian2W! (W[tid], integrator. f. mass_matrix, dt_int_temp, J, true )
2713
2702
@. . broadcast= false u_temp4[tid]= uprev
2714
- @. . broadcast= false linsolvetmp= dt_int_temp * fsalfirst
2703
+ @. . broadcast= false linsolvetmp= fsalfirst
2715
2704
2716
2705
linsolve = cache. linsolve[tid]
2717
2706
if ! repeat_step
@@ -2723,8 +2712,7 @@ function perform_step!(integrator, cache::ImplicitHairerWannerExtrapolationCache
2723
2712
end
2724
2713
cache. linsolve[tid] = linres. cache
2725
2714
2726
- @. . broadcast= false ktmp= - ktmp
2727
- @. . broadcast= false u_temp3[tid]= u_temp4[tid] + ktmp # Euler starting step
2715
+ @. . broadcast= false u_temp3[tid]= u_temp4[tid] - ktmp # Euler starting step
2728
2716
@. . broadcast= false diff1[tid]= u_temp3[tid] - u_temp4[tid]
2729
2717
for j in 2 : (j_int_temp + 1 )
2730
2718
f (ktmp, cache. u_temp3[tid], p, t + (j - 1 ) * dt_int_temp)
@@ -2826,7 +2814,7 @@ function perform_step!(integrator, cache::ImplicitHairerWannerExtrapolationCache
2826
2814
jacobian2W! (W[1 ], integrator. f. mass_matrix, dt_int, J, true )
2827
2815
integrator. stats. nw += 1
2828
2816
@. . broadcast= false u_temp2= uprev
2829
- @. . broadcast= false linsolve_tmps[1 ]= dt_int * fsalfirst
2817
+ @. . broadcast= false linsolve_tmps[1 ]= fsalfirst
2830
2818
2831
2819
linsolve = cache. linsolve[1 ]
2832
2820
@@ -2840,12 +2828,11 @@ function perform_step!(integrator, cache::ImplicitHairerWannerExtrapolationCache
2840
2828
cache. linsolve[1 ] = linres. cache
2841
2829
2842
2830
integrator. stats. nsolve += 1
2843
- @. . broadcast= false k= - k
2844
- @. . broadcast= false u_temp1= u_temp2 + k # Euler starting step
2831
+ @. . broadcast= false u_temp1= u_temp2 - k # Euler starting step
2845
2832
for j in 2 : (j_int + 1 )
2846
2833
f (k, cache. u_temp1, p, t + (j - 1 ) * dt_int)
2847
2834
OrdinaryDiffEqCore. increment_nf! (integrator. stats, 1 )
2848
- @. . broadcast= false linsolve_tmps[1 ]= dt_int * k - (u_temp1 - u_temp2)
2835
+ @. . broadcast= false linsolve_tmps[1 ]= k - (u_temp1 - u_temp2)/ dt_int
2849
2836
2850
2837
linsolve = cache. linsolve[1 ]
2851
2838
@@ -2859,8 +2846,7 @@ function perform_step!(integrator, cache::ImplicitHairerWannerExtrapolationCache
2859
2846
cache. linsolve[1 ] = linres. cache
2860
2847
2861
2848
integrator. stats. nsolve += 1
2862
- @. . broadcast= false k= - k
2863
- @. . broadcast= false T[n_curr + 1 ]= 2 * u_temp1 - u_temp2 + 2 * k # Explicit Midpoint rule
2849
+ @. . broadcast= false T[n_curr + 1 ]= 2 * u_temp1 - u_temp2 - 2 * k # Explicit Midpoint rule
2864
2850
if (j == j_int + 1 )
2865
2851
@. . broadcast= false T[n_curr + 1 ]= 0.5 (T[n_curr + 1 ] + u_temp2)
2866
2852
end
@@ -3532,7 +3518,7 @@ function perform_step!(integrator, cache::ImplicitEulerBarycentricExtrapolationC
3532
3518
jacobian2W! (W[1 ], integrator. f. mass_matrix, dt_int, J, true )
3533
3519
integrator. stats. nw += 1
3534
3520
@. . broadcast= false u_temp2= uprev
3535
- @. . broadcast= false linsolve_tmps[1 ]= dt_int * fsalfirst
3521
+ @. . broadcast= false linsolve_tmps[1 ]= fsalfirst
3536
3522
3537
3523
linsolve = cache. linsolve[1 ]
3538
3524
0 commit comments