Skip to content

Commit

Permalink
update the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jClugstor committed Dec 10, 2024
1 parent 343f662 commit b18b92f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/SciMLBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,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
Expand Down
17 changes: 10 additions & 7 deletions src/problems/linear_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,23 @@ 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}
alias_A::Union{Bool,Nothing}
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.
Expand Down
11 changes: 11 additions & 0 deletions src/problems/nonlinear_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,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)
Expand Down
10 changes: 5 additions & 5 deletions src/problems/ode_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b18b92f

Please sign in to comment.