Skip to content

Commit 475b48e

Browse files
committed
Add warning to earlier fast path
1 parent 740a071 commit 475b48e

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/wing_geometry.jl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,13 @@ function refine!(wing::AbstractWing; recompute_mapping=true, sort_sections=true)
728728
if length(wing.refined_sections) == 0
729729
if wing.spanwise_distribution == UNCHANGED ||
730730
length(wing.unrefined_sections) == n_sections
731+
if wing.spanwise_distribution == BILLOWING &&
732+
wing.billowing_percentage > 0
733+
@warn "Billowing requested but n_panels " *
734+
"($(wing.n_panels)) == n_provided; no " *
735+
"intermediate sections to billow. " *
736+
"Increase n_panels."
737+
end
731738
wing.refined_sections = copy(wing.unrefined_sections)
732739
recompute_mapping && compute_refined_panel_mapping!(wing)
733740
update_non_deformed_sections!(wing)
@@ -771,6 +778,9 @@ function refine!(wing::AbstractWing; recompute_mapping=true, sort_sections=true)
771778
reinit!(wing.refined_sections[i], wing.unrefined_sections[i])
772779
end
773780
end
781+
if wing.spanwise_distribution == BILLOWING && wing.billowing_percentage > 0
782+
@warn "Billowing requested but n_panels ($(wing.n_panels)) == n_provided; no intermediate sections to billow. Increase n_panels."
783+
end
774784
recompute_mapping && compute_refined_panel_mapping!(wing)
775785
update_non_deformed_sections!(wing)
776786
return nothing
@@ -1145,11 +1155,6 @@ function refine_mesh_by_splitting_provided_sections!(
11451155
reinit!(refined_section, section)
11461156
end
11471157
end
1148-
if billowing_percentage > 0
1149-
@warn "Billowing requested but n_panels == n_provided " *
1150-
"($n_panels_desired); no intermediate sections to " *
1151-
"billow. Increase n_panels to add sections between ribs."
1152-
end
11531158
return nothing
11541159
end
11551160

test/wing_geometry/test_billowing.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Test
2+
using Logging
23
using LinearAlgebra
34
using VortexStepMethod
45
using VortexStepMethod: Wing, Section, add_section!, refine!
@@ -240,7 +241,7 @@ end
240241
[-1.0, y, 0.0],
241242
INVISCID)
242243
end
243-
@test_logs (:warn, r"no intermediate sections") refine!(wing)
244+
@test_logs (:warn, r"no intermediate sections") min_level=Logging.Warn refine!(wing)
244245

245246
# All refined sections should match unrefined exactly
246247
for (ref, unref) in zip(

0 commit comments

Comments
 (0)