Skip to content

Commit d11a29b

Browse files
Fix more RAT-v4 iteration semantics misses
Three more spots that iterate or index `AbstractVectorOfArray` with pre-RAT-v4 semantics, surfaced by CI on the previous commit: 1. `lib/BoundaryValueDiffEqMIRK/src/adaptivity.jl:39,93,148` — `[maximum(abs, d) for d in errors]` where `cache.errors` is a `VectorOfArray`. Under RAT v4 this iterates **scalars**, producing a `Vector{Float64}` of length `prod(size(errors))` instead of one entry per timestep, which then fails `ŝ ./= mesh_dt` with `DimensionMismatch`. Fix: iterate `errors.u`. (Lines 204–205 already had this fix.) 2. `lib/BoundaryValueDiffEqFIRK/src/adaptivity.jl:263` — identical pattern with `defect`. 3. `lib/BoundaryValueDiffEqShooting/src/multiple_shooting.jl:531-532` — `length(first(u0_))` / `similar(first(u0_), …)` where `u0_` is the `VectorOfArray` returned by `__initial_guess_on_mesh`. Under RAT v4 `first(u0_)` is the first scalar, so `similar(::Float64, ::Int)` throws `MethodError`. Fix: `first(u0_.u)`. Bumps MIRK / FIRK / Shooting patch versions to 1.16.1. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
1 parent 6c1eac1 commit d11a29b

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

lib/BoundaryValueDiffEqFIRK/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BoundaryValueDiffEqFIRK"
22
uuid = "85d9eb09-370e-4000-bb32-543851f73618"
3-
version = "1.16.0"
3+
version = "1.16.1"
44

55
[deps]
66
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

lib/BoundaryValueDiffEqFIRK/src/adaptivity.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Generate new mesh based on the defect.
260260

261261
info = ReturnCode.Success
262262

263-
= [maximum(abs, d) for d in defect] # Broadcasting breaks GPU Compilation
263+
= [maximum(abs, d) for d in defect.u] # Broadcasting breaks GPU Compilation
264264
ŝ .= (ŝ ./ abstol) .^ (T(1) / (order + 1))
265265
r₁ = maximum(ŝ)
266266
r₂ = sum(ŝ)

lib/BoundaryValueDiffEqMIRK/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BoundaryValueDiffEqMIRK"
22
uuid = "1a22d4ce-7765-49ea-b6f2-13c8438986a6"
3-
version = "1.16.0"
3+
version = "1.16.1"
44

55
[deps]
66
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

lib/BoundaryValueDiffEqMIRK/src/adaptivity.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Generate new mesh based on the defect or the global error.
3636

3737
info = ReturnCode.Success
3838

39-
= [maximum(abs, d) for d in errors] # Broadcasting breaks GPU Compilation
39+
= [maximum(abs, d) for d in errors.u] # Broadcasting breaks GPU Compilation
4040
ŝ .= (ŝ ./ abstol) .^ (T(1) / (order + 1))
4141
r₁ = maximum(ŝ)
4242
r₂ = sum(ŝ)
@@ -90,7 +90,7 @@ end
9090

9191
info = ReturnCode.Success
9292

93-
= [maximum(abs, d) for d in errors]
93+
= [maximum(abs, d) for d in errors.u]
9494
ŝ .= (ŝ ./ abstol) .^ (T(1) / order)
9595
r₁ = maximum(ŝ)
9696
r₂ = sum(ŝ)
@@ -145,7 +145,7 @@ end
145145

146146
info = ReturnCode.Success
147147

148-
= [maximum(abs, d) for d in errors]
148+
= [maximum(abs, d) for d in errors.u]
149149
ŝ .= (ŝ ./ abstol) .^ (T(1) / (order + 1))
150150
r₁ = maximum(ŝ)
151151
r₂ = sum(ŝ)

lib/BoundaryValueDiffEqShooting/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BoundaryValueDiffEqShooting"
22
uuid = "ed55bfe0-3725-4db6-871e-a1dc9f42a757"
3-
version = "1.16.0"
3+
version = "1.16.1"
44

55
[deps]
66
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

lib/BoundaryValueDiffEqShooting/src/multiple_shooting.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,8 @@ end
528528
nodes .= range(tspan[1], tspan[2]; length = nshoots + 1)
529529
u0_ = __initial_guess_on_mesh(u0, nodes, p)
530530

531-
N = length(first(u0_))
532-
u_at_nodes = similar(first(u0_), (nshoots + 1) * N)
531+
N = length(first(u0_.u))
532+
u_at_nodes = similar(first(u0_.u), (nshoots + 1) * N)
533533
recursive_flatten!(u_at_nodes, u0_.u)
534534

535535
return u_at_nodes

0 commit comments

Comments
 (0)