pheromone_dispersion.source_term module
- class pheromone_dispersion.source_term.Source(msh, value, t=None)[source]
Bases:
objectClass containing the source term \(s(x,y,t)~\forall (x,y)\in\Omega~\forall t\in[0;T]\) that is the quantity of pheromone emitted per second.
- t
The array of times \(t\) at which the source term maps \(s(x,y)\) are given. If the source is stationary, set to None.
- Type:
- value
Quantity of pheromone emitted (source term) map \(s(x,y)\) at the current time \(t\).
- Type:
- time_interpolation
Callable function used to compute the source term map \(s(x,y)\) given a time \(t\). Computation using the linear interpolation of the source term maps provided on the given time array.
- __init__(msh, value, t=None)[source]
Constructor method.
- Parameters:
msh (
MeshRect2D) – The geometry of the domain.value (
ndarray) – The source term maps \(s(x,y)\) at one or multiple times.t (
ndarray, default:None) – The array of the times \(t\) at which the source term maps \(s(x,y)\) are given. None if the source is stationary.
- Raises:
ValueError – if the shape of the provided values of the source term \(s(x,y)\) does not fit with the shape of the arrays of the coordinates of the cells’ center and of the provided time array.
- at_current_time(tc)[source]
Update the attribute
valueat a given time using the linear interpolation callable attributetime_interpolation.- Parameters:
tc (
floatorinteger) – The current time.- Raises:
ValueError – if the given time is not between the first and last times of the attribute
t, i.e. between the first and last times at which the source term maps are given.