Hi,
I like to track particle disrtibutions with different charges.
I know the way to change the charge in my lattice file (.lte).
But I like to have one lattice file (.lte) and change everything else in the run definition file (.ele).
Is there a way to do this?
Cheers, Johann
change charge in the elegant runfile
Moderators: cyao, michael_borland
-
- Posts: 1951
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: change charge in the elegant runfile
Johann,
You can use the vary_elements command. Suppose your CHARGE element is called Q:
This would vary the TOTAL field of element Q from 0 to 1e-9, taking on 11 values.
Another method is using the &alter_elements command and a commandline macro. E.g.,
This would then be executed with a command such as
If you have a batch system, you can make a loop and submit the different jobs to different nodes.
--Michael
You can use the vary_elements command. Suppose your CHARGE element is called Q:
Code: Select all
&run_setup
...
&end
&run_control
n_indices = 1
&end
&vary_element
name=Q, item=TOTAL, initial=0, final=1e-9, index_number=0, index_limit=11
&end
! Insertion beam definition (bunched_beam or sdds_beam)
&track &end
Another method is using the &alter_elements command and a commandline macro. E.g.,
Code: Select all
...
&run_setup
...
rootname = <rootname>
&end
&alter_elements name=Q, item=TOTAL, value=<charge> &end
...
Code: Select all
% elegant template.ele -macro=rootname=run-1000,charge=1e-9
% elegant template.ele -macro=rootname=run-100,charge=1e-10
--Michael
Re: change charge in the elegant runfile
I 've tried it but I did something wrong
Now it works thanks
JOhann
Now it works thanks
JOhann