From b7a24c86954cf05a757826386f87190ca99b7511 Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 5 May 2026 19:12:38 +0200 Subject: [PATCH 1/3] Add constructor without type --- NEWS.md | 11 +++++++++++ Project.toml | 2 +- src/wing_geometry.jl | 2 ++ test/wing_geometry/test_wing_geometry.jl | 9 +++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 5076f850..a3905172 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,14 @@ +## VortexStepMethod v3.3.0 2026-05-05 + +### Added +- `ForwardDiff` compatibility, used by default in `linearize` (#232) +- `backend` keyword argument for `linearize` +- example `linearize_check.jl` comparing FiniteDiff and ForwardDiff tangents + +### Changed +- core structs are parameterized on the scalar type `T` so dual numbers can + propagate through them; public constructors are unchanged + ## VortexStepMethod v3.2.0 2026-05-02 ### Added diff --git a/Project.toml b/Project.toml index 3e95fd71..7150fb48 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "VortexStepMethod" uuid = "ed3cd733-9f0f-46a9-93e0-89b8d4998dd9" authors = ["1-Bart-1 ", "Oriol Cayon and contributors"] -version = "3.2.0" +version = "3.3.0" [workspace] projects = ["examples", "examples_cp", "docs", "test"] diff --git a/src/wing_geometry.jl b/src/wing_geometry.jl index 3fe45e0c..b50877ac 100644 --- a/src/wing_geometry.jl +++ b/src/wing_geometry.jl @@ -30,6 +30,8 @@ and aerodynamic model. # Returns - `Section`: A new section with the specified parameters and no aerodynamic data """ +Section() = Section{Float64}() + function Section(LE_point, TE_point, aero_model) return Section{Float64}(MVector{3,Float64}(LE_point), MVector{3,Float64}(TE_point), aero_model, nothing) end diff --git a/test/wing_geometry/test_wing_geometry.jl b/test/wing_geometry/test_wing_geometry.jl index d0ebf831..73413360 100644 --- a/test/wing_geometry/test_wing_geometry.jl +++ b/test/wing_geometry/test_wing_geometry.jl @@ -20,6 +20,15 @@ function ==(a::Section, b::Section) end @testset "Wing Geometry Tests" begin + @testset "Section default constructor" begin + s = Section() + @test s isa Section{Float64} + @test s.LE_point == zeros(3) + @test s.TE_point == zeros(3) + @test s.aero_model === INVISCID + @test isnothing(s.aero_data) + end + @testset "Wing initialization" begin example_wing = Wing(10; spanwise_distribution=LINEAR) @test example_wing.n_panels == 10 From cd9f7759f71e7f342501b27e43f9f8d3a4db885f Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 5 May 2026 19:33:26 +0200 Subject: [PATCH 2/3] Fix docstring --- docs/src/types.md | 2 +- src/wing_geometry.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/types.md b/docs/src/types.md index 3eb32985..9548a7d4 100644 --- a/docs/src/types.md +++ b/docs/src/types.md @@ -36,7 +36,7 @@ A body is constructed of one or more abstract wings. All wings are of type Wing. A Wing has one or more sections and can be created from YAML files or OBJ geometry. ```@docs Section -Section(LE_point::PosVector, TE_point::PosVector, aero_model) +Section(LE_point, TE_point, aero_model) Wing Wing(n_panels::Int; spanwise_distribution::PanelDistribution=LINEAR, spanwise_direction::PosVector=MVec3([0.0, 1.0, 0.0])) diff --git a/src/wing_geometry.jl b/src/wing_geometry.jl index b50877ac..a136ed7f 100644 --- a/src/wing_geometry.jl +++ b/src/wing_geometry.jl @@ -17,7 +17,7 @@ Represents a wing section with leading edge, trailing edge, and aerodynamic prop end """ - Section(LE_point::PosVector, TE_point::PosVector, aero_model) + Section(LE_point, TE_point, aero_model) Create a new wing section with the specified leading edge point, trailing edge point, and aerodynamic model. From 6193ba2e34f04a6de7522ff4016c7fc369db5502 Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 5 May 2026 20:47:00 +0200 Subject: [PATCH 3/3] Fix precompile --- src/wing_geometry.jl | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/wing_geometry.jl b/src/wing_geometry.jl index a136ed7f..d184cd56 100644 --- a/src/wing_geometry.jl +++ b/src/wing_geometry.jl @@ -1,21 +1,27 @@ """ - @with_kw mutable struct Section + mutable struct Section{T} Represents a wing section with leading edge, trailing edge, and aerodynamic properties. # Fields -- `LE_point::MVec3` = zeros(MVec3): Leading edge point coordinates -- `TE_point::MVec3` = zeros(MVec3): Trailing edge point coordinates -- `aero_model`::AeroModel = INVISCID: [AeroModel](@ref) -- `aero_data`::AeroData = nothing: See: [AeroData](@ref) +- `LE_point::MVector{3, T}`: Leading edge point coordinates +- `TE_point::MVector{3, T}`: Trailing edge point coordinates +- `aero_model::AeroModel`: [AeroModel](@ref) +- `aero_data::AeroData`: See: [AeroData](@ref) """ -@with_kw mutable struct Section{T} - LE_point::MVector{3, T} = zeros(MVector{3, T}) - TE_point::MVector{3, T} = zeros(MVector{3, T}) - aero_model::AeroModel = INVISCID - aero_data::AeroData = nothing +mutable struct Section{T} + LE_point::MVector{3, T} + TE_point::MVector{3, T} + aero_model::AeroModel + aero_data::AeroData end +Section{T}(; LE_point=zeros(MVector{3, T}), TE_point=zeros(MVector{3, T}), + aero_model=INVISCID, aero_data=nothing) where {T} = + Section{T}(LE_point, TE_point, aero_model, aero_data) + +Section() = Section{Float64}() + """ Section(LE_point, TE_point, aero_model) @@ -30,8 +36,6 @@ and aerodynamic model. # Returns - `Section`: A new section with the specified parameters and no aerodynamic data """ -Section() = Section{Float64}() - function Section(LE_point, TE_point, aero_model) return Section{Float64}(MVector{3,Float64}(LE_point), MVector{3,Float64}(TE_point), aero_model, nothing) end