Skip to content

Flattened arrays at the output of a DifferentialEquations solver #79

@JordiBolibar

Description

@JordiBolibar

I’m solving a PDE on a Matrix directly with ComponentArray, but I’m getting flattened solutions at the output (1-dimensional).

p = (Γ, Δx, Δy, η)
u₀ = ComponentArray(H=H₀, B=B) # H and B are Matrices with size (193, 189)
tspan = (0.0, 10.0)
# Create ODE problem based on the SIA
SIA_prob = ODEProblem(iceflow!, u₀, tspan, p)
# Solve the SIA 
SIA_sol = solve(SIA_prob, Tsit5())

And when I do:
println(size(SIA_sol.u[end]))
Instead of getting (193, 189), I get:
(72954,)
Which corresponds to the two matrices contained in u (H and B), flattened and concatenated.

Is this an expected behaviour? Shouldn't the same dimensions from the input be preserved?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions