Commit 9355a23
committed
Fix MIRKN nlprob u0 inference + add issue 484 regression test
PR #473 already landed the equivalent fixes for MIRK and FIRK
(`copy(vec(cache.y₀))` in `__perform_*_iteration`, plus mesh-selection
and resize fixes), but missed the same `vec(::VectorOfArray)`
inference cliff in MIRKN's `__perform_mirkn_iteration`.
Under RecursiveArrayTools v4, `vec(::VectorOfArray)` returns a
`Base.ReshapedArray{T, 1, VectorOfArray{...}, …}` instead of a plain
`Vector`. NonlinearSolve's polyalg cannot infer `T, N, uType, R` of
the resulting `NonlinearSolution` when `u0` has that shape, so
`@inferred solve(::SecondOrderBVProblem, ::MIRKN, …)` would widen
the result type the same way it did for MIRK before #473. Mirror
PR #473's fix:
nlprob = __construct_nlproblem(cache, vec(cache.y₀), copy(cache.y₀))
→
nlprob = __construct_nlproblem(cache, copy(vec(cache.y₀)), copy(cache.y₀))
Bumps `BoundaryValueDiffEqMIRKN` patch to 1.15.1.
Also adds a regression `@testitem` for issue #484 (the original
adaptive-mesh-refinement `UndefRefError`) using the torus-geodesic
BVP from the issue.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>1 parent 6e37525 commit 9355a23
3 files changed
Lines changed: 38 additions & 2 deletions
File tree
- lib
- BoundaryValueDiffEqMIRKN
- src
- BoundaryValueDiffEqMIRK/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
0 commit comments