Skip to content

Commit a29b96b

Browse files
Merge pull request #578 from ChrisRackauckas-Claude/agent/mirkn-explicit-public-api
Remove MIRKN blanket reexports
2 parents 219b502 + 03b0031 commit a29b96b

5 files changed

Lines changed: 31 additions & 30 deletions

File tree

lib/BoundaryValueDiffEqMIRKN/Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1414
PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46"
1515
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
1616
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
17-
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1817
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
1918
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
2019

@@ -32,7 +31,6 @@ PreallocationTools = "1.2"
3231
Preferences = "1.4"
3332
Random = "1.10"
3433
RecursiveArrayTools = "3.27.0, 4"
35-
Reexport = "1.2"
3634
SciMLBase = "3.30"
3735
SciMLTesting = "2.4"
3836
Setfield = "1.1.1"

lib/BoundaryValueDiffEqMIRKN/src/BoundaryValueDiffEqMIRKN.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module BoundaryValueDiffEqMIRKN
22

3-
using ADTypes: ADTypes, AutoSparse, AutoForwardDiff
3+
using ADTypes: ADTypes, AutoSparse
44
using BoundaryValueDiffEqCore: BoundaryValueDiffEqCore,
55
AbstractBoundaryValueDiffEqAlgorithm,
66
AbstractBoundaryValueDiffEqCache, BVPJacobianAlgorithm,
@@ -29,15 +29,12 @@ using LinearAlgebra: LinearAlgebra
2929
using PreallocationTools: PreallocationTools, get_tmp
3030
using Preferences: Preferences
3131
using RecursiveArrayTools: AbstractVectorOfArray, ArrayPartition
32-
using Reexport: @reexport
3332
using SciMLBase: SciMLBase, ReturnCode, SecondOrderBVProblem,
3433
StandardSecondOrderBVProblem, TwoPointSecondOrderBVProblem, isinplace, remake
3534
using Setfield: @set!
3635

3736
const DI = DifferentiationInterface
3837

39-
@reexport using ADTypes, BoundaryValueDiffEqCore, SciMLBase
40-
4138
include("types.jl")
4239
include("algorithms.jl")
4340
include("mirkn.jl")

lib/BoundaryValueDiffEqMIRKN/src/algorithms.jl

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,51 @@ for order in (4, 6)
66

77
@eval begin
88
"""
9-
$($alg)(; nlsolve = NewtonRaphson(), optimize = nothing, jac_alg = BVPJacobianAlgorithm(),
9+
$($alg)(; nlsolve = nothing, optimize = nothing, jac_alg = BVPJacobianAlgorithm(),
1010
defect_threshold = 0.1, max_num_subintervals = 3000)
1111
1212
$($order)th order Monotonic Implicit Runge Kutta Nyström method.
1313
14+
## Fields
15+
16+
- `nlsolve`: Optional nonlinear solver algorithm. `nothing` selects the package default.
17+
- `optimize`: Optional optimization solver algorithm. `nothing` disables optimization-based
18+
initialization.
19+
- `jac_alg`: Jacobian construction configuration used by the nonlinear solver.
20+
- `defect_threshold`: Defect-control threshold used to refine the mesh.
21+
- `max_num_subintervals`: Maximum number of mesh subintervals permitted during refinement.
22+
1423
## Keyword Arguments
1524
16-
- `nlsolve`: Internal Nonlinear solver. Any solver which conforms to the SciML
17-
`NonlinearProblem` interface can be used. Note that any autodiff argument for
18-
the solver will be ignored and a custom jacobian algorithm will be used.
19-
- `optimize`: Internal Optimization solver. Any solver which conforms to the SciML
20-
`OptimizationProblem` interface can be used. Note that any autodiff argument for
21-
the solver will be ignored and a custom jacobian algorithm will be used. Optimization
22-
solvers should first be loaded to allow this functionality.
23-
- `jac_alg`: Jacobian Algorithm used for the nonlinear solver. Defaults to
24-
`BVPJacobianAlgorithm()`, which automatically decides the best algorithm to
25-
use based on the input types and problem type.
25+
- `nlsolve = nothing`: Internal nonlinear solver. Any solver that conforms to the SciML
26+
`NonlinearProblem` interface can be used. Its autodiff setting is ignored because MIRKN
27+
uses `jac_alg` to construct the Jacobian.
28+
- `optimize = nothing`: Internal optimization solver. Any solver that conforms to the
29+
SciML `OptimizationProblem` interface can be used for initialization. Load the solver
30+
package before constructing the algorithm.
31+
- `jac_alg = BVPJacobianAlgorithm()`: Jacobian algorithm used for the nonlinear solver.
32+
It automatically selects an algorithm from the problem and input types.
2633
- For `TwoPointBVProblem`, only `diffmode` is used (defaults to
2734
`AutoSparse(AutoForwardDiff())` if possible else `AutoSparse(AutoFiniteDiff())`).
2835
- For `BVProblem`, `bc_diffmode` and `nonbc_diffmode` are used. For
2936
`nonbc_diffmode` defaults to `AutoSparse(AutoForwardDiff())` if possible else
3037
`AutoSparse(AutoFiniteDiff())`. For `bc_diffmode`, defaults to `AutoForwardDiff` if
3138
possible else `AutoFiniteDiff`.
32-
- `defect_threshold`: Threshold for defect control.
33-
- `max_num_subintervals`: Number of maximal subintervals, default as 3000.
39+
- `defect_threshold = 0.1`: Threshold for defect control.
40+
- `max_num_subintervals = 3000`: Maximum number of mesh subintervals.
3441
3542
!!! note
3643
3744
For type-stability, the chunksizes for ForwardDiff ADTypes in
3845
`BVPJacobianAlgorithm` must be provided.
3946
47+
## Examples
48+
49+
```jldoctest
50+
julia> MIRKN$($order)().max_num_subintervals
51+
3000
52+
```
53+
4054
## References
4155
4256
```bibtex

lib/BoundaryValueDiffEqMIRKN/test/Core/mirkn_basic_tests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using BoundaryValueDiffEqMIRKN
2+
using SciMLBase: DynamicalBVPFunction, SecondOrderBVProblem, TwoPointSecondOrderBVProblem,
3+
solve
24
using Test
35

4-
using BoundaryValueDiffEqMIRKN
6+
import SciMLBase
57

68
for order in (4, 6)
79
s = Symbol("MIRKN$(order)")
@@ -85,8 +87,6 @@ end
8587
# JET tests have been moved to the separate QA test group (test/qa/)
8688

8789
@testset "Example problem from paper" begin
88-
using BoundaryValueDiffEqMIRKN
89-
9090
for order in (4, 6)
9191
s = Symbol("MIRKN$(order)")
9292
@eval mirkn_solver(::Val{$order}, args...; kwargs...) = $(s)(args...; kwargs...)

lib/BoundaryValueDiffEqMIRKN/test/qa/qa.jl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ using SciMLTesting
22
using BoundaryValueDiffEqMIRKN
33
using Test
44

5-
const DOCS_SRC = normpath(joinpath(@__DIR__, "..", "..", "..", "..", "docs", "src"))
6-
include(joinpath(@__DIR__, "..", "..", "..", "..", "test", "qa", "reexports.jl"))
7-
85
run_qa(
96
BoundaryValueDiffEqMIRKN;
107
ei_kwargs = (;
@@ -15,9 +12,4 @@ run_qa(
1512
ignore = (:StandardSecondOrderBVProblem, :pickchunksize),
1613
),
1714
),
18-
reexports_allow = MIRKN_REEXPORTS,
19-
api_docs_kwargs = (;
20-
docs_src = DOCS_SRC, ignore = MIRKN_REEXPORTS,
21-
rendered_ignore = MIRKN_REEXPORTS,
22-
),
2315
)

0 commit comments

Comments
 (0)