pogona.Injector
- class pogona.Injector[source]
Bases:
Component
An injector spawns particles within its defined volume in every time step in which it is turned on.
Usually an injector is controlled by an instance of ModulationOOK or a similar component, which determines when to switch the injector on or off and which also controls the flow speed in connected objects.
Attributes
Component name of the attached object.
Unique name of this component, unless it is "Generic component".
Number of molecules spawned in every time step while the injector is active.
Seed for the pseudo-random number generator.
Shape of this injector.
Methods
__init__
()finalize
(simulation_kernel)initialize
(simulation_kernel, init_stage)Use
InitStages
to initialize this Component instance.process_new_time_step
(simulation_kernel, ...)set_arguments
(**kwargs)Read arguments as key value pairs and set this component's member variables accordingly.
set_geometry
(geometry)set_transformation
(transformation)turn_off
()turn_on
()Turn on the injector and start spawning particles.
- finalize(simulation_kernel: SimulationKernel)
- initialize(simulation_kernel: SimulationKernel, init_stage: InitStages)[source]
Use
InitStages
to initialize this Component instance.
- process_new_time_step(simulation_kernel: SimulationKernel, notification_stage: NotificationStages)[source]
- set_arguments(**kwargs)
Read arguments as key value pairs and set this component’s member variables accordingly. Validity of the argument values will be checked in
initialize()
.
- set_transformation(transformation: Transformation)[source]
- turn_on()[source]
Turn on the injector and start spawning particles. Usually called in the NotificationStages.MODULATION stage, so before SPAWNING in the current time step.
- Returns
- attached_object = ''
Component name of the attached object. This has to be set if you want newly spawned particles to be influenced by a vector field!
- component_name = 'Generic component'
Unique name of this component, unless it is “Generic component”.
- id
Unique integer component ID
- injection_amount = 0
Number of molecules spawned in every time step while the injector is active.
- rotation = [0, 0, 0]
- scale = [1, 1, 1]
- seed = ''
Seed for the pseudo-random number generator. If empty, the random number generator of the simulation kernel will be used. If ‘random’, a random seed will be used for initialization. Will be converted to int otherwise.
- shape = 'NONE'
Shape of this injector. Valid shapes are defined in the pg.Shapes enum.
- translation = [0, 0, 0]