Skip to content

Keep ODEFunction fields in the FunctionWrapperSpecialize constructor - #1627

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
singhharsh1708:fws-odeproblem-keep-fields
Sep 29, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
singhharsh1708:fws-odeproblem-keep-fields

Conversation

@singhharsh1708

Copy link
Copy Markdown
Member

ODEProblem{iip, FunctionWrapperSpecialize}(f::ODEFunction, ...) now wraps f.f and keeps the function's other fields, instead of wrapping the whole ODEFunction as a plain callable and dropping mass_matrix, jac, sys and the rest.
With mass_matrix = fill(2.0, 1, 1) and du = -u, Rodas5P returned u(1) = 0.3679, the identity-mass answer, instead of 0.6065, with no error.
Passing an already wrapped f also threw UndefVarError: ff, since ff was only assigned in the unwrapped branch.
The downstream FunctionWrapperSpecialize test now covers both. On 3.56.1 the same checks drop both fields, return 0.3679 and throw.
AI Disclosure: Claude assisted with this change.

@ChrisRackauckas
ChrisRackauckas merged commit 93c3925 into SciML:master Sep 29, 2026
65 of 73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants