You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/basics/autodiff.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,8 @@ BVPJacobianAlgorithm
12
12
13
13
In BoundaryValueDiffEq.jl, automatic differentiation backend should only be wrapped in `BVPJacobianAlgorithm(diffmode, bc_diffmode, nonbc_diffmode)`. `BVPJacobianAlgorithm(diffmode, bc_diffmode, nonbc_diffmode)` supports user-specified mixed automatic differentiation backends in different part of a boundary value problem, and AD choice should depended on the type of boundary value problem:
14
14
15
-
-[`BVProblem`](@ref SciMLBase.BVProblem): Differentiation mode for boundary condition part and non boundary condition part should be specified, for example, `BVPJacobianAlgorithm(; bc_diffmode, nonbc_diffmode)`, default to `BVPJacobianAlgorithm(; bc_diffmode = AutoForwardDiff(), nonbc_diffmode = AutoSparse(AutoForwardDiff()))`.
16
-
-[`TwoPointBVProblem`](@ref SciMLBase.TwoPointBVProblem): Differentiation mode for overall solving should be specified, for example, `BVPJacobianAlgorithm(; diffmode)`, default to `BVPJacobianAlgorithm(; diffmode = AutoSparse(AutoForwardDiff()))`.
15
+
-`BVProblem`: Differentiation mode for boundary condition part and non boundary condition part should be specified, for example, `BVPJacobianAlgorithm(; bc_diffmode, nonbc_diffmode)`, default to `BVPJacobianAlgorithm(; bc_diffmode = AutoForwardDiff(), nonbc_diffmode = AutoSparse(AutoForwardDiff()))`.
16
+
-`TwoPointBVProblem`: Differentiation mode for overall solving should be specified, for example, `BVPJacobianAlgorithm(; diffmode)`, default to `BVPJacobianAlgorithm(; diffmode = AutoSparse(AutoForwardDiff()))`.
17
17
18
18
In BoundaryValueDiffEq.jl, we require AD to obtain the Jacobian of the loss function which contains the collocation equation and boundary condition equations. For `TwoPointBVProblem`, the Jacobian of the loss function is a sparse banded matrix with known sparsity pattern, but for general multi-points `BVProblem`, the Jacobian of the loss function is an almost banded matrix, which has the first several rows as the boundary conditions and the rest as a sparse banded matrix with known sparsity pattern but without the first several rows. In this case, we can specify mixed AD backend in `BVPJacobianAlgorithm` to make the most of the different sparsity pattern to accelerate BVP solving process.
0 commit comments