issue with divide_elements

Moderators: michael_borland, soliday

Post Reply
Philippe Piot
Posts: 83
Joined: 20 Aug 2008, 13:18
Location: Northern Illinois University & Argonne National Laboratory
Contact:

issue with divide_elements

Post by Philippe Piot » 04 Nov 2016, 05:20

Hi,
I noticed the divide_element changes the output results in some instances (i my case when tracking a particle distribution using a previously fitted lattice). I have attached a targz file that reproduces my problem. In brief, I do some fitting and in the last pass I track an incoming distribution in the fitted lattice.
If I run the ele file prob_divide.ele and then analyze the output distribution I found, e.g. for betax 7.675589825605547e+02 . If I now comment the divide_elements block starting line 389, run elegant again I find the output betax is changed to 2.484119249735075e+01 . See the readme file to follow the command I use.
I am not sure if this is a problem with elegant or an issue with the way I am running my file. I have tried to strip my file to a minimalist test case (though the ele file is still long). Thank you for any help. -- Philippe.
Attachments
prob.tar.gz
set of FAST file to check the divide elem issue
(578.73 KiB) Downloaded 395 times

michael_borland
Posts: 1927
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: issue with divide_elements

Post by michael_borland » 04 Nov 2016, 08:50

Philippe,

I found two things that contributed to the problem.
  1. Your element-division command was acting on all elements, including RFCA elements. However, the RFCA elements have to be divided carefully otherwise the pieces will not be physical. Usually you should divide these into cells and no further, then use a PHASE_REFERENCE to ensure the simulation is correct.
  2. When you divide elements, you can't load the length values. Elegant isn't smart enough to know that the elements were divided when it is loading parameters. You'll end up with a beamline with the wrong length.
To fix this, I changed the divide_elements command to

Code: Select all

&divide_elements
    name = *
    exclude = CAV*
    maximum_length = 0.01
&end
and the load_parameters command to

Code: Select all

&load_parameters
        filename = injector.param,
        change_defined_values = 1
        allow_missing_parameters = 1
        exclude_item_pattern = L
&end
--Michael

Philippe Piot
Posts: 83
Joined: 20 Aug 2008, 13:18
Location: Northern Illinois University & Argonne National Laboratory
Contact:

Re: issue with divide_elements

Post by Philippe Piot » 04 Nov 2016, 14:45

MIchael,
Thank you very much for the suggestion! -- Philippe.

Post Reply