Skip to content

Commit 540fded

Browse files
committed
Fix small type consistency bug in presolver
Only affects AD types in certain cases.
1 parent 3695e16 commit 540fded

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sfccsolvers/presolver.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ function initialize!(solver::SFCCPreSolver{<:SFCCPreSolverCache1D}, fc::SFCC, hc
9494
# return residual of error with target error
9595
return err
9696
end
97-
T = [Tmin]
97+
# multiply by one(ustrip(Hmin)) to ensure type consistency (e.g. for AD types)
98+
T = [Tmin*one(ustrip(Hmin))]
9899
H = [Hmin]
99100
θw = [f(T[1])]
100101
∂θw∂T₀, ∂θw∂H₀ = deriv(T[1])

0 commit comments

Comments
 (0)