Skip to content

Commit

Permalink
BUG: fix inputs type unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
enigne committed Sep 15, 2024
1 parent 71ae451 commit d8e062f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/core/inputs.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#Input class definition
mutable struct Input#{{{
abstract type AbstractInput end
mutable struct Input <: AbstractInput#{{{
enum::IssmEnum
interp::IssmEnum
values::Vector{Float64}
element_values::Vector{Float64}
end# }}}
mutable struct TransientInput #{{{
mutable struct TransientInput <: AbstractInput#{{{
enum::IssmEnum
times::Vector{Float64}
N::Int64
Expand All @@ -19,7 +20,7 @@ end# }}}
mutable struct Inputs #{{{
numberofelements::Int64
numberofvertices::Int64
lookup::Dict{IssmEnum,Union{Input,TransientInput}}
lookup::Dict{IssmEnum, AbstractInput}
end# }}}

#Inputs functions
Expand Down Expand Up @@ -47,6 +48,9 @@ function DuplicateInput(inputs::Inputs, old::IssmEnum, new::IssmEnum)#{{{
return nothing
end#}}}
function GetInput(inputs::Inputs, enum::IssmEnum) #{{{
return GetInput(inputs, Val(enum))
end#}}}
function GetInput(inputs::Inputs, ::Val{enum}) where enum #{{{

#Does this input exist
if !haskey(inputs.lookup,enum)
Expand Down

0 comments on commit d8e062f

Please sign in to comment.