Skip to content

Commit e2a4b31

Browse files
fix: handle u0 provided as StaticArray with no u0_constructor
1 parent 76d022a commit e2a4b31

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/systems/problem_utils.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,10 @@ function process_SciMLProblem(
774774
op, missing_unknowns, missing_pars = build_operating_point!(sys,
775775
u0map, pmap, defs, cmap, dvs, ps)
776776

777+
if u0_constructor === identity && u0Type <: StaticArray
778+
u0_constructor = vals -> SymbolicUtils.Code.create_array(
779+
u0Type, eltype(vals), Val(1), Val(length(vals)), vals...)
780+
end
777781
if build_initializeprob
778782
kws = maybe_build_initialization_problem(
779783
sys, op, u0map, pmap, t, defs, guesses, missing_unknowns;

0 commit comments

Comments
 (0)