Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Equilibrium/AnalyticEquilibrium.jl
Original file line number Diff line number Diff line change
Expand Up @@ -809,8 +809,8 @@ function sol_run(equil_inputs::EquilibriumConfig, sol_inputs::SolovevConfig)
zmax = 1.5 * e * a
zmin = -zmax

# Compute 1D data and spline
sqfs = Array{Float64}(undef, ma + 1, 4)
# zeros, not undef: only columns 1-3 are filled, so column 4 must stay a deterministic 0.
sqfs = zeros(ma + 1, 4)
psis = [(ia / (ma + 1))^2 for ia in 1:(ma+1)]
sqfs[:, 1] .= f0 .* f0fac
sqfs[:, 2] .= pfac .* (1 .* p0fac .- psis)
Expand Down
6 changes: 4 additions & 2 deletions src/Equilibrium/DirectEquilibrium.jl
Original file line number Diff line number Diff line change
Expand Up @@ -413,14 +413,16 @@ function _estimate_mid_spacing(sq_in, psi_split_core, psi_split_edge, tau)
psi_samp = range(psi_split_core, psi_split_edge; length=n_samp)
h_samp = step(psi_samp)
h_min = Inf
buf = zeros(4)
# Size the buffer to the actual profile count, not a hardcoded 4 (cf. InverseEquilibrium.jl).
nq = size(sq_in.y, 2)
buf = zeros(nq)
all_vals = [
begin
sq_in(buf, ψ)
copy(buf)
end for ψ in psi_samp
]
for k in 1:4
for k in 1:nq
vals = [all_vals[i][k] for i in 1:n_samp]
f_scale = max(maximum(abs.(vals)), 1e-12)
d2_max = 0.0
Expand Down
Loading