Skip to content

Commit 3d6c05f

Browse files
committed
Rename init to reinit
1 parent 71bf96c commit 3d6c05f

17 files changed

+50
-50
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
### Changed
3636
- The fields that had as type a `Matrix of size Px1` have now the type `Vector`
3737
- Many new fields of the type `VSMSolution` documented
38-
- `init!(body_aero)` is now a public function
38+
- `reinit!(body_aero)` is now a public function
3939
### Added
4040
- Added the option to use nonlinear solve to calculate the gamma distribution #140
4141
- New page `Tips and tricks` added to the documentation

docs/src/functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ add_section!
1111
set_va!
1212
solve
1313
solve!
14-
init!(body_aero::BodyAerodynamics)
14+
reinit!(body_aero::BodyAerodynamics)
1515
linearize
1616
```
1717

docs/src/tips_and_tricks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ If running the example `ram_air_kite.jl` fails, try to run the `cleanup.jl` scri
1717
Currently, the `solve!()` function returns the results as [VSMSolution](@ref) struct. The function solve() returns a dictionary with the results. The `solve!()` function is faster, and the `solve()` contains many more entries, therefore the first function is good for integration in dynamic models and the second one better suited for aerodynamic analysis.
1818

1919
## Performance
20-
Calling `init!(body_aero; init_aero=false)` is very fast. After calling `deform!(wing)`, you have to run `init!(body_aero; init_aero=false)` to apply the deformed wing to the body aerodynamics. This is in turn necessary for the linearization from deformation to aerodynamic coefficients for RAM-air kites.
20+
Calling `reinit!(body_aero; init_aero=false)` is very fast. After calling `deform!(wing)`, you have to run `reinit!(body_aero; init_aero=false)` to apply the deformed wing to the body aerodynamics. This is in turn necessary for the linearization from deformation to aerodynamic coefficients for RAM-air kites.
2121

2222
## Contributing
2323
Please, read [CONTRIBUTING.md](https://github.com/OpenSourceAWE/VortexStepMethod.jl/blob/main/CONTRIBUTING.md)

examples/ram_air_kite.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ LINEARIZE = false
1212
wing = RamAirWing("data/ram_air_kite_body.obj", "data/ram_air_kite_foil.dat"; prn=PRN)
1313
body_aero = BodyAerodynamics([wing];)
1414
println("First init")
15-
@time VortexStepMethod.init!(body_aero)
15+
@time VortexStepMethod.reinit!(body_aero)
1616

1717
if DEFORM
1818
# Linear interpolation of alpha from 10° at one tip to 0° at the other
1919
println("Deform")
2020
@time VortexStepMethod.smooth_deform!(wing, deg2rad.([10,20,10,0]), deg2rad.([-10,0,-10,0]))
2121
println("Deform init")
22-
@time VortexStepMethod.init!(body_aero; init_aero=false)
22+
@time VortexStepMethod.reinit!(body_aero; init_aero=false)
2323
end
2424

2525
# Create solvers

src/VortexStepMethod.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ using Xfoil
2626

2727
# Export public interface
2828
export VSMSettings, WingSettings, SolverSettings, vs
29-
export Wing, Section, RamAirWing, init!
29+
export Wing, Section, RamAirWing, reinit!
3030
export BodyAerodynamics
3131
export Solver, solve, solve_base!, solve!, VSMSolution, linearize
3232
export calculate_results

src/body_aerodynamics.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function BodyAerodynamics(
9494
end
9595

9696
body_aero = BodyAerodynamics{length(panels)}(; panels, wings)
97-
init!(body_aero; va, omega)
97+
reinit!(body_aero; va, omega)
9898
return body_aero
9999
end
100100

@@ -114,7 +114,7 @@ function Base.setproperty!(obj::BodyAerodynamics, sym::Symbol, val)
114114
end
115115

116116
"""
117-
init!(body_aero::BodyAerodynamics; init_aero, va, omega)
117+
reinit!(body_aero::BodyAerodynamics; init_aero, va, omega)
118118
119119
Initialize a BodyAerodynamics struct in-place by setting up panels and coefficients.
120120
@@ -129,15 +129,15 @@ Initialize a BodyAerodynamics struct in-place by setting up panels and coefficie
129129
# Returns
130130
nothing
131131
"""
132-
function init!(body_aero::BodyAerodynamics;
132+
function reinit!(body_aero::BodyAerodynamics;
133133
init_aero=true,
134134
va=[15.0, 0.0, 0.0],
135135
omega=zeros(MVec3)
136136
)
137137
idx = 1
138138
vec = zeros(MVec3)
139139
for wing in body_aero.wings
140-
init!(wing)
140+
reinit!(wing)
141141
panel_props = wing.panel_props
142142

143143
# Create panels
@@ -147,7 +147,7 @@ function init!(body_aero::BodyAerodynamics;
147147
else
148148
delta = 0.0
149149
end
150-
@views init!(
150+
@views reinit!(
151151
body_aero.panels[idx],
152152
wing.refined_sections[i],
153153
wing.refined_sections[i+1],

src/filament.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Represents a bound vortex filament defined by two points.
2828
initialized::Bool = false
2929
end
3030

31-
function init!(filament::BoundFilament, x1, x2, vec=zeros(MVec3))
31+
function reinit!(filament::BoundFilament, x1, x2, vec=zeros(MVec3))
3232
filament.x1 .= x1
3333
filament.x2 .= x2
3434
vec .= x2 .- x1
@@ -173,7 +173,7 @@ Represents a semi-infinite vortex filament.
173173
initialized::Bool = false
174174
end
175175

176-
function init!(filament::SemiInfiniteFilament, x1::PosVector, direction::PosVector, vel_mag::Real, filament_direction::Real)
176+
function reinit!(filament::SemiInfiniteFilament, x1::PosVector, direction::PosVector, vel_mag::Real, filament_direction::Real)
177177
filament.x1 .= x1
178178
filament.direction .= direction
179179
filament.vel_mag = vel_mag

src/panel.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ function init_pos!(
102102
panel.corner_points[:, 4] = panel.LE_point_2
103103
vec .= bound_point_2 .- bound_point_1
104104
panel.width = norm(vec)
105-
init!(panel.filaments[1], bound_point_2, bound_point_1, vec)
106-
init!(panel.filaments[2], bound_point_1, panel.TE_point_1, vec)
107-
init!(panel.filaments[3], panel.TE_point_2, bound_point_2, vec)
105+
reinit!(panel.filaments[1], bound_point_2, bound_point_1, vec)
106+
reinit!(panel.filaments[2], bound_point_1, panel.TE_point_1, vec)
107+
reinit!(panel.filaments[3], panel.TE_point_2, bound_point_2, vec)
108108

109109
panel.bound_point_1 .= bound_point_1
110110
panel.bound_point_2 .= bound_point_2
@@ -184,7 +184,7 @@ function init_aero!(
184184
end
185185
end
186186

187-
function init!(
187+
function reinit!(
188188
panel::Panel,
189189
section_1::Section,
190190
section_2::Section,

src/solver.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,20 +707,20 @@ function linearize(solver::Solver, body_aero::BodyAerodynamics, y::Vector{T};
707707
if !isnothing(theta_angles) && isnothing(delta_angles)
708708
if !all(theta_angles .== last_theta)
709709
VortexStepMethod.group_deform!(wing, theta_angles, nothing; smooth=false)
710-
VortexStepMethod.init!(body_aero; init_aero=false)
710+
VortexStepMethod.reinit!(body_aero; init_aero=false)
711711
last_theta .= theta_angles
712712
end
713713
elseif !isnothing(theta_angles) && !isnothing(delta_angles)
714714
if !all(delta_angles .== last_delta) || !all(theta_angles .== last_theta)
715715
VortexStepMethod.group_deform!(wing, theta_angles, delta_angles; smooth=false)
716-
VortexStepMethod.init!(body_aero; init_aero=false)
716+
VortexStepMethod.reinit!(body_aero; init_aero=false)
717717
last_theta .= theta_angles
718718
last_delta .= delta_angles
719719
end
720720
elseif isnothing(theta_angles) && !isnothing(delta_angles)
721721
if !all(delta_angles .== last_delta)
722722
VortexStepMethod.group_deform!(wing, nothing, delta_angles; smooth=false)
723-
VortexStepMethod.init!(body_aero; init_aero=false)
723+
VortexStepMethod.reinit!(body_aero; init_aero=false)
724724
last_delta .= delta_angles
725725
end
726726
end

src/wake.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ function frozen_wake!(body_aero::BodyAerodynamics, va_distribution)
1818
va_i = va_distribution[i, :]
1919
vel_mag = norm(va_i)
2020
direction = va_i / vel_mag
21-
init!(
21+
reinit!(
2222
panel.filaments[4],
2323
panel.TE_point_1,
2424
direction,
2525
vel_mag,
2626
1
2727
)
28-
init!(
28+
reinit!(
2929
panel.filaments[5],
3030
panel.TE_point_2,
3131
direction,

0 commit comments

Comments
 (0)