ocelot-collab / ocelot

OCELOT is a multiphysics simulation toolkit designed for studying FEL and storage ring-based light sources.
GNU General Public License v3.0
86 stars 58 forks source link

What is the correct way of using step size in space-charge function #246

Closed laxmisubramanyam closed 6 months ago

laxmisubramanyam commented 6 months ago

Hi @sergey-tomin @st-walker

It's quite strange that if I use:

sc = SpaceCharge()
sc.nmesh_xyz = [63, 63, 63]
sc.step = 0.1
navi.unit_step = 0.5 # m

I get one result, however, If I use:

sc = SpaceCharge()
sc.nmesh_xyz = [63, 63, 63]
sc.step = 1
navi.unit_step = 0.05 # m

I get different result.

I understand that final step size is sc.step * navi.unit_step. Both are same in the two examples, then why the results are different ?

What is the correct way of using space charge step ?

sergey-tomin commented 6 months ago

Hi, the step should be integer number (1,2,3...) the minimum possible step is defined by Navigator.unit_step. if you want to reduce step you have to reduce Navigator.unit_step. In next release I will introduce warning to prevent this.

laxmisubramanyam commented 6 months ago

Hi @sergey-tomin

Thanks for the clarification.

Best regards, Laxmi