1- using Parameters
1+ filename = " vsm_settings.yaml"
2+ data = YAML. load_file (joinpath (dirname (dirname (pathof (VortexStepMethod))), " data" , filename))
23
3- @with_kw mutable struct WingSettings
4- n_panels:: Int
5- spanwise_panel_distribution:: String = " uniform"
4+ @Base . kwdef mutable struct WingSettings
5+ name:: String = " main_wing"
6+ n_panels:: Int64 = 40
7+ n_groups:: Int64 = 40
8+ spanwise_panel_distribution:: String = " LINEAR"
9+ spanwise_direction:: MVec3 = [0.0 , 1.0 , 0.0 ]
10+ remove_nan = true
611end
712
8- @with_kw mutable struct VSMSettings
13+ @Base . kwdef mutable struct SolverSettings
914 aerodynamic_model_type:: String = " VSM"
10- max_iterations:: Int = 1000
15+ max_iterations:: Int64 = 1000
1116end
1217
13- @with_kw mutable struct Configuration
14- wings:: Vector{Dict{String, WingSettings}}
15- solver_settings:: VSMSettings
16- end
18+ @Base . kwdef mutable struct VSMSettings
19+ wings:: Vector{WingSettings} = [WingSettings ()]
20+ solver_settings:: SolverSettings = SolverSettings ()
21+ end
22+
23+ function Base. show (io:: IO , vs:: VSMSettings )
24+ println (io, " VSMSettings:" )
25+ for wing in vs. wings
26+ print (io, " " , replace (repr (wing), " \n " => " \n " ))
27+ end
28+ print (io, replace (repr (vs. solver_settings), " \n " => " \n " ))
29+ end
0 commit comments