diff --git a/src/SciMLBase.jl b/src/SciMLBase.jl index a57d0ab06..f0b68917a 100644 --- a/src/SciMLBase.jl +++ b/src/SciMLBase.jl @@ -628,7 +628,7 @@ abstract type ADOriginator end """ $(TYPEDEF) -Used to specify which elements can be aliased in a solve. +Used to specify which variables can be aliased in a solve. Every concrete AbstractAliasSpecifier should have at least the fields `alias_p` and `alias_f`. """ abstract type AbstractAliasSpecifier end diff --git a/src/problems/linear_problems.jl b/src/problems/linear_problems.jl index 5715dd73d..ee9be75e3 100644 --- a/src/problems/linear_problems.jl +++ b/src/problems/linear_problems.jl @@ -77,11 +77,6 @@ function LinearProblem(A, b, args...; kwargs...) end end -@doc doc""" - -Holds `alias_A` and `alias_b` which determine whether -to alias `A` and `b` when solving a `LinearProblem`. -""" struct LinearAliasSpecifier <: AbstractAliasSpecifier alias_p::Union{Bool,Nothing} alias_f::Union{Bool,Nothing} @@ -89,8 +84,16 @@ struct LinearAliasSpecifier <: AbstractAliasSpecifier alias_b::Union{Bool,Nothing} end -""" - LinearAliasSpecifier(;alias_A = nothing, alias_b = nothing) +@doc doc""" + Holds information on what variables to alias when solving a `LinearProblem` + +### Keywords + +* `alias_p::Bool` +* `alias_f::Bool` +* `alias_A::Bool`: alias the `A` array. +* `alias_b::Bool`: alias the `b` array. +* `alias::Bool`: sets all fields of the `LinearAliasSpecifier` to `alias`. Creates a `LinearAliasSpecifier` where `alias_A` and `alias_b` default to `nothing`. When `alias_A` or `alias_b` is nothing, the default value of the solver is used. diff --git a/src/problems/nonlinear_problems.jl b/src/problems/nonlinear_problems.jl index 684388b7f..c6b5407e7 100644 --- a/src/problems/nonlinear_problems.jl +++ b/src/problems/nonlinear_problems.jl @@ -329,6 +329,17 @@ struct NonlinearAliasSpecifier <: AbstractAliasSpecifier alias_u0::Union{Bool,Nothing} end +@doc doc""" + Holds information on what variables to alias when solving a `NonlinearProblem`. + +### Keywords + +* `alias_p::Bool` +* `alias_f::Bool` +* `alias_A::Bool`: alias the `A` array. +* `alias_b::Bool`: alias the `b` array. +* `alias::Bool`: sets all fields of the `LinearAliasSpecifier` to `alias`. +""" function NonlinearAliasSpecifier(;alias_p = nothing, alias_f = nothing, alias_u0 = nothing, alias = nothing) if isnothing(alias) NonlinearAliasSpecifier(alias_p, alias_f, alias_u0) diff --git a/src/problems/ode_problems.jl b/src/problems/ode_problems.jl index bcd376ec3..1e3223ba1 100644 --- a/src/problems/ode_problems.jl +++ b/src/problems/ode_problems.jl @@ -530,13 +530,13 @@ when solving an ODE. Conforms to the AbstractAliasSpecifier interface. ### Keywords * `alias_p::Bool` * `alias_f::Bool` -* `alias_u0::Bool = false`: alias the u0 array -* `alias_du0::Bool = false`: alias the du0 array for DAEs -* `alias_tstops::Bool = false`: alias the tstops array -* `alias::Bool`: sets all fields to `alias` +* `alias_u0::Bool`: alias the u0 array. Defaults to false . +* `alias_du0::Bool`: alias the du0 array for DAEs. Defaults to false. +* `alias_tstops::Bool`: alias the tstops array +* `alias::Bool`: sets all fields of the `ODEAliasSpecifier` to `alias` """ -function ODEAliasSpecifier(;alias_p = nothing, alias_f = nothing, alias_u0 = false, alias_du0 = false, alias_tstops = false, alias = nothing) +function ODEAliasSpecifier(;alias_p = nothing, alias_f = nothing, alias_u0 = nothing, alias_du0 = nothing, alias_tstops = nothing, alias = nothing) if alias == true ODEAliasSpecifier(true,true,true,true,true) elseif alias == false