Skip to content

Commit d549653

Browse files
committed
Fix tests
1 parent 1a37c4c commit d549653

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

src/VortexStepMethod.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ using PrecompileTools
2020
using Pkg
2121
using DifferentiationInterface
2222
import SciMLBase: successful_retcode
23+
import YAML
24+
import Base: show
2325

2426
# Export public interface
2527
export Wing, Section, RamAirWing, init!
@@ -262,6 +264,7 @@ function help(url)
262264
end
263265

264266
# Include core functionality
267+
include("settings.jl")
265268
include("wing_geometry.jl")
266269
include("kite_geometry.jl")
267270
include("filament.jl")

src/settings.jl

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
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
611
end
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
1116
end
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

Comments
 (0)