Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit AlgorithmName constructors #154

Open
charleskawczynski opened this issue Jan 11, 2023 · 1 comment
Open

Revisit AlgorithmName constructors #154

charleskawczynski opened this issue Jan 11, 2023 · 1 comment

Comments

@charleskawczynski
Copy link
Member

#152 added constructors for subtypes of AbstractAlgorithmName:

# (::Type{Name})(newtons_method::NewtonsMethod) where {Name <: IMEXAlgorithmName} = IMEXAlgorithm(Name(), newtons_method)

#= Convenience constructor =#
(name::IMEXAlgorithmName)(newtons_method::NewtonsMethod) = IMEXAlgorithm(name, newtons_method)

The former method would enforce compatibility with OrdinaryDiffEq, however, it's incompatible with certain subtypes of AbstractAlgorithmName, for example:

Base.@kwdef struct SSP333{FT <: AbstractFloat} <: IMEXSSPRKAlgorithmName
    β::FT = 1 / 2 + 3 / 6
end

We may need to rethink either how this parameter comes in, or if the OrdinaryDiffEq pattern is worth maintaining.

@dennisYatunin
Copy link
Member

Potential solution:

(::Type{Name})(newtons_method::NewtonsMethod, args...) where {Name <: IMEXAlgorithmName} = IMEXAlgorithm(Name(args...), newtons_method)

The definition's somewhat clunky, but it could be helpful for people familiar with the OrdinaryDiffEq syntax. The functor syntax looks kind of confusing (e.g., SSP333()(newtons_method)), so I don't think people will use it much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants