Skip to content

Commit 947f400

Browse files
authored
Add test for second plot (#40)
* test second plot * Update CI.yml --------- Co-authored-by: Uwe Fechner <[email protected]>
1 parent 98677c2 commit 947f400

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ jobs:
3131
arch: x64
3232
version: 1
3333
- os: macOS-latest
34-
arch: x64
34+
arch: aarch64
3535
version: 1
3636
steps:
3737
- name: Install matplotlib
3838
run: if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get install -y python3-matplotlib; fi
3939
shell: bash
4040
- name: Install LaTeX
41-
run: if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get -qq install texlive-full texlive-fonts-extra cm-super; fi
41+
run: if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get -qq install texlive-full cm-super; fi
4242
shell: bash
4343
- uses: actions/checkout@v4
4444
- uses: julia-actions/setup-julia@v2

test/test_plotting.jl

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ using VortexStepMethod
22
using ControlPlots
33
using Test
44

5-
function result_vsm()
5+
function create_wa()
66
# Step 1: Define wing parameters
77
n_panels = 20 # Number of panels
88
span = 20.0 # Wing span [m]
@@ -43,7 +43,7 @@ plt.ioff()
4343
@test isfile("/tmp/plot.pdf")
4444
rm("/tmp/plot.pdf")
4545
show_plot(fig)
46-
wa = result_vsm()
46+
wa = create_wa()
4747
if Sys.islinux()
4848
fig = plot_geometry(
4949
wa,
@@ -61,6 +61,23 @@ plt.ioff()
6161
rm("/tmp/Rectangular_wing_geometry_side_view.pdf")
6262
@test isfile("/tmp/Rectangular_wing_geometry_top_view.pdf")
6363
rm("/tmp/Rectangular_wing_geometry_top_view.pdf")
64+
# Step 5: Initialize the solvers
65+
vsm_solver = Solver(aerodynamic_model_type="VSM")
66+
llt_solver = Solver(aerodynamic_model_type="LLT")
67+
# Step 6: Solve the VSM and LLT
68+
results_vsm = solve(vsm_solver, wa)
69+
results_llt = solve(llt_solver, wa)
70+
# Step 7: Plot spanwise distributions
71+
y_coordinates = [panel.aerodynamic_center[2] for panel in wa.panels]
72+
73+
fig = plot_distribution(
74+
[y_coordinates, y_coordinates],
75+
[results_vsm, results_llt],
76+
["VSM", "LLT"],
77+
title="Spanwise Distributions"
78+
)
79+
@test fig isa plt.PyPlot.Figure
6480
end
6581
end
66-
plt.ion()
82+
plt.ion()
83+
nothing

0 commit comments

Comments
 (0)