Particle Functions
For the following particle specific functions a visualization of particles (from FilterDict or AddiDict) must be loaded.
gd.getParticlesInfo
Get the current view status as dictionary or plot.
Returns a Python dictionary containing the number of batches and the maximal and minimal batch animation times.
Input: None
Example:
gd.getParticles
Returns the Particles object which gives access to currently loaded particle data. To obtain the data the GeoParticles class is used. It works only in combination with this command.
Input:
Example: For an example, see below in the subfunctions of the getParticles class.
Subfunctions
.getBatchInfo
Returns information about a batch of particles as a Python dictionary. The resulting dictionary contains:
- "minTime": start time of batch
- "maxTime": end time of batch
- "minRadius": minimal particle radius in batch
- "maxRadius": maximum particle radius in batch
- "particleIds": list of particle IDs present in this batch
This command only works in combination with the gd.getParticles command.
Input:
Example:
|
.getDiameter
Returns the (interpolated) particle diameter at a given time. This command only works in combination with the gd.getParticles command.
Input:
- batch index, integer
- particle index, integer
- time, float
Example:
|
.getDiameters
Computes the (interpolated) particle diameters with a given step size. Sampling starts at “minTime” and increments by step size up to “maxTime”. Returns a list of tuples (time, radius). This command only works in combination with the gd.getParticles command. The command makes sense, only when the particle with the given particle index changes its diameter over time. Otherwise, an empty list is returned.
Input:
- batch index, integer
- particle index, integer
- time step, float
|
.getLoadedBatchIndices
Returns a list of valid particle batches that are currently loaded in memory. This command only works in combination with the gd.getParticles command.
Input: None
Example:
|
.getMultiplicities
Computes the (interpolated) particle multiplicity with a given step size. Sampling starts at “minTime” and increments by step size up to “maxTime”. Returns a list of tuples (time, multiplicity). This command only works in combination with the gd.getParticles command.
Input:
- batch index, integer
- particle index, integer
- time step, float
Example:
|
.getMultiplicity
Computes the (interpolated) particle multiplicity at a given time. This command only works in combination with the gd.getParticles command.
Input:
- batch index, integer
- particle index, integer
- time, float
Example:
|
.getParticleInfo
Returns information about a particle inside a batch as a Python dictionary. This command only works in combination with the gd.getParticles command.
The resulting dictionary contains:
- "minTime", "maxTime": start/end time of particle trajectory
- "material_id": the material ID of the particle
- "type": type index of the particle
- "status_code": numerical status of the particle
- "status": human-readable interpretation of particle status (e.g. "EXIT_OUTFLOW", "TRAPPED_SIEVING")
- "end_material_id": if status is "HIT_END_MATERIAL", this contains the material id which the particle hit
- "is_ghost": True if ghost particle
- "times": time values for individual sample points along the trajectory
- "positions": particle position for each time
- "radii": particle radius for each time or single value if not time-dependent
- "multiplicities": particle multiplicity for each time
Input:
- batch index, integer
- particle index, integer
Example:
|
.getPosition
Returns the (interpolated) particle position at a given time. This command only works in combination with the gd.getParticles command.
Input:
- batch index, integer
- particle index, integer
- time, float
Example:
|
.getPositions
Computes the (interpolated) particle positions with a given step size. Sampling starts at “minTime” and increments by step size up to “maxTime”. Returns a list of tuples (time, position). This command only works in combination with the gd.getParticles command.
Input:
- batch index, integer
- particle index, integer
Example:
|
.getPositionsAtTime
Computes all (interpolated) particle positions at a given time. This command only works in combination with the gd.getParticles command.
Input:
- batch index, integer
- time, float
Example:
|