-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.jl
94 lines (82 loc) · 1.75 KB
/
types.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
##
# types.jl
# Alle types die door de berekeningen gebruikt worden
##
##
# DiscMethode
# - L2
# - L2C
# Properties:
# - toString
##
abstract DiscMethode
##
# BWP
# - EvwVgl
# - AdvecDiff
# - Fisher
# Properties:
# - toString
# - analyticSol (true als er een exacte oplossing bestaat, anders false)
# - parameters (b, chi, gamma)
##
abstract BWP # BeginWaardeProbleem
##
# ResultSet
##
type ResultSet
followUpDiff ::Array{Float64}
exactError ::Array{Float64}
maxVals ::Array{Float64}
maxValsPos ::Array{Float64}
plotSamples ::Array{Float64,2}
meshSamples ::Array{Float64,2}
trackMiddle ::Bool
xsMiddle ::Array{Float64}
dx ::Float64
dt ::Float64
T ::Float64
Nx_mesh ::Integer
Nt_mesh ::Integer
a ::Float64
BWP ::BWP
disc ::DiscMethode
end
include("disc.jl")
include("disc_L2.jl")
include("disc_L2C.jl")
include("disc_GL.jl")
include("BWP_evwVgl.jl")
include("BWP_advecDiff.jl")
include("BWP_fisher.jl")
include("BWP_heatPi.jl")
include("BWP_grayScott.jl")
types = {
"ResultSet" => ResultSet,
"AdvecDiff" => AdvecDiff,
"EvwVgl" => EvwVgl,
"Fisher" => Fisher,
"GrayScott" => GrayScott,
"L2" => L2,
"L2C" => L2C,
"GL" => GL
}
convert(::Type{ResultSet}, d::Dict{String,Any}) =
ResultSet(
d["followUpDiff"],
d["exactError"],
d["maxVals"],
get(d, "maxValsPos", [0.0]),
[d["plotSamples"][i][j] for j in 1:length(d["plotSamples"][1]), i in 1:length(d["plotSamples"]) ],
[d["meshSamples"][i][j] for j in 1:length(d["meshSamples"][1]), i in 1:length(d["meshSamples"]) ],
get(d, "trackMiddle", false),
get(d, "xsMiddle", [0.0]),
d["dx"],
d["dt"],
d["T"],
d["Nx_mesh"],
d["Nt_mesh"],
d["a"],
convert(types[d["BWP"]["toString"]], d["BWP"]),
convert(types[d["disc"]["toString"]], d["disc"])
)