File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change 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
1613end
1714
1815@Base . kwdef mutable struct VSMSettings
19- wings:: Vector{WingSettings} = [WingSettings () ]
16+ wings:: Vector{WingSettings} = []
2017 solver_settings:: SolverSettings = SolverSettings ()
2118end
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" ]
You can’t perform that action at this time.
0 commit comments