Skip to content

Commit

Permalink
Modified sprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsignorelli committed Dec 4, 2023
1 parent 2e57f00 commit de9c06f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Tao.jl
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ function BAGELS_2(lat, phi_start, phi_step, suffix="",outf="BAGELS.bmad", kick=1

# Get first N_knobs principal directions
V = F.V[:,1:N_knobs]
# Create a group element with these as knobs

fmt = "%0$(length(string(N_knobs)))i"
@eval mysprintf(x) = @sprintf($fmt, x)

# Create a group element with these as knobs
for i=1:N_knobs
knob = V[:,i]
raw = Matrix{Any}(undef, length(coil_pairs), 2) #zeros(length(coil_pairs), 2)
Expand All @@ -183,7 +187,7 @@ function BAGELS_2(lat, phi_start, phi_step, suffix="",outf="BAGELS.bmad", kick=1
else
knob_out = open(outf, "a")
end
println(knob_out, "BAGELS$(suffix)$(@sprintf("%0$(length(string(i)))d", i)): group = {")
println(knob_out, "BAGELS$(suffix)$(mysprintf(i)): group = {")

for coil in unique_coils
strength = 0.
Expand Down

0 comments on commit de9c06f

Please sign in to comment.