Skip to content

Commit 9c78865

Browse files
authored
Merge branch 'master' into qqy/quality
2 parents 3e8a58f + 295799a commit 9c78865

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+536
-202
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,17 @@ DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d"
6767
Hwloc = "0e44f5e4-bd66-52a0-8798-143a42290a1d"
6868
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
6969
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
70+
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
7071
NonlinearSolveFirstOrder = "5959db7a-ea39-4486-b5fe-2dd0bf03d60d"
7172
ODEInterface = "54ca160b-1b9f-5127-a996-1867f4bc2a2c"
7273
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
7374
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
7475
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
7576
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
7677
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
78+
Sparspak = "e56a9233-b9d6-4f03-8d0f-1825330902ac"
7779
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
7880
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
7981

8082
[targets]
81-
test = ["Aqua", "DiffEqDevTools", "Hwloc", "InteractiveUtils", "JET", "NonlinearSolveFirstOrder", "ODEInterface", "OrdinaryDiffEq", "Pkg", "Random", "ReTestItems", "RecursiveArrayTools", "StaticArrays", "Test"]
83+
test = ["Aqua", "DiffEqDevTools", "Hwloc", "InteractiveUtils", "JET", "LinearSolve", "NonlinearSolveFirstOrder", "ODEInterface", "OrdinaryDiffEq", "Pkg", "Random", "ReTestItems", "RecursiveArrayTools", "Sparspak", "StaticArrays", "Test"]

docs/Project.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1919
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
2020
SimpleBoundaryValueDiffEq = "be0294bd-f90f-4760-ac4e-3421ce2b2da0"
2121

22+
[sources]
23+
BoundaryValueDiffEq = {path = "../"}
24+
BoundaryValueDiffEqAscher = {path = "../lib/BoundaryValueDiffEqAscher"}
25+
BoundaryValueDiffEqCore = {path = "../lib/BoundaryValueDiffEqCore"}
26+
BoundaryValueDiffEqFIRK = {path = "../lib/BoundaryValueDiffEqFIRK"}
27+
BoundaryValueDiffEqMIRK = {path = "../lib/BoundaryValueDiffEqMIRK"}
28+
BoundaryValueDiffEqMIRKN = {path = "../lib/BoundaryValueDiffEqMIRKN"}
29+
BoundaryValueDiffEqShooting = {path = "../lib/BoundaryValueDiffEqShooting"}
30+
31+
2232
[compat]
2333
ADTypes = "1.9"
2434
BoundaryValueDiffEq = "5.13.0"

docs/src/assets/Project.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1919
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
2020
SimpleBoundaryValueDiffEq = "be0294bd-f90f-4760-ac4e-3421ce2b2da0"
2121

22+
[sources]
23+
BoundaryValueDiffEq = {path = "../"}
24+
BoundaryValueDiffEqAscher = {path = "../lib/BoundaryValueDiffEqAscher"}
25+
BoundaryValueDiffEqCore = {path = "../lib/BoundaryValueDiffEqCore"}
26+
BoundaryValueDiffEqFIRK = {path = "../lib/BoundaryValueDiffEqFIRK"}
27+
BoundaryValueDiffEqMIRK = {path = "../lib/BoundaryValueDiffEqMIRK"}
28+
BoundaryValueDiffEqMIRKN = {path = "../lib/BoundaryValueDiffEqMIRKN"}
29+
BoundaryValueDiffEqShooting = {path = "../lib/BoundaryValueDiffEqShooting"}
30+
31+
2232
[compat]
2333
ADTypes = "1.9"
2434
BoundaryValueDiffEq = "5.13.0"

docs/src/basics/error_control.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ DefectControl
2525
GlobalErrorControl
2626
SequentialErrorControl
2727
HybridErrorControl
28+
NoErrorControl
2829
```
2930

3031
While we can achieve global error control in different ways, we can use different methods to estimate the global error:

docs/src/basics/solve.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
## Iteration Controls
44

5-
- `abstol::Number`: The absolute tolerance. Defaults to `1e-3`.
6-
- `reltol::Number`: The relative tolerance. Defaults to `1e-3`.
5+
- `abstol::Number`: The absolute tolerance. Defaults to `1e-6`.
76
- `defect_threshold`: Monitor of the size of defect norm. Defaults to `0.1`.
87
- `odesolve_kwargs`: OrdinaryDiffEq.jl solvers kwargs for passing to ODE solving in shooting methods.
98
- `nlsolve_kwargs`: NonlinearSolve.jl solvers kwargs for passing to nonlinear solving in collocation methods and shootingn methods.

docs/src/devdocs/internal_interfaces.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
## Solvers
44

55
```julia
6-
BoundaryValueDiffEqCore.BoundaryValueDiffEqAlgorithm
6+
BoundaryValueDiffEqCore.AbstractBoundaryValueDiffEqAlgorithm
77
```

docs/src/solvers/firk.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ solve(prob::BVProblem, alg, dt; kwargs...)
1212
solve(prob::TwoPointBVProblem, alg, dt; kwargs...)
1313
```
1414

15-
!!! note "Nested nonlinear solving in FIRK methods"
16-
17-
When encountered with large BVP system, setting `nested_nlsolve` to `true` enables FIRK methods to use nested nonlinear solving for the implicit FIRK step instead of solving as a part of the global residual(when default as `nested_nlsolve=false`),
15+
## Nested nonlinear solving in FIRK methods
16+
17+
When working with large boundary value problems, especially those involving stiff systems, computational efficiency and solver robustness become critical concerns. To improve the efficiency of FIRK methods on large BVPs, we can use nested nonlinear solving to obtain the implicit FIRK step instead of solving them as part of the global residual. In BoundaryValueDiffEq.jl, we can set `nested_nlsolve` as `true` to enable FIRK methods to compute the implicit FIRK steps using nested nonlinear solving(default option in FIRK methods is `nested_nlsolve=false`).
18+
19+
Moreover, the nested nonlinear problem solver can be finely tuned to meet specific accuracy requirements by providing detailed keyword arguments through the `nested_nlsolve_kwargs` option in any FIRK solver, for example, `RadauIIa5(; nested_nlsolve = true, nested_nlsolve_kwargs = (; abstol = 1e-6, reltol = 1e-6))`, where `nested_nlsolve_kwargs` can be any common keyword arguments in NonlinearSolve.jl, see [Common Solver Options in NonlinearSolve.jl](https://docs.sciml.ai/NonlinearSolve/stable/basics/solve/).
1820

1921
## Full List of Methods
2022

docs/src/tutorials/solve_nlls_bvp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ end
3535
tspan = (0.0, 100.0)
3636
u0 = [0.0, 1.0]
3737
prob = BVProblem(BVPFunction(f!, bc!; bcresid_prototype = zeros(3)), u0, tspan)
38-
sol = solve(prob, MIRK4(), dt = 0.01)
38+
sol = solve(prob, MIRK4(), dt = 0.01, abstol = 1e-3)
3939
plot(sol)
4040
```
4141

ext/BoundaryValueDiffEqODEInterfaceExt.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
module BoundaryValueDiffEqODEInterfaceExt
22

33
using BoundaryValueDiffEq: BVPM2, BVPSOL, COLNEW
4-
using BoundaryValueDiffEqCore: BoundaryValueDiffEqAlgorithm, __extract_u0,
5-
__initial_guess_length, __extract_mesh,
4+
using BoundaryValueDiffEqCore: __extract_u0, __initial_guess_length, __extract_mesh,
65
__flatten_initial_guess, __get_bcresid_prototype,
76
__has_initial_guess, __initial_guess
87
using SciMLBase: SciMLBase, BVProblem, TwoPointBVProblem, ReturnCode

lib/BoundaryValueDiffEqAscher/src/BoundaryValueDiffEqAscher.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ module BoundaryValueDiffEqAscher
22

33
using ADTypes: ADTypes, AutoSparse, AutoForwardDiff
44
using AlmostBlockDiagonals: AlmostBlockDiagonals, IntermediateAlmostBlockDiagonal
5-
using BoundaryValueDiffEqCore: BVPJacobianAlgorithm, __extract_problem_details,
6-
concrete_jacobian_algorithm, __Fix3,
7-
__concrete_nonlinearsolve_algorithm,
8-
__internal_nlsolve_problem, BoundaryValueDiffEqAlgorithm,
9-
__vec, __vec_f, __vec_f!, __vec_bc, __vec_bc!,
10-
__extract_mesh, get_dense_ad, __get_bcresid_prototype
5+
using BoundaryValueDiffEqCore: AbstractBoundaryValueDiffEqAlgorithm,
6+
AbstractBoundaryValueDiffEqCache, BVPJacobianAlgorithm,
7+
__extract_problem_details, concrete_jacobian_algorithm,
8+
__Fix3, __concrete_nonlinearsolve_algorithm,
9+
__internal_nlsolve_problem, __vec, __vec_f, __vec_f!,
10+
__vec_bc, __vec_bc!, __extract_mesh, get_dense_ad,
11+
__get_bcresid_prototype, __split_kwargs
12+
1113
using ConcreteStructs: @concrete
1214
using DiffEqBase: DiffEqBase
1315
using DifferentiationInterface: DifferentiationInterface, Constant, prepare_jacobian

0 commit comments

Comments
 (0)