bmad-sim / bmad-ecosystem

Bmad simulation ecosystem for simulating high energy storage rings.
https://www.classe.cornell.edu/bmad/
12 stars 13 forks source link

long_term_tracking only gives last turn beam output #1002

Closed ndwang closed 3 months ago

ndwang commented 3 months ago

I'm running long_term_tracking from the 2024_0611 release. I set up the .init file for long_term_tracking to output the beam distribution every turn, but only beam from the last turn is saved. Also, long_term_tracking deletes existing beam files in the directory. For example, if ltt%beam_output_file = "beam.h5" and ltt%n_turns = 20, existing beams named "beam-n.h5" (n<=20) are deleted.

Attached is an example. wake.zip

DavidSagan commented 3 months ago

@ndwang Problem is caused by the output file names not being set. This is counter intuitive so I will change this behavior.

ndwang commented 3 months ago

If I set ltt%beam_output_file, I get the same behavior.

DavidSagan commented 3 months ago

@ndwang Sorry I should have dug a bit further. Turns out that this was a feature and not a bug. In any case, I have modified the code so LTT will not do this.