Skip to content

Commit

Permalink
docs: update all documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 31, 2024
1 parent eb67c22 commit 81d9765
Show file tree
Hide file tree
Showing 22 changed files with 112 additions and 87 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
Pkg.Registry.update()
# Install packages present in subdirectories
dev_pks = Pkg.PackageSpec[]
for path in ("lib/SciMLJacobianOperators", ".", "lib/SimpleNonlinearSolve", "lib/NonlinearSolveBase", "lib/BracketingNonlinearSolve")
for path in ("lib/SciMLJacobianOperators", ".", "lib/SimpleNonlinearSolve", "lib/NonlinearSolveBase", "lib/BracketingNonlinearSolve", "lib/NonlinearSolveFirstOrder", "lib/NonlinearSolveQuasiNewton", "lib/NonlinearSolveSpectralMethods")
push!(dev_pks, Pkg.PackageSpec(; path))
end
Pkg.develop(dev_pks)
Expand Down
8 changes: 7 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
NonlinearSolveBase = "be0214bd-f91f-a760-ac4e-3421ce2b2da0"
NonlinearSolveFirstOrder = "5959db7a-ea39-4486-b5fe-2dd0bf03d60d"
NonlinearSolveQuasiNewton = "9a2c21bd-3a47-402d-9113-8faf9a0ee114"
NonlinearSolveSpectralMethods = "26075421-4e9a-44e1-8bd1-420ed7ad02b2"
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
PETSc = "ace2c81b-2b5f-4b1e-a30d-d662738edfe0"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Expand Down Expand Up @@ -42,8 +45,11 @@ InteractiveUtils = "<0.0.1, 1"
LinearSolve = "2"
NonlinearSolve = "4"
NonlinearSolveBase = "1"
NonlinearSolveFirstOrder = "1"
NonlinearSolveQuasiNewton = "1"
NonlinearSolveSpectralMethods = "1"
OrdinaryDiffEqTsit5 = "1.1.0"
PETSc = "0.2"
PETSc = "0.3"
Plots = "1"
Random = "1.10"
SciMLBase = "2.4"
Expand Down
49 changes: 34 additions & 15 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
using Documenter, DocumenterCitations, DocumenterInterLinks
using NonlinearSolve, SimpleNonlinearSolve, Sundials, SteadyStateDiffEq, SciMLBase,
BracketingNonlinearSolve, NonlinearSolveBase
using SciMLJacobianOperators
import DiffEqBase

cp(joinpath(@__DIR__, "Manifest.toml"),
joinpath(@__DIR__, "src/assets/Manifest.toml"), force = true)
cp(joinpath(@__DIR__, "Project.toml"),
joinpath(@__DIR__, "src/assets/Project.toml"), force = true)
using Sundials
using NonlinearSolveBase, SciMLBase, DiffEqBase
using SimpleNonlinearSolve, BracketingNonlinearSolve
using NonlinearSolveFirstOrder, NonlinearSolveQuasiNewton, NonlinearSolveSpectralMethods
using SciMLJacobianOperators
using NonlinearSolve, SteadyStateDiffEq

cp(
joinpath(@__DIR__, "Manifest.toml"),
joinpath(@__DIR__, "src/assets/Manifest.toml");
force = true
)
cp(
joinpath(@__DIR__, "Project.toml"),
joinpath(@__DIR__, "src/assets/Project.toml");
force = true
)

include("pages.jl")

Expand All @@ -20,20 +30,29 @@ interlinks = InterLinks(

makedocs(;
sitename = "NonlinearSolve.jl",
authors = "Chris Rackauckas",
modules = [NonlinearSolve, SimpleNonlinearSolve, SteadyStateDiffEq, DiffEqBase,
Sundials, NonlinearSolveBase, SciMLBase, SciMLJacobianOperators,
BracketingNonlinearSolve],
authors = "SciML",
modules = [
NonlinearSolveBase, SciMLBase, DiffEqBase,
SimpleNonlinearSolve, BracketingNonlinearSolve,
NonlinearSolveFirstOrder, NonlinearSolveQuasiNewton, NonlinearSolveSpectralMethods,
Sundials,
SciMLJacobianOperators,
NonlinearSolve, SteadyStateDiffEq
],
clean = true,
doctest = false,
linkcheck = true,
linkcheck_ignore = ["https://twitter.com/ChrisRackauckas/status/1544743542094020615",
"https://link.springer.com/article/10.1007/s40096-020-00339-4"],
linkcheck_ignore = [
"https://twitter.com/ChrisRackauckas/status/1544743542094020615",
"https://link.springer.com/article/10.1007/s40096-020-00339-4"
],
checkdocs = :exports,
warnonly = [:missing_docs],
plugins = [bib, interlinks],
format = Documenter.HTML(assets = ["assets/favicon.ico", "assets/citations.css"],
canonical = "https://docs.sciml.ai/NonlinearSolve/stable/"),
format = Documenter.HTML(
assets = ["assets/favicon.ico", "assets/citations.css"],
canonical = "https://docs.sciml.ai/NonlinearSolve/stable/"
),
pages
)

Expand Down
2 changes: 1 addition & 1 deletion docs/src/basics/autodiff.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
!!! note

We support all backends supported by DifferentiationInterface.jl. Please refer to
the [backends page](https://gdalle.github.io/DifferentiationInterface.jl/DifferentiationInterface/stable/explanation/backends/)
the [backends page](https://juliadiff.org/DifferentiationInterface.jl/DifferentiationInterface/stable/explanation/backends/)
for more information.

## Summary of Finite Differencing Backends
Expand Down
16 changes: 10 additions & 6 deletions docs/src/basics/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ It is hard to say why your code is not fast. Take a look at the
there is type instability.

If you are using the defaults for the autodiff and your problem is not a scalar or using
static arrays, ForwardDiff will create type unstable code. See this simple example:
static arrays, ForwardDiff will create type unstable code and lead to dynamic dispatch
internally. See this simple example:

```@example type_unstable
using NonlinearSolve, InteractiveUtils
Expand Down Expand Up @@ -136,14 +137,17 @@ prob = NonlinearProblem(f, [1.0, 2.0], 2.0)
nothing # hide
```

Oh no! This is type unstable. This is because ForwardDiff.jl will chunk the jacobian
computation and the type of this chunksize can't be statically inferred. To fix this, we
directly specify the chunksize:
Ah it is still type stable. But internally since the chunksize is not statically inferred,
it will be dynamic and lead to dynamic dispatch. To fix this, we directly specify the
chunksize:

```@example type_unstable
@code_warntype solve(prob,
@code_warntype solve(
prob,
NewtonRaphson(;
autodiff = AutoForwardDiff(; chunksize = NonlinearSolve.pickchunksize(prob.u0))))
autodiff = AutoForwardDiff(; chunksize = NonlinearSolve.pickchunksize(prob.u0))
)
)
nothing # hide
```

Expand Down
34 changes: 17 additions & 17 deletions docs/src/devdocs/algorithm_helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,63 @@
## Pseudo Transient Method

```@docs
NonlinearSolve.SwitchedEvolutionRelaxation
NonlinearSolve.SwitchedEvolutionRelaxationCache
NonlinearSolveFirstOrder.SwitchedEvolutionRelaxation
NonlinearSolveFirstOrder.SwitchedEvolutionRelaxationCache
```

## Approximate Jacobian Methods

### Initialization

```@docs
NonlinearSolve.IdentityInitialization
NonlinearSolve.TrueJacobianInitialization
NonlinearSolve.BroydenLowRankInitialization
NonlinearSolveQuasiNewton.IdentityInitialization
NonlinearSolveQuasiNewton.TrueJacobianInitialization
NonlinearSolveQuasiNewton.BroydenLowRankInitialization
```

### Jacobian Structure

```@docs
NonlinearSolve.FullStructure
NonlinearSolve.DiagonalStructure
NonlinearSolveQuasiNewton.FullStructure
NonlinearSolveQuasiNewton.DiagonalStructure
```

### Jacobian Caches

```@docs
NonlinearSolve.InitializedApproximateJacobianCache
NonlinearSolveQuasiNewton.InitializedApproximateJacobianCache
```

### Reset Methods

```@docs
NonlinearSolve.NoChangeInStateReset
NonlinearSolve.IllConditionedJacobianReset
NonlinearSolveQuasiNewton.NoChangeInStateReset
NonlinearSolveQuasiNewton.IllConditionedJacobianReset
```

### Update Rules

```@docs
NonlinearSolve.GoodBroydenUpdateRule
NonlinearSolve.BadBroydenUpdateRule
NonlinearSolve.KlementUpdateRule
NonlinearSolveQuasiNewton.GoodBroydenUpdateRule
NonlinearSolveQuasiNewton.BadBroydenUpdateRule
NonlinearSolveQuasiNewton.KlementUpdateRule
```

## Levenberg Marquardt Method

```@docs
NonlinearSolve.LevenbergMarquardtTrustRegion
NonlinearSolveFirstOrder.LevenbergMarquardtTrustRegion
```

## Trust Region Method

```@docs
NonlinearSolve.GenericTrustRegionScheme
NonlinearSolveFirstOrder.GenericTrustRegionScheme
```

## Miscellaneous

```@docs
NonlinearSolve.callback_into_cache!
NonlinearSolve.concrete_jac
NonlinearSolveBase.callback_into_cache!
NonlinearSolveBase.concrete_jac
```
39 changes: 16 additions & 23 deletions docs/src/devdocs/internal_interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,43 @@
## Solvers

```@docs
NonlinearSolve.AbstractNonlinearSolveAlgorithm
NonlinearSolve.AbstractNonlinearSolveExtensionAlgorithm
NonlinearSolve.AbstractNonlinearSolveCache
NonlinearSolveBase.AbstractNonlinearSolveAlgorithm
NonlinearSolveBase.AbstractNonlinearSolveCache
```

## Descent Algorithms
## Descent Directions

```@docs
NonlinearSolve.AbstractDescentAlgorithm
NonlinearSolve.AbstractDescentCache
NonlinearSolveBase.AbstractDescentDirection
NonlinearSolveBase.AbstractDescentCache
```

## Descent Results
### Descent Results

```@docs
NonlinearSolve.DescentResult
NonlinearSolveBase.DescentResult
```

## Approximate Jacobian

```@docs
NonlinearSolve.AbstractApproximateJacobianStructure
NonlinearSolve.AbstractJacobianInitialization
NonlinearSolve.AbstractApproximateJacobianUpdateRule
NonlinearSolve.AbstractApproximateJacobianUpdateRuleCache
NonlinearSolve.AbstractResetCondition
NonlinearSolveBase.AbstractApproximateJacobianStructure
NonlinearSolveBase.AbstractJacobianInitialization
NonlinearSolveBase.AbstractApproximateJacobianUpdateRule
NonlinearSolveBase.AbstractApproximateJacobianUpdateRuleCache
NonlinearSolveBase.AbstractResetCondition
```

## Damping Algorithms

```@docs
NonlinearSolve.AbstractDampingFunction
NonlinearSolve.AbstractDampingFunctionCache
NonlinearSolveBase.AbstractDampingFunction
NonlinearSolveBase.AbstractDampingFunctionCache
```

## Trust Region

```@docs
NonlinearSolve.AbstractTrustRegionMethod
NonlinearSolve.AbstractTrustRegionMethodCache
```

## Tracing

```@docs
NonlinearSolve.AbstractNonlinearSolveTraceLevel
NonlinearSolveBase.AbstractTrustRegionMethod
NonlinearSolveBase.AbstractTrustRegionMethodCache
```
3 changes: 1 addition & 2 deletions docs/src/devdocs/jacobian.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Jacobian Wrappers

```@docs
NonlinearSolve.AbstractNonlinearSolveJacobianCache
NonlinearSolve.JacobianCache
NonlinearSolveBase.construct_jacobian_cache
```
4 changes: 2 additions & 2 deletions docs/src/devdocs/linear_solve.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Linear Solve

```@docs
NonlinearSolve.AbstractLinearSolverCache
NonlinearSolve.LinearSolverCache
NonlinearSolveBase.AbstractLinearSolverCache
NonlinearSolveBase.construct_linear_solver
```
2 changes: 1 addition & 1 deletion docs/src/devdocs/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
## Low-Rank Jacobian Operators

```@docs
NonlinearSolve.BroydenLowRankJacobian
NonlinearSolveQuasiNewton.BroydenLowRankJacobian
```
9 changes: 3 additions & 6 deletions docs/src/native/diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
These functions are not exported since the names have a potential for conflict.

```@docs
NonlinearSolve.enable_timer_outputs
NonlinearSolve.disable_timer_outputs
NonlinearSolve.@static_timeit
NonlinearSolveBase.enable_timer_outputs
NonlinearSolveBase.disable_timer_outputs
NonlinearSolveBase.@static_timeit
```

## Tracing API
Expand All @@ -17,6 +17,3 @@ TraceAll
TraceWithJacobianConditionNumber
TraceMinimal
```

For details about the arguments refer to the documentation of
[`NonlinearSolve.AbstractNonlinearSolveTraceLevel`](@ref).
2 changes: 1 addition & 1 deletion docs/src/native/solvers.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ All of the previously mentioned solvers are wrappers around the following solver
are meant for advanced users and allow building custom solvers.

```@docs
ApproximateJacobianSolveAlgorithm
QuasiNewtonAlgorithm
GeneralizedFirstOrderAlgorithm
GeneralizedDFSane
```
2 changes: 1 addition & 1 deletion lib/NonlinearSolveBase/src/abstract_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ Define custom operations on `internalcache` tightly coupled with the calling `ca
`args...` contain the sequence of caches calling into `internalcache`.
This unfortunately makes code very tightly coupled and not modular. It is recommended to not
use this functionality unless it can't be avoided (like in [`LevenbergMarquardt`](@ref)).
use this functionality unless it can't be avoided (like in `LevenbergMarquardt`).
"""
callback_into_cache!(cache, internalcache, args...) = nothing # By default do nothing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Uses the `descent` algorithm to compute the velocity and acceleration terms for
geodesic acceleration method. The velocity and acceleration terms are then combined to
compute the descent direction.
This method in its current form was developed for [`LevenbergMarquardt`](@ref). Performance
This method in its current form was developed for `LevenbergMarquardt`. Performance
for other methods are not theorectically or experimentally verified.
### Keyword Arguments
Expand Down
2 changes: 1 addition & 1 deletion lib/NonlinearSolveBase/src/timer_outputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ end
@static_timeit to name expr
Like `TimerOutputs.@timeit_debug` but has zero overhead if `TimerOutputs` is disabled via
[`NonlinearSolve.disable_timer_outputs()`](@ref).
[`NonlinearSolveBase.disable_timer_outputs()`](@ref).
"""
macro static_timeit(to, name, expr)
@static if TIMER_OUTPUTS_ENABLED
Expand Down
2 changes: 1 addition & 1 deletion lib/NonlinearSolveFirstOrder/src/levenberg_marquardt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ nonlinear systems.
should not be disabled.
For the remaining arguments, see [`GeodesicAcceleration`](@ref) and
[`NonlinearSolve.LevenbergMarquardtTrustRegion`](@ref) documentations.
[`NonlinearSolveFirstOrder.LevenbergMarquardtTrustRegion`](@ref) documentations.
"""
function LevenbergMarquardt(;
linsolve = nothing, precs = nothing,
Expand Down
4 changes: 2 additions & 2 deletions lib/NonlinearSolveFirstOrder/src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ order of convergence.
### Keyword Arguments
- `trustregion`: Globalization using a Trust Region Method. This needs to follow the
[`NonlinearSolve.AbstractTrustRegionMethod`](@ref) interface.
[`NonlinearSolveBase.AbstractTrustRegionMethod`](@ref) interface.
- `descent`: The descent method to use to compute the step. This needs to follow the
[`NonlinearSolve.AbstractDescentAlgorithm`](@ref) interface.
[`NonlinearSolveBase.AbstractDescentDirection`](@ref) interface.
- `max_shrink_times`: The maximum number of times the trust region radius can be shrunk
before the algorithm terminates.
"""
Expand Down
Loading

0 comments on commit 81d9765

Please sign in to comment.