Skip to content

Commit ace97c0

Browse files
committed
Cleanup
1 parent 1ccd78a commit ace97c0

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/settings.jl

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
filename = "vsm_settings.yaml"
2-
data = YAML.load_file(joinpath("data", filename))
3-
41
@with_kw mutable struct WingSettings
52
name::String = "main_wing"
63
n_panels::Int64 = 40
@@ -16,22 +13,17 @@ end
1613
end
1714

1815
@Base.kwdef mutable struct VSMSettings
19-
wings::Vector{WingSettings} = [WingSettings()]
16+
wings::Vector{WingSettings} = []
2017
solver_settings::SolverSettings = SolverSettings()
2118
end
2219

23-
const VSM_SETTINGS = VSMSettings()
24-
25-
function vs(filename=filename)
26-
VSM_SETTINGS = VSMSettings()
27-
res = VSM_SETTINGS
20+
function vs(filename)
21+
res = VSMSettings()
2822
data = YAML.load_file(joinpath("data", filename))
2923
res.solver_settings.max_iterations = data["solver_settings"]["max_iterations"]
3024
res.solver_settings.aerodynamic_model_type = eval(Symbol(data["solver_settings"]["aerodynamic_model_type"]))
3125
for (i, wing) in pairs(data["wings"])
32-
if i > length(res.wings)
33-
push!(res.wings, WingSettings())
34-
end
26+
push!(res.wings, WingSettings())
3527
res.wings[i].name = wing["name"]
3628
res.wings[i].n_panels = wing["n_panels"]
3729
res.wings[i].n_groups = wing["n_groups"]

0 commit comments

Comments
 (0)