From e1e45fdbeb59b18bcf89434b37423379c89cb5b9 Mon Sep 17 00:00:00 2001 From: jClugstor Date: Wed, 30 Oct 2024 11:40:43 -0400 Subject: [PATCH] add constructor for NonlinearAlias --- src/problems/nonlinear_problems.jl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/problems/nonlinear_problems.jl b/src/problems/nonlinear_problems.jl index 132c17979..0f211552c 100644 --- a/src/problems/nonlinear_problems.jl +++ b/src/problems/nonlinear_problems.jl @@ -552,6 +552,17 @@ end struct NonlinearAliasSpecifier <: AbstractAliasSpecifier - alias_p - alias_f + alias_p::Union{Bool,Nothing} + alias_f::Union{Bool,Nothing} + alias_u0::Union{Bool,Nothing} end + +function NonlinearAliasSpecifier(;alias_p = nothing, alias_f = nothing, alias_u0 = nothing, alias = nothing) + if isnothing(alias) + NonlinearAliasSpecifier(alias_p, alias_f, alias_u0) + elseif alias + NonlinearAliasSpecifier(true, true, true) + elseif !alias + NonlinearAliasSpecifier(false, false, false) + end +end \ No newline at end of file