Skip to content
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

Remove uses of NLsolve #2081

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Remove uses of NLsolve #2081

merged 1 commit into from
Dec 14, 2023

Conversation

avik-pal
Copy link
Member

No description provided.

src/initialize_dae.jl Outdated Show resolved Hide resolved
@avik-pal avik-pal force-pushed the ap/nlsolve_break branch 2 times, most recently from 14d5263 to 668129a Compare December 12, 2023 03:47
@avik-pal
Copy link
Member Author

failures seem to be same as master

@@ -564,7 +563,7 @@ function _initialize_dae!(integrator, prob::DAEProblem,
if alg.nlsolve !== nothing
nlsolve = alg.nlsolve
else
nlsolve = NewtonRaphson(autodiff = isAD)
nlsolve = NewtonRaphson(autodiff = alg_autodiff(integrator.alg))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep it as type information now that we can use it effectively.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does alg_autodiff give? Can it give bool?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it changes the type level stuff to a bool as backwards compat support IIRC

Copy link
Member Author

@avik-pal avik-pal Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function alg_autodiff(alg)
    autodiff = _alg_autodiff(alg)
    if autodiff == Val(false)
        return AutoFiniteDiff()
    elseif autodiff == Val(true)
        return AutoForwardDiff()
    else
        return _unwrap_val(autodiff)
    end
end

This should constant propagate and give the correct AD type right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't rely on constant propagation. It can fail. But let's pull this in and make this better in a follow up.

@ChrisRackauckas ChrisRackauckas merged commit 03b8ad0 into master Dec 14, 2023
45 of 59 checks passed
@ChrisRackauckas ChrisRackauckas deleted the ap/nlsolve_break branch December 14, 2023 06:05
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