Skip to content

Commit 92f984d

Browse files
committed
Format
1 parent 775a78c commit 92f984d

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

docs/src/tutorials/large_systems.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ using BenchmarkTools # for @btime
139139
@btime solve(prob_brusselator_2d,
140140
NewtonRaphson(; autodiff = AutoSparse(AutoForwardDiff(; chunksize = 32))));
141141
@btime solve(prob_brusselator_2d,
142-
NewtonRaphson(;
143-
autodiff = AutoSparse(AutoForwardDiff(; chunksize = 32)), linsolve = KLUFactorization()));
142+
NewtonRaphson(; autodiff = AutoSparse(AutoForwardDiff(; chunksize = 32)),
143+
linsolve = KLUFactorization()));
144144
@btime solve(prob_brusselator_2d,
145-
NewtonRaphson(;
146-
autodiff = AutoSparse(AutoForwardDiff(; chunksize = 32)), linsolve = KrylovJL_GMRES()));
145+
NewtonRaphson(; autodiff = AutoSparse(AutoForwardDiff(; chunksize = 32)),
146+
linsolve = KrylovJL_GMRES()));
147147
nothing # hide
148148
```
149149

src/adtypes.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,17 @@ Sparse Version of [`AutoForwardDiff`](@ref) that uses
114114
[ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl) and the column color vector of
115115
the Jacobian Matrix to efficiently compute the Sparse Jacobian.
116116
117-
- Supports both inplace and out-of-place functions
117+
- Supports both inplace and out-of-place functions
118118
119119
For type-stability of internal operations, a positive `chunksize` must be provided.
120120
121121
### Keyword Arguments
122122
123-
- `chunksize`: Count of dual numbers that can be propagated simultaneously. Setting this
124-
number to a high value will lead to slowdowns. Use
125-
[`NonlinearSolve.pickchunksize`](@ref) to get a proper value.
126-
- `tag`: Used to avoid perturbation confusion. If set to `nothing`, we use a custom tag.
123+
- `chunksize`: Count of dual numbers that can be propagated simultaneously. Setting this
124+
number to a high value will lead to slowdowns. Use
125+
[`NonlinearSolve.pickchunksize`](@ref) to get a proper value.
126+
127+
- `tag`: Used to avoid perturbation confusion. If set to `nothing`, we use a custom tag.
127128
128129
AutoSparse(AutoZygote())
129130

src/algorithms/trust_region.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function TrustRegion(; concrete_jac = nothing, linsolve = nothing, precs = DEFAU
3333
end
3434
if isnothing(vjp_autodiff) &&
3535
autodiff isa Union{ADTypes.AutoFiniteDiff, ADTypes.AutoFiniteDifferences}
36-
# TODO: why not just ForwardMode?
36+
# TODO: why not just ForwardMode?
3737
vjp_autodiff = autodiff
3838
end
3939
trustregion = GenericTrustRegionScheme(;

src/internal/jacobian.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,10 @@ end
184184
end
185185

186186
if SciMLBase.has_colorvec(f)
187-
return PrecomputedJacobianColorvec(; jac_prototype, f.colorvec,
188-
partition_by_rows = (ad isa AutoSparse && ADTypes.mode(ad) isa ADTypes.ReverseMode))
187+
return PrecomputedJacobianColorvec(; jac_prototype,
188+
f.colorvec,
189+
partition_by_rows = (ad isa AutoSparse &&
190+
ADTypes.mode(ad) isa ADTypes.ReverseMode))
189191
else
190192
return JacPrototypeSparsityDetection(; jac_prototype)
191193
end

test/misc/bruss_tests.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@
7272
NewtonRaphson(autodiff = AutoSparse(AutoFiniteDiff())); abstol = 1e-8)
7373
@test norm(sol.resid, Inf) < 1e-8
7474

75-
cache = init(prob_brusselator_2d, NewtonRaphson(; autodiff = AutoSparse(AutoForwardDiff())))
75+
cache = init(
76+
prob_brusselator_2d, NewtonRaphson(; autodiff = AutoSparse(AutoForwardDiff())))
7677
@test maximum(cache.jac_cache.jac_cache.coloring.colorvec) == 12
7778
@test cache.jac_cache.autodiff isa AutoSparse{<:AutoForwardDiff}
7879
end

0 commit comments

Comments
 (0)