Skip to content

Commit

Permalink
chore: apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
avik-pal and github-actions[bot] authored Oct 1, 2024
1 parent fc7fcdb commit 973dd1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/src/basics/sparsity_detection.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ If the `colorvec` is not provided, then it is computed on demand.
row colorvec.

!!! warning

Previously you could provide a `sparsity` argument to `NonlinearFunction` to specify
the jacobian prototype. However, to avoid confusion, this is now deprecated. Instead,
use the `jac_prototype` argument.
Expand All @@ -58,7 +58,7 @@ sparsity detection algorithms.
## Case III: Sparse AD Type is being Used

!!! warning

This is now deprecated. Please use the previous two cases instead.

If you constructed a Nonlinear Solver with a sparse AD type, for example
Expand Down
18 changes: 9 additions & 9 deletions docs/src/tutorials/large_systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ equation (BRUSS) using NonlinearSolve.jl.
## Definition of the Brusselator Equation

!!! note

Feel free to skip this section: it simply defines the example problem.

The Brusselator PDE is defined as follows:
Expand Down Expand Up @@ -117,11 +117,11 @@ However, if you know the sparsity of your problem, then you can pass a different
type. For example, a `SparseMatrixCSC` will give a sparse matrix. Other sparse matrix types
include:

- Bidiagonal
- Tridiagonal
- SymTridiagonal
- BandedMatrix ([BandedMatrices.jl](https://github.com/JuliaLinearAlgebra/BandedMatrices.jl))
- BlockBandedMatrix ([BlockBandedMatrices.jl](https://github.com/JuliaLinearAlgebra/BlockBandedMatrices.jl))
- Bidiagonal
- Tridiagonal
- SymTridiagonal
- BandedMatrix ([BandedMatrices.jl](https://github.com/JuliaLinearAlgebra/BandedMatrices.jl))
- BlockBandedMatrix ([BlockBandedMatrices.jl](https://github.com/JuliaLinearAlgebra/BlockBandedMatrices.jl))

## Approximate Sparsity Detection & Sparse Jacobians

Expand Down Expand Up @@ -167,7 +167,7 @@ and `u` and call `jacobian_sparsity` on our function with the example arguments,
kick out a sparse matrix with our pattern, that we can turn into our `jac_prototype`.

!!! tip

Alternatively you can use the `SparseConnectivityTracer.jl` package to automatically
generate a sparse Jacobian.

Expand Down Expand Up @@ -224,7 +224,7 @@ choices, see the
`linsolve` choices are any valid [LinearSolve.jl](https://linearsolve.sciml.ai/dev/) solver.

!!! note

Switching to a Krylov linear solver will automatically change the nonlinear problem
solver into Jacobian-free mode, dramatically reducing the memory required. This can be
overridden by adding `concrete_jac=true` to the algorithm.
Expand Down Expand Up @@ -330,7 +330,7 @@ prob_brusselator_2d_exact_tracer = NonlinearProblem(
u0, p; abstol = 1e-10, reltol = 1e-10)
prob_brusselator_2d_approx_di = NonlinearProblem(
NonlinearFunction(brusselator_2d_loop;
sparsity = DenseSparsityDetector(AutoForwardDiff(); atol=1e-4)),
sparsity = DenseSparsityDetector(AutoForwardDiff(); atol = 1e-4)),
u0, p; abstol = 1e-10, reltol = 1e-10)
@btime solve(prob_brusselator_2d_exact_symbolics, NewtonRaphson());
Expand Down

0 comments on commit 973dd1f

Please sign in to comment.