svenreiche / Genesis-1.3-Version4

Time-dependent, 3D Code to simulate the amplification process of a Free-electron Laser.
GNU General Public License v3.0
53 stars 26 forks source link

beam_global_stat & field_global_stat not writing data for beam with step profile #173

Closed nrt63 closed 2 months ago

nrt63 commented 3 months ago

When setting a step current profile, e.g.

&profile_step label=prof2 c0=2200 s_start=1e-6 s_end=7e-6 &end

with

beam_global_stat=true field_global_stat=true

the output fields Beam/Global/xsize etc and Field/Global/xsize contain only a single value at z = 0 and all other values are NaN.

Expected behaviour, for example if using using a gaussian profile, is that Beam/Global/xsize etc and Field/Global/xsize etc have different numerical values at every z step.

ZeugAusHH commented 3 months ago

Hi @nrt63 ,

could you please provide a minimum working example demonstrating the issue? Which version of Genesis are you using -- ideally please provide the git commit id of the source code.

Many thanks

nrt63 commented 3 months ago

Version is 4.6.5.

Input file and lattice file attached. Change between current = @prof1 and @prof2 to see effect. FEL2_10keV.lat.txt FEL2_10keV_TD.in.txt

Thanks

nrt63 commented 3 months ago

Can provide git commit id tomorrow if needed.

nrt63 commented 3 months ago

Compiled by jkj62 at 2024-01-10 15:16:43 [UTC] Git Commit ID: d475c5627f831b2a82cf4279bb1e3769cc2c9d6e

svenreiche commented 2 months ago

I will look at this week. I think the problem is the same as I encounter Nan values for energy etc if I am using a step-profile. Then the global stat would make no sense.

svenreiche commented 2 months ago

Fixed. Problem was in the generation of shot noise for a strictly zero current beam, which is ill-defined. Latest release should have no further issues with it