-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Issue with OrdinaryDiffEq.jl when using an ArrayPartition of Arrays of StaticArrays #212
Comments
eltype
for ArrayPartition of StructArrays eltype
for ArrayPartition of Arrays of StructArrays
eltype
for ArrayPartition of Arrays of StructArrays
Note to self: the issue disappears when specifying an initial @.. broadcast=false sk = abstol+internalnorm(u0,t)*reltol If Since the However, manually defining an ArrayPartition of |
Yeah, I think we need to extend the ArrayPartition broadcast overload so that will generate an ArrayPartition{SVector}. |
Turns out this is just because the constructor used in the example calls using StaticArrays, RecursiveArrayTools
u1 = [SVector{2, Float64}(1,2) for _ in 1:5]
u2 = zeros(SVector{2, Float64}, (2, 2))
args = (u1, u2)
u = ArrayPartition{eltype(u1), typeof(args)}(args)
du = similar(u)
du .= u I'm OK to close this if you are. EDIT: nevermind, this doesn't fix the original issue |
So you're saying Arrays of StaticArrays are fine in the differential equation solve? That's what I would have expected since there are tests covering it. I'm not sure what the StructArray is doing in the first example? |
Oops, I copied and pasted the wrong example code. StructArrays were just in the MWE for similarity to the full application. Switching to the other constructor fixed an unrelated issue, so scratch the previous comment. |
I'm confused as to what the problem is and whether it's solved 😅 |
Sorry - to clarify, the problem remains. I solved an unrelated issue recently, and it'd been too long since I looked at this and thought I'd solved it too. |
OrdinaryDiffEq.jl has an issue with ArrayPartitions constructed from nested arrays of StaticArrays. The following MWE
yields the stacktrace
I'm not sure but this seems to be related to the fact that
eltype
of ArrayPartitions ofAbstractArray{<:StaticArray{N,T}}
isT
rather thanStaticArray{N,T}
.The text was updated successfully, but these errors were encountered: