emulsim.actors.autonomous.box module
- class BoxActor(parameters: dict[str, Any] | None = None)[source]
Bases:
ActorBaseActor containing particles in a box.
- Parameters Dictionary:
bounds: The bounds of the box (default=array([], dtype=float64))
periodic: The bounds of the box (default=array(False))
point_like: When False, the radius of the object is used in the distance calculation (default=True)
- Parameters:
parameters (dict) – Parameters affecting the actor. Call
show_parameters()for details.
Parameters of BoxActor:
- bounds
The bounds of the box (Default value:
array([], dtype=float64))- periodic
The bounds of the box (Default value:
array(False))- point_like
When False, the radius of the object is used in the distance calculation (Default value:
True)
- element_classes: tuple[type[_ElementBase] | tuple[type[_ElementBase], ...], ...] | EllipsisType = ((<class 'emulsim.elements.points.PointsElement'>, <class 'emulsim.elements.points.ArrowsElement'>, <class 'emulsim.elements.spherical_droplets.SphericalDropletsElement'>),)
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:
- estimate_dt(elements: tuple[_ElementBase, ...]) float[source]
Estimate the maximal time step for simulating this actor.
- Parameters:
elements (tuple of
PointsElement) – The element that is affected by the directed motion- Returns:
the maximal time step
- Return type:
- evolve(elements: tuple[_ElementBase, ...], t: float, dt: float) None[source]
Evolve the field state from time t to t + dt
- Parameters:
elements (tuple of
PointsElement) – The element that is affected by this actort (float) – The current time point
dt (float) – The time step
- classmethod from_grid(grid: CartesianGrid)[source]
Create BoxActor from a Cartesian grid.
- Parameters:
grid (
pde.grids.cartesian.CartesianGrid) – The Cartesian grid that defines the box
- 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
PointsElement) – The element that is affected by this actor- Returns:
- A function with signature
(state_data:
ndarray, t: float, dt: float), evolving state_data
- Return type:
callable