Skip to content

Commit bbfdae2

Browse files
format
1 parent f0b8470 commit bbfdae2

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

docs/src/implicit/PDIRK.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ these matrices can be factorized and the underlying steps can be computed in par
1818
which is why these are the parallel DIRK methods.
1919

2020
!!! warning "Experimental"
21-
21+
2222
`OrdinaryDiffEqPDIRK` is experimental,
2323
as there are no parallel DIRK tableaus that achieve good performance in the literature.
2424

lib/OrdinaryDiffEqCore/src/caches/basic_caches.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mutable struct CompositeCache{T, F} <: OrdinaryDiffEqCache
1313
current::Int
1414
end
1515

16-
function get_fsalfirstlast(cache::CompositeCache, u)
16+
function get_fsalfirstlast(cache::CompositeCache, u)
1717
_x = get_fsalfirstlast(cache.caches[1], u)
1818
if first(_x) !== nothing
1919
return _x

lib/OrdinaryDiffEqCore/src/interp_func.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ function SciMLBase.strip_interpolation(id::InterpolationData)
7575
end
7676

7777
function strip_cache(cache)
78-
if hasfield(typeof(cache), :jac_config) || hasfield(typeof(cache), :grad_config) || hasfield(typeof(cache), :nlsolver)
78+
if hasfield(typeof(cache), :jac_config) || hasfield(typeof(cache), :grad_config) ||
79+
hasfield(typeof(cache), :nlsolver)
7980
fieldnums = length(fieldnames(typeof(cache)))
8081
noth_list = fill(nothing, fieldnums)
8182
cache_type_name = Base.typename(typeof(cache)).wrapper
@@ -84,4 +85,3 @@ function strip_cache(cache)
8485
cache
8586
end
8687
end
87-

lib/OrdinaryDiffEqRosenbrock/src/rosenbrock_caches.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ abstract type RosenbrockConstantCache <: OrdinaryDiffEqConstantCache end
44

55
# Fake values since non-FSAL
66
get_fsalfirstlast(cache::RosenbrockMutableCache, u) = (nothing, nothing)
7-
get_fsalfirstlast(cache::GenericRosenbrockMutableCache, u) = (cache.fsalfirst, cache.fsallast)
7+
function get_fsalfirstlast(cache::GenericRosenbrockMutableCache, u)
8+
(cache.fsalfirst, cache.fsallast)
9+
end
810

911
################################################################################
1012

test/interface/get_du.jl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,25 @@ function lorenz!(du, u, p, t)
66
end
77
u0 = [1.0; 0.0; 0.0]
88
tspan = (0.0, 3.0)
9-
condition(u,t,integrator) = t == 0.2
9+
condition(u, t, integrator) = t == 0.2
1010
cache = zeros(3)
1111
affect!(integrator) = cache .= get_du(integrator)
1212
dusave = DiscreteCallback(condition, affect!)
1313
affect2!(integrator) = get_du!(cache, integrator)
1414
dusave_inplace = DiscreteCallback(condition, affect2!)
1515

1616
prob = ODEProblem(lorenz!, u0, tspan)
17-
sol = solve(prob, Tsit5(), tstops = [0.2], callback = dusave, abstol=1e-12, reltol=1e-12)
17+
sol = solve(
18+
prob, Tsit5(), tstops = [0.2], callback = dusave, abstol = 1e-12, reltol = 1e-12)
1819
res = copy(cache)
1920

20-
for alg in [Vern6(), Vern7(), Vern8(), Vern9(), Rodas4(), Rodas4P(), Rodas5(), Rodas5P(), TRBDF2(), KenCarp4(), FBDF(), QNDF()]
21-
sol = solve(prob, alg, tstops = [0.2], callback = dusave, abstol=1e-12, reltol=1e-12)
22-
@test res cache rtol=1e-5
21+
for alg in [Vern6(), Vern7(), Vern8(), Vern9(), Rodas4(), Rodas4P(),
22+
Rodas5(), Rodas5P(), TRBDF2(), KenCarp4(), FBDF(), QNDF()]
23+
sol = solve(
24+
prob, alg, tstops = [0.2], callback = dusave, abstol = 1e-12, reltol = 1e-12)
25+
@test rescache rtol=1e-5
2326

24-
sol = solve(prob, alg, tstops = [0.2], callback = dusave_inplace, abstol=1e-12, reltol=1e-12)
25-
@test res cache rtol=1e-5
27+
sol = solve(prob, alg, tstops = [0.2], callback = dusave_inplace,
28+
abstol = 1e-12, reltol = 1e-12)
29+
@test rescache rtol=1e-5
2630
end

0 commit comments

Comments
 (0)