lattice module
Define LATTICE and LATTICE_END instructions.
- class Lattice(line, dat_idx=None, **kwargs)[source]
Bases:
CommandUsed to get the number of elements per lattice.
- set_influenced_elements(instructions, **kwargs)[source]
Determine the index of the elements concerned by
apply().Here, this is all the elements between this command and the next
LATTICEorLATTICE_ENDinstruction.- Parameters:
instructions (
list[Instruction])kwargs (
float)
- Return type:
- apply(instructions, **kwargs)[source]
Set lattice section number of elements in current lattice.
- Parameters:
instructions (
list[Instruction])kwargs (
float)
- Return type:
- _current_section_number(instructions)[source]
Get section number of
self.- Parameters:
instructions (
list[Instruction])- Return type:
- _current_lattice_number(instructions, index)[source]
Get lattice number of current object.
We look for
Elementininstructionsin reversed order, starting fromself. We take the first non negative lattice index that we find, and return it + 1. If we do not find anything, this is because noElementhad a defined lattice number before.This approach allows for
Elementwithout a lattice number, as for examples drifts between aLatticeEndand aLattice.- Parameters:
instructions (
list[Instruction])index (
int)
- Return type:
- _abc_impl = <_abc._abc_data object at 0x7318fb808a40>
- class LatticeEnd(line, dat_idx=None, **kwargs)[source]
Bases:
CommandDefine the end of lattice.
- set_influenced_elements(instructions, **kwargs)[source]
Determine the index of the elements concerned by
apply().Here, this is all the elements that are between this command and the next
LATTICEinstruction.- Parameters:
instructions (
list[Instruction])kwargs (
float)
- Return type:
- _abc_impl = <_abc._abc_data object at 0x7318fb808500>
- apply(instructions, **kwargs)[source]
Reset the lattice index of every influenced element.
Todo
As for now, the effect of this command will be overriden by the _force_a_lattice_for_every_element. See how I should handle this…
- Parameters:
instructions (
list[Instruction])kwargs (
float)
- Return type: