Some confusing issues with insert_elements
Posted: 02 Jan 2019, 16:49
Hi,
I use insert_elements to add TSCATTER elements for calculating losses due to Touschek scattering.
Most of the time it works fine, but I am also using load_parameters as my way of reading in magnet errors.
When both are used in one set of calculations *and* add_at_start=1, that very first insertion seems to be assigned
properties coming from what was originally the first element, even if those properties do not belong.
It takes calls to both load_parameters and insert_elements, and using add_at_start=1 to experience the problem.
There is a separate issue with the relatively new feature allowing insert_before=1. If the selected
places for insertion are close together, then fewer new elements are added compared to using
insert_before=0. The demonstration files for this problem do not use either load_parameters or add_at_start=1,
to try keeping things simple.
I am attaching some files based on the spear lattice and output coming from Mac binaries for version 34.4.1.
I do see the same thing for later versions. In these examples, load_parameters is not actually doing anything
useful, but it does trigger the bug. I played a little with changing the order of the command namelists, but I could
not avoid getting an error.
I was wondering if there is a better way to save and load in lattices with given errors, other than using
parameters in run_setup followed by load_parameters. Also, it would be very convenient if I could use
a list of element types in insert_elements instead of trying to cobble something together with wildcards.
That method seems to work with exclude_type_pattern inside load_parameters, it would be great to be able to do
the same thing for insert_elements. Or is there already a way to do that and I just don't know the proper format?
Thank you,
Gregg
I use insert_elements to add TSCATTER elements for calculating losses due to Touschek scattering.
Most of the time it works fine, but I am also using load_parameters as my way of reading in magnet errors.
When both are used in one set of calculations *and* add_at_start=1, that very first insertion seems to be assigned
properties coming from what was originally the first element, even if those properties do not belong.
It takes calls to both load_parameters and insert_elements, and using add_at_start=1 to experience the problem.
There is a separate issue with the relatively new feature allowing insert_before=1. If the selected
places for insertion are close together, then fewer new elements are added compared to using
insert_before=0. The demonstration files for this problem do not use either load_parameters or add_at_start=1,
to try keeping things simple.
I am attaching some files based on the spear lattice and output coming from Mac binaries for version 34.4.1.
I do see the same thing for later versions. In these examples, load_parameters is not actually doing anything
useful, but it does trigger the bug. I played a little with changing the order of the command namelists, but I could
not avoid getting an error.
I was wondering if there is a better way to save and load in lattices with given errors, other than using
parameters in run_setup followed by load_parameters. Also, it would be very convenient if I could use
a list of element types in insert_elements instead of trying to cobble something together with wildcards.
That method seems to work with exclude_type_pattern inside load_parameters, it would be great to be able to do
the same thing for insert_elements. Or is there already a way to do that and I just don't know the proper format?
Thank you,
Gregg