element_envelope3d_parameters_factory module
Create the solver parameters for Envelope3D.
- PARAMETERS_3D = { <class 'lightwin.core.elements.field_maps.field_map.FieldMap'>: <class 'lightwin.beam_calculation.envelope_3d.element_envelope3d_parameters.FieldMapEnvelope3DParameters'>, <class 'lightwin.core.elements.bend.Bend'>: <class 'lightwin.beam_calculation.envelope_3d.element_envelope3d_parameters.BendEnvelope3DParameters'>, <class 'lightwin.core.elements.diagnostic.Diagnostic'>: <class 'lightwin.beam_calculation.envelope_3d.element_envelope3d_parameters.DriftEnvelope3DParameters'>, <class 'lightwin.core.elements.drift.Drift'>: <class 'lightwin.beam_calculation.envelope_3d.element_envelope3d_parameters.DriftEnvelope3DParameters'>, <class 'lightwin.core.elements.quad.Quad'>: <class 'lightwin.beam_calculation.envelope_3d.element_envelope3d_parameters.QuadEnvelope3DParameters'>, <class 'lightwin.core.elements.solenoid.Solenoid'>: <class 'lightwin.beam_calculation.envelope_3d.element_envelope3d_parameters.SolenoidEnvelope3DParameters'>}
- class ElementEnvelope3DParametersFactory(method: Literal['RK4'], n_steps_per_cell: int, solver_id: str, beam_kwargs: dict[str, Any], phi_s_definition: Literal['historical', 'lagniel'] = 'historical')
Bases:
ElementBeamCalculatorParametersFactoryDefine a method to easily create the solver parameters.
- __init__(method: Literal['RK4'], n_steps_per_cell: int, solver_id: str, beam_kwargs: dict[str, Any], phi_s_definition: Literal['historical', 'lagniel'] = 'historical') None
Prepare import of proper functions.
- run(elt: Element) ElementEnvelope3DParameters
Create the proper subclass of solver parameters, instantiate it.
- Parameters:
elt (Element) – Element under study.
- Returns:
Proper instantiated subclass of
ElementEnvelope3DParameters.- Return type:
- _parameters_constructor(elt: ~lightwin.core.elements.element.Element, default: type = <class 'lightwin.beam_calculation.envelope_3d.element_envelope3d_parameters.DriftEnvelope3DParameters'>) type
Get the proper object constructor.
Examples
>>> self._parameters_constructor(Drift()) DriftEnvelope3DParameters
>>> self._parameters_constructor(Quad()) QuadEnvelope3DParameters
As DiagPosition is not in PARAMETERS_3D, we look for the mother class Diagnostic.
>>> self._parameters_constructor(DiagPosition()) DriftEnvelope3DParameters
To avoid wasting computation time, non-accelerating field maps are treated as drifts.
>>> self._parameters_constructor(FieldMap100(is_accelerating=False)) DriftEnvelope3DParameters
- _abc_impl = <_abc._abc_data object at 0x7f36f8897f40>