emulsim.actors.autonomous.emitters module

Provides a simple actor that emits mass into a field at predefined positions.

EmittersActor

Actor emitting mass into a field at defined positions.

class EmittersActor(parameters: dict[str, Any] | None = None)[source]

Bases: ActorBase

Actor emitting mass into a field at defined positions.

Parameters Dictionary:
  • positions: The positions of all the emitters (default=array([], dtype=float64))

  • strengths: The strengths of the emitters, i.e., the mass per unit time that is emitted (default=array([1]))

Parameters:

parameters (dict) – Parameters defining the behavior of the actor. Call show_parameters() for details.

Parameters of EmittersActor:

positions

The positions of all the emitters. This needs to be an array of positions. The dimension of each position needs to be compatible with the dimension of the field. (Default value: array([], dtype=float64))

strengths

The strengths of the emitters, i.e., the mass per unit time that is emitted. This can be an array, setting different strengths for each emitter, or a single number, setting the same strength for all emitters. (Default value: array([1]))

element_classes: tuple[type[_ElementBase] | tuple[type[_ElementBase], ...], ...] | EllipsisType = (<class 'emulsim.elements.fields.FieldElementBase'>,)

defines the elements this actor handles and in what order they need to be supplied. An ellipsis (…) indicates that all elements and lists of elements are accepted. Setting this attribute allows internal consistency checks.

Type:

tuple

estimate_dt(elements: tuple[_ElementBase, ...]) float[source]

Estimate the maximal time step for simulating this actor.

Parameters:

element (FieldElementBase) – The field element that is affected by the emitters

Returns:

the maximal time step

Return type:

float

evolve(elements: tuple[_ElementBase, ...], t: float, dt: float) None[source]

Evolve the field state from time t to t + dt

Parameters:
  • elements (tuple of FieldElementBase) – The field element that is affected by the emitters

  • t (float) – The current time point

  • dt (float) – The time step

make_evolver_numba(elements: tuple[_ElementBase, ...]) Callable[[tuple[ndarray, ...], float, float], None][source]

Return a function evolve the field state from time t to t + dt

Parameters:

elements (tuple of FieldElementBase) – The field element that is affected by the emitters

Returns:

A function with signature

(field_data: ndarray, t: float, dt: float), evolving field_data

Return type:

callable