Skip to content

Commit e26cd99

Browse files
re format
1 parent 5789fe8 commit e26cd99

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

lib/SCCNonlinearSolve/test/core_tests.jl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,29 @@ end
2525
du[1] = cos(u[2]) - u[1]
2626
du[2] = sin(u[1] + u[2]) + u[2]
2727
end
28-
explicitfun1(cache,sols) = nothing
29-
prob1 = NonlinearProblem(NonlinearFunction{true, SciMLBase.NoSpecialize}(f1), zeros(2), cache)
28+
explicitfun1(cache, sols) = nothing
29+
prob1 = NonlinearProblem(
30+
NonlinearFunction{true, SciMLBase.NoSpecialize}(f1), zeros(2), cache)
3031
sol1 = solve(prob1, NewtonRaphson())
3132

3233
function f2(du, u, (cache, p))
3334
du[1] = 2u[2] + u[1] + 1.0
3435
du[2] = u[3]^2 + u[2]
3536
du[3] = u[1]^2 + u[3]
3637
end
37-
explicitfun2(cache,sols) = nothing
38-
prob2 = NonlinearProblem(NonlinearFunction{true, SciMLBase.NoSpecialize}(f2), zeros(3), cache)
38+
explicitfun2(cache, sols) = nothing
39+
prob2 = NonlinearProblem(
40+
NonlinearFunction{true, SciMLBase.NoSpecialize}(f2), zeros(3), cache)
3941
sol2 = solve(prob2, NewtonRaphson())
4042

4143
function f3(du, u, (cache, p))
4244
du[1] = cache[1] + 2.0u[1] + 2.5u[2] + 1.5u[3]
4345
du[2] = cache[2] + 4.0u[1] - 1.5u[2] + 1.5u[3]
4446
du[3] = cache[3] + +u[1] - u[2] - u[3]
4547
end
46-
prob3 = NonlinearProblem(NonlinearFunction{true, SciMLBase.NoSpecialize}(f3), zeros(3), cache)
47-
function explicitfun3(cache,sols)
48+
prob3 = NonlinearProblem(
49+
NonlinearFunction{true, SciMLBase.NoSpecialize}(f3), zeros(3), cache)
50+
function explicitfun3(cache, sols)
4851
cache[1] = sols[1][1] + sols[1][2] + sols[2][1] + sols[2][2] + sols[2][3]
4952
cache[2] = sols[1][1] + sols[1][2] + sols[2][1] + 2.0sols[2][2] + sols[2][3]
5053
cache[3] = sols[1][1] + 2.0sols[1][2] + 3.0sols[2][1] + 5.0sols[2][2] +
@@ -54,7 +57,8 @@ end
5457
sol3 = solve(prob3, NewtonRaphson())
5558
manualscc = [sol1; sol2; sol3]
5659

57-
sccprob = SciMLBase.SCCNonlinearProblem([prob1,prob2,prob3], SciMLBase.Void{Any}.([explicitfun1,explicitfun2,explicitfun3]))
60+
sccprob = SciMLBase.SCCNonlinearProblem([prob1, prob2, prob3],
61+
SciMLBase.Void{Any}.([explicitfun1, explicitfun2, explicitfun3]))
5862
scc_sol = solve(sccprob, NewtonRaphson())
5963
@test sol manualscc scc_sol
6064
end

0 commit comments

Comments
 (0)