Skip to content

Commit 4a6bce8

Browse files
Merge pull request #3980 from AayushSabharwal/as/fix-scc-nonlinear-problem
refactor: remove dead code calling explicitfun in `SCCNonlinearProblem`
2 parents 4afaebb + 7caa3bd commit 4a6bce8

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/problems/sccnonlinearproblem.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ function SciMLBase.SCCNonlinearProblem{iip}(sys::System, op; eval_expression = f
266266
_u0 = SymbolicUtils.Code.create_array(
267267
typeof(u0), eltype(u0), Val(1), Val(length(vscc)), u0[vscc]...)
268268
symbolic_idxs = findall(x -> symbolic_type(x) != NotSymbolic(), _u0)
269-
explicitfuns[i](p, subprobs)
270269
if f isa LinearFunction
271270
_u0 = isempty(symbolic_idxs) ? _u0 : zeros(u0_eltype, length(_u0))
272271
_u0 = u0_eltype.(_u0)

test/scc_nonlinear_problem.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,10 @@ end
179179
0 ~ func(x[1], x[2]) * exp(x[3]) - x[4]^3 - 5
180180
0 ~ func(x[1], x[2]) * exp(x[4]) - x[3]^3 - 4])
181181
sccprob = SCCNonlinearProblem(sys, [])
182-
# since explicitfuns are called during problem construction
183-
@test val[] == 1
182+
@test val[] == 0
184183
sccsol = solve(sccprob, NewtonRaphson())
185184
@test SciMLBase.successful_retcode(sccsol)
186-
@test val[] == 2
185+
@test val[] == 1
187186
end
188187

189188
import ModelingToolkitStandardLibrary.Blocks as B

0 commit comments

Comments
 (0)