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

New Algorithm SharpFineRKN6 #2059

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/OrdinaryDiffEq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ export SymplecticEuler, VelocityVerlet, VerletLeapfrog, PseudoVerletLeapfrog,

export SplitEuler

export Nystrom4, FineRKN4, FineRKN5, Nystrom4VelocityIndependent,
export Nystrom4, FineRKN4, FineRKN5, SharpFineRKN6, Nystrom4VelocityIndependent,
Nystrom5VelocityIndependent,
IRKN3, IRKN4, DPRKN4, DPRKN5, DPRKN6, DPRKN6FM, DPRKN8, DPRKN12, ERKN4, ERKN5, ERKN7

Expand Down
1 change: 1 addition & 0 deletions src/alg_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@
alg_order(alg::Nystrom4) = 4
alg_order(alg::FineRKN4) = 4
alg_order(alg::FineRKN5) = 5
alg_order(alg::SharpFineRKN6) = 6

Check warning on line 470 in src/alg_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/alg_utils.jl#L470

Added line #L470 was not covered by tests
alg_order(alg::Nystrom4VelocityIndependent) = 4
alg_order(alg::IRKN4) = 4
alg_order(alg::Nystrom5VelocityIndependent) = 5
Expand Down
25 changes: 25 additions & 0 deletions src/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,31 @@ In particular, this method allows the acceleration equation to depend on the vel
"""
struct FineRKN5 <: OrdinaryDiffEqAdaptivePartitionedAlgorithm end

"""
SharpFineRKN6()

A adaptive 6th order explicit Runge-Kutta-Nyström method which can be applied directly to second order ODEs.
In particular, this method allows the acceleration equation to depend on the velocity.

## References

```
@article{SHARP1992279,
title = {Some Nyström pairs for the general second-order initial-value problem},
journal = {Journal of Computational and Applied Mathematics},
volume = {42},
number = {3},
pages = {279-291},
year = {1992},
issn = {0377-0427},
doi = {https://doi.org/10.1016/0377-0427(92)90081-8},
url = {https://www.sciencedirect.com/science/article/pii/0377042792900818},
author = {P.W. Sharp and J.M. Fine}
}
```
"""
struct SharpFineRKN6 <: OrdinaryDiffEqAdaptivePartitionedAlgorithm end

"""
Nystrom4VelocityIdependent

Expand Down
49 changes: 49 additions & 0 deletions src/caches/rkn_caches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,55 @@
FineRKN5ConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits))
end

@cache struct SharpFineRKN6Cache{uType, rateType, reducedRateType, uNoUnitsType, TabType} <:
OrdinaryDiffEqMutableCache
u::uType
uprev::uType
fsalfirst::rateType
k2::reducedRateType
k3::reducedRateType
k4::reducedRateType
k5::reducedRateType
k6::reducedRateType
k7::reducedRateType
k8::reducedRateType
k::rateType
utilde::uType
tmp::uType
atmp::uNoUnitsType
tab::TabType
end

function alg_cache(alg::SharpFineRKN6, u, rate_prototype, ::Type{uEltypeNoUnits},

Check warning on line 146 in src/caches/rkn_caches.jl

View check run for this annotation

Codecov / codecov/patch

src/caches/rkn_caches.jl#L146

Added line #L146 was not covered by tests
::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t,
dt, reltol, p, calck,
::Val{true}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits}
reduced_rate_prototype = rate_prototype.x[2]
tab = SharpFineRKN6ConstantCache(constvalue(uBottomEltypeNoUnits),

Check warning on line 151 in src/caches/rkn_caches.jl

View check run for this annotation

Codecov / codecov/patch

src/caches/rkn_caches.jl#L150-L151

Added lines #L150 - L151 were not covered by tests
constvalue(tTypeNoUnits))
k1 = zero(rate_prototype)
k2 = zero(reduced_rate_prototype)
k3 = zero(reduced_rate_prototype)
k4 = zero(reduced_rate_prototype)
k5 = zero(reduced_rate_prototype)
k6 = zero(reduced_rate_prototype)
k7 = zero(reduced_rate_prototype)
k8 = zero(reduced_rate_prototype)
k = zero(rate_prototype)
utilde = zero(u)
atmp = similar(u, uEltypeNoUnits)
recursivefill!(atmp, false)
tmp = zero(u)
SharpFineRKN6Cache(u, uprev, k1, k2, k3, k4, k5, k6, k7, k8, k, utilde, tmp, atmp, tab)

Check warning on line 166 in src/caches/rkn_caches.jl

View check run for this annotation

Codecov / codecov/patch

src/caches/rkn_caches.jl#L153-L166

Added lines #L153 - L166 were not covered by tests
end

function alg_cache(alg::SharpFineRKN6, u, rate_prototype, ::Type{uEltypeNoUnits},

Check warning on line 169 in src/caches/rkn_caches.jl

View check run for this annotation

Codecov / codecov/patch

src/caches/rkn_caches.jl#L169

Added line #L169 was not covered by tests
::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t,
dt, reltol, p, calck,
::Val{false}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits}
SharpFineRKN6ConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits))

Check warning on line 173 in src/caches/rkn_caches.jl

View check run for this annotation

Codecov / codecov/patch

src/caches/rkn_caches.jl#L173

Added line #L173 was not covered by tests
end

@cache struct Nystrom4VelocityIndependentCache{uType, rateType, reducedRateType} <:
OrdinaryDiffEqMutableCache
u::uType
Expand Down
179 changes: 178 additions & 1 deletion src/perform_step/rkn_perform_step.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## y'₁ = y'₀ + h∑bᵢk'ᵢ

const NystromCCDefaultInitialization = Union{Nystrom4ConstantCache, FineRKN4ConstantCache,
FineRKN5ConstantCache,
FineRKN5ConstantCache, SharpFineRKN6ConstantCache,
Nystrom4VelocityIndependentConstantCache,
Nystrom5VelocityIndependentConstantCache,
IRKN3ConstantCache, IRKN4ConstantCache,
Expand All @@ -27,6 +27,7 @@
end

const NystromDefaultInitialization = Union{Nystrom4Cache, FineRKN4Cache, FineRKN5Cache,
SharpFineRKN6Cache,
Nystrom4VelocityIndependentCache,
Nystrom5VelocityIndependentCache,
IRKN3Cache, IRKN4Cache,
Expand Down Expand Up @@ -365,6 +366,182 @@
end
end

@muladd function perform_step!(integrator, cache::SharpFineRKN6ConstantCache,

Check warning on line 369 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L369

Added line #L369 was not covered by tests
repeat_step = false)
@unpack t, dt, f, p = integrator
duprev, uprev = integrator.uprev.x
@unpack c2, c3, c4, c5, c6, c7, c8, a21, a31, a32, a41, a42, a43, a51,

Check warning on line 373 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L371-L373

Added lines #L371 - L373 were not covered by tests
a52, a53, a54, a61, a62, a63, a64, a65, a71, a72, a73, a74, a75, a76, a81, a82, a83, a84, a85, a86, a87,
abar21, abar31, abar32, abar41, abar42, abar43, abar51,
abar52, abar53, abar54, abar61, abar62, abar63, abar64, abar65,
abar71, abar72, abar73, abar74, abar75, abar76, abar81, abar82, abar83, abar84, abar85, abar86, abar87, b1, b2, b3, b4,
b5, b6, b7, b8, bp1, bp2, bp3, bp4, bp5, bp6, bp7, bp8, btilde1, btilde2, btilde3, btilde4, btilde5, btilde6, btilde7, btilde8, bptilde1, bptilde2, bptilde3, bptilde4,
bptilde5, bptilde6, bptilde7, bptilde8 = cache
k1 = integrator.fsalfirst.x[1]

Check warning on line 380 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L380

Added line #L380 was not covered by tests

ku = uprev + dt * (c2 * duprev + dt * (a21 * k1))
kdu = duprev + dt * (abar21 * k1)

Check warning on line 383 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L382-L383

Added lines #L382 - L383 were not covered by tests

k2 = f.f1(kdu, ku, p, t + dt * c2)
ku = uprev + dt * (c3 * duprev + dt * (a31 * k1 + a32 * k2))
kdu = duprev + dt * (abar31 * k1 + abar32 * k2)

Check warning on line 387 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L385-L387

Added lines #L385 - L387 were not covered by tests

k3 = f.f1(kdu, ku, p, t + dt * c3)
ku = uprev + dt * (c4 * duprev + dt * (a41 * k1 + a42 * k2 + a43 * k3))
kdu = duprev + dt * (abar41 * k1 + abar42 * k2 + abar43 * k3)

Check warning on line 391 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L389-L391

Added lines #L389 - L391 were not covered by tests

k4 = f.f1(kdu, ku, p, t + dt * c4)
ku = uprev + dt * (c5 * duprev + dt * (a51 * k1 + a52 * k2 + a53 * k3 + a54 * k4))
kdu = duprev + dt * (abar51 * k1 + abar52 * k2 + abar53 * k3 + abar54 * k4)

Check warning on line 395 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L393-L395

Added lines #L393 - L395 were not covered by tests

k5 = f.f1(kdu, ku, p, t + dt * c5)
ku = uprev +

Check warning on line 398 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L397-L398

Added lines #L397 - L398 were not covered by tests
dt * (c6 * duprev + dt * (a61 * k1 + a62 * k2 + a63 * k3 + a64 * k4 + a65 * k5))
kdu = duprev +

Check warning on line 400 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L400

Added line #L400 was not covered by tests
dt * (abar61 * k1 + abar62 * k2 + abar63 * k3 + abar64 * k4 + abar65 * k5)

k6 = f.f1(kdu, ku, p, t + dt * c6)
ku = uprev +

Check warning on line 404 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L403-L404

Added lines #L403 - L404 were not covered by tests
dt * (c7 * duprev +
dt * (a71 * k1 + a72 * k2 + a73 * k3 + a74 * k4 + a75 * k5 + a76 * k6))
kdu = duprev +

Check warning on line 407 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L407

Added line #L407 was not covered by tests
dt * (abar71 * k1 + abar72 * k2 + abar73 * k3 + abar74 * k4 + abar75 * k5 +
abar76 * k6)

k7 = f.f1(kdu, ku, p, t + dt * c7)
ku = uprev +

Check warning on line 412 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L411-L412

Added lines #L411 - L412 were not covered by tests
dt * (c8 * duprev +
dt * (a81 * k1 + a82 * k2 + a83 * k3 + a84 * k4 + a85 * k5 + a86 * k6 + a87 * k7))
kdu = duprev +

Check warning on line 415 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L415

Added line #L415 was not covered by tests
dt * (abar81 * k1 + abar82 * k2 + abar83 * k3 + abar84 * k4 + abar85 * k5 +
abar86 * k6 + abar87 * k7)

k8 = f.f1(kdu, ku, p, t + dt * c8)
u = uprev +

Check warning on line 420 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L419-L420

Added lines #L419 - L420 were not covered by tests
dt * (duprev +
dt *
(b1 * k1 + b2 * k2 + b3 * k3 + b4 * k4 + b5 * k5 + b6 * k6 + b7 * k7 + b8 * k8))
du = duprev +

Check warning on line 424 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L424

Added line #L424 was not covered by tests
dt * (bp1 * k1 + bp2 * k2 + bp3 * k3 + bp4 * k4 + bp5 * k5 + bp6 * k6 + bp7 * k7 +
bp8 * k8)

integrator.u = ArrayPartition((du, u))
integrator.fsallast = ArrayPartition((f.f1(du, u, p, t + dt), f.f2(du, u, p, t + dt)))
integrator.stats.nf += 8
integrator.stats.nf2 += 1
integrator.k[1] = integrator.fsalfirst
integrator.k[2] = integrator.fsallast

Check warning on line 433 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L428-L433

Added lines #L428 - L433 were not covered by tests

#if integrator.opts.adaptive
# dtsq = dt^2
# uhat = dtsq *
# (btilde1 * k1 + btilde3 * k3 + btilde4 * k4 + btilde5 * k5 + btilde6 * k6 +
# btilde7 * k7 + btilde8 * k8)
# duhat = dt * (bptilde1 * k1 + bptilde3 * k3 + bptilde4 * k4 + bptilde5 * k5 +
# bptilde6 * k6 + bptilde7 * k7 + bptilde8 * k8)
# utilde = ArrayPartition((duhat, uhat))
# atmp = calculate_residuals(utilde, integrator.uprev, integrator.u,
# integrator.opts.abstol, integrator.opts.reltol,
# integrator.opts.internalnorm, t)
# integrator.EEst = integrator.opts.internalnorm(atmp, t)
#end
end

@muladd function perform_step!(integrator, cache::SharpFineRKN6Cache, repeat_step = false)
@unpack t, dt, f, p = integrator
du, u = integrator.u.x
duprev, uprev = integrator.uprev.x
@unpack tmp, atmp, fsalfirst, k2, k3, k4, k5, k6, k7, k8, k, utilde = cache
@unpack c1, c2, c3, c4, c5, c6, c7, c8, a21, a31, a32, a41, a42, a43, a51,

Check warning on line 455 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L450-L455

Added lines #L450 - L455 were not covered by tests
a52, a53, a54, a61, a62, a63, a64, a65, a71, a72, a73, a74, a75, a76, a81, a82, a83, a84, a85, a86, a87,
abar21, abar31, abar32, abar41, abar42, abar43, abar51,
abar52, abar53, abar54, abar61, abar62, abar63, abar64, abar65,
abar71, abar72, abar73, abar74, abar75, abar76, abar81, abar82, abar83, abar84, abar85, abar86, abar87, b1, b2, b3, b4,
b5, b6, b7, b8, bp1, bp2, bp3, bp4, bp5, bp6, bp7, bp8, btilde1, btilde2, btilde3, btilde4, btilde5, btilde6, btilde7, btilde8, bptilde1, bptilde2, bptilde3, bptilde4,
bptilde5, bptilde6, bptilde7, bptilde8 = cache.tab
kdu, ku = integrator.cache.tmp.x[1], integrator.cache.tmp.x[2]
uidx = eachindex(integrator.uprev.x[2])
k1 = integrator.fsalfirst.x[1]

Check warning on line 464 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L462-L464

Added lines #L462 - L464 were not covered by tests

@.. broadcast=false ku=uprev + dt * (c2 * duprev + dt * (a21 * k1))
@.. broadcast=false kdu=duprev + dt * (abar21 * k1)

Check warning on line 467 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L466-L467

Added lines #L466 - L467 were not covered by tests

f.f1(k2, kdu, ku, p, t + dt * c2)
@.. broadcast=false ku=uprev + dt * (c3 * duprev + dt * (a31 * k1 + a32 * k2))
@.. broadcast=false kdu=duprev + dt * (abar31 * k1 + abar32 * k2)

Check warning on line 471 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L469-L471

Added lines #L469 - L471 were not covered by tests

f.f1(k3, kdu, ku, p, t + dt * c3)
@.. broadcast=false ku=uprev +

Check warning on line 474 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L473-L474

Added lines #L473 - L474 were not covered by tests
dt * (c4 * duprev + dt * (a41 * k1 + a42 * k2 + a43 * k3))
@.. broadcast=false kdu=duprev + dt * (abar41 * k1 + abar42 * k2 + abar43 * k3)

Check warning on line 476 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L476

Added line #L476 was not covered by tests

f.f1(k4, kdu, ku, p, t + dt * c4)
@.. broadcast=false ku=uprev +

Check warning on line 479 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L478-L479

Added lines #L478 - L479 were not covered by tests
dt *
(c5 * duprev + dt * (a51 * k1 + a52 * k2 + a53 * k3 + a54 * k4))
@.. broadcast=false kdu=duprev +

Check warning on line 482 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L482

Added line #L482 was not covered by tests
dt * (abar51 * k1 + abar52 * k2 + abar53 * k3 + abar54 * k4)

f.f1(k5, kdu, ku, p, t + dt * c5)
@.. broadcast=false ku=uprev +

Check warning on line 486 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L485-L486

Added lines #L485 - L486 were not covered by tests
dt * (c6 * duprev +
dt * (a61 * k1 + a62 * k2 + a63 * k3 + a64 * k4 + a65 * k5))
@.. broadcast=false kdu=duprev +

Check warning on line 489 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L489

Added line #L489 was not covered by tests
dt * (abar61 * k1 + abar62 * k2 + abar63 * k3 + abar64 * k4 +
abar65 * k5)

f.f1(k6, kdu, ku, p, t + dt * c6)
@.. broadcast=false ku=uprev +

Check warning on line 494 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L493-L494

Added lines #L493 - L494 were not covered by tests
dt * (c7 * duprev +
dt * (a71 * k1 + a72 * k2 + a73 * k3 + a74 * k4 + a75 * k5 +
a76 * k6))
@.. broadcast=false kdu=duprev +

Check warning on line 498 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L498

Added line #L498 was not covered by tests
dt * (abar71 * k1 + abar72 * k2 + abar73 * k3 + abar74 * k4 +
abar75 * k5 + abar76 * k6)

f.f1(k7, kdu, ku, p, t + dt * c7)
@.. broadcast=false ku=uprev +

Check warning on line 503 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L502-L503

Added lines #L502 - L503 were not covered by tests
dt * (c8 * duprev +
dt * (a81 * k1 + a82 * k2 + a83 * k3 + a84 * k4 + a85 * k5 +
a86 * k6 + a87 * k7))
@.. broadcast=false kdu=duprev +

Check warning on line 507 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L507

Added line #L507 was not covered by tests
dt * (abar81 * k1 + abar82 * k2 + abar83 * k3 + abar84 * k4 +
abar85 * k5 +
abar86 * k6 + abar87 * k7)

f.f1(k8, kdu, ku, p, t + dt * c8)
@.. broadcast=false u=uprev +

Check warning on line 513 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L512-L513

Added lines #L512 - L513 were not covered by tests
dt * (duprev +
dt *
(b1 * k1 + b2 * k2 + b3 * k3 + b4 * k4 + b5 * k5 + b6 * k6 +
b7 * k7 + b8 * k8))
@.. broadcast=false du=duprev +

Check warning on line 518 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L518

Added line #L518 was not covered by tests
dt *
(bp1 * k1 + bp2 * k2 + bp3 * k3 + bp4 * k4 + bp5 * k5 +
bp6 * k6 + bp7 * k7 + bp8 * k8)

f.f1(k.x[1], du, u, p, t + dt)
f.f2(k.x[2], du, u, p, t + dt)
integrator.stats.nf += 8
integrator.stats.nf2 += 1

Check warning on line 526 in src/perform_step/rkn_perform_step.jl

View check run for this annotation

Codecov / codecov/patch

src/perform_step/rkn_perform_step.jl#L523-L526

Added lines #L523 - L526 were not covered by tests
#if integrator.opts.adaptive
# duhat, uhat = utilde.x
# dtsq = dt^2
# @.. broadcast=false uhat=dtsq *
# (btilde1 * k1 + btilde3 * k3 + btilde4 * k4 +
# btilde5 * k5 + btilde6 * k6 + btilde7 * k7 + btilde8 * k8)
# @.. broadcast=false duhat=dt *
# (bptilde1 * k1 + bptilde3 * k3 + bptilde4 * k4 +
# bptilde5 * k5 + bptilde6 * k6 + bptilde7 * k7 +
# bptilde8 * k8)

# calculate_residuals!(atmp, utilde, integrator.uprev, integrator.u,
# integrator.opts.abstol, integrator.opts.reltol,
# integrator.opts.internalnorm, t)
# integrator.EEst = integrator.opts.internalnorm(atmp, t)
#end
end

@muladd function perform_step!(integrator, cache::Nystrom4VelocityIndependentConstantCache,
repeat_step = false)
@unpack t, dt, f, p = integrator
Expand Down
Loading
Loading