helper module

Define helper functions applying on elements.

give_name_to_elements(elts, warn_default_element_names=True)[source]

Give to every Element the name TraceWin would give it.

Parameters:
Return type:

None

force_a_section_for_every_element(elts)[source]

Give a section index to every element.

Parameters:

elts (Sequence[Element])

Return type:

None

force_a_lattice_for_every_element(elts)[source]

Give a lattice index to every element.

Elements before the first LATTICE command will be in the same lattice as the elements after the first LATTICE command.

Elements after the first LATTICE command will be in the previous lattice.

Example

Element/Command

Lattice before

Lattice after

QP1

None

0

DR1

None

0

LATTICE

QP2

0

0

DR2

0

0

END LATTICE

QP3

None

0

LATTICE

DR3

1

1

END LATTICE

QP4

None

1

Parameters:

elts (Sequence[Element])

Return type:

None