pogona.SensorTeleporting

class pogona.SensorTeleporting[source]

Bases: pogona.sensor.Sensor

Teleports molecules from one object to another.

Attributes

component_name

Unique name of this component, unless it is "Generic component".

rotation

scale

shape

Shape of this sensor.

source_object

Component name of the source object.

source_outlet_name

Name of the outlet in the source mesh (check your OpenFOAM mesh).

target_inlet_name

Name of the inlet in the target mesh (check your OpenFOAM mesh).

target_object

Component name of the target object.

transformation

translation

__init__()[source]

Methods

__init__()

finalize(simulation_kernel)

get_source_object()

get_target_object()

initialize(simulation_kernel, init_stage)

Use InitStages to initialize this Component instance.

is_inside_sensor_zone(position_global)

process_molecule_moving_after(...)

Override this method for your sensing algorithm.

process_molecule_moving_before(...)

Called before updating the position of a particle within a time step.

process_new_time_step(simulation_kernel, ...)

set_arguments(**kwargs)

Read arguments as key value pairs and set this component's member variables accordingly.

__init__()[source]
finalize(simulation_kernel: pogona.simulation_kernel.SimulationKernel)
get_source_object() pogona.object.Object[source]
get_target_object() pogona.object.Object[source]
initialize(simulation_kernel: pogona.simulation_kernel.SimulationKernel, init_stage: pogona.component.InitStages)[source]

Use InitStages to initialize this Component instance.

is_inside_sensor_zone(position_global: numpy.ndarray)
process_molecule_moving_after(simulation_kernel: pogona.simulation_kernel.SimulationKernel, molecule: pogona.molecule.Molecule)

Override this method for your sensing algorithm. The sensor manager will use this method to notify you of all molecule movement inside of the sensor zone. However, it may also notify you of molecule movement outside of your sensor zone! So make sure you additionally check the molecule position yourself. See SensorCounting for a simple reference implementation.

Parameters
  • simulation_kernel – The single simulation kernel

  • molecule – Which molecule has moved, with the new position

process_molecule_moving_before(simulation_kernel: pogona.simulation_kernel.SimulationKernel, molecule: pogona.molecule.Molecule)[source]

Called before updating the position of a particle within a time step. Useful for SensorTeleporting, for example, which should consider the position of particles right after they have been spawned.

Parameters
  • simulation_kernel

  • molecule

Returns

process_new_time_step(simulation_kernel: pogona.simulation_kernel.SimulationKernel, notification_stage: pogona.component.NotificationStages)
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().

component_name = 'Generic component'

Unique name of this component, unless it is “Generic component”.

id

Unique integer component ID

rotation = [0, 0, 0]
scale = [1, 1, 1]
sensor_id: int

Unique integer sensor ID. Set by the sensor manager.

shape = 'NONE'

Shape of this sensor. Valid shapes are defined in the pogona.Shapes enum.

source_object = ''

Component name of the source object.

source_outlet_name = ''

Name of the outlet in the source mesh (check your OpenFOAM mesh).

target_inlet_name = ''

Name of the inlet in the target mesh (check your OpenFOAM mesh).

target_object = ''

Component name of the target object.

property transformation: pogona.transformation.Transformation
translation = [0, 0, 0]