Hi everyone,
I have a follow-up question regarding particle creation through a custom API factory.
I am currently generating stems continuously during the simulation using a custom factory. For each created particle, I already assign several custom particle properties, including:
local particle ID
StemID
StemElementType
StemElementIndex
MetaGroupID
creation time
My main issue is that after a particle is created by the factory, I would like to map my own local particle ID to the internal EDEM particle ID, so that I can later access the particle reliably through the Particle Manager API.
From what I have seen so far, I can request particle data if I already know the EDEM particle ID (getParticleID), but I have not found a clear way to directly obtain the internal ID of the particle that was just created by the factory.
So my questions are:
- Is there any supported API way to directly access the particle that was just created by a custom factory?
for example, a callback, handle, pointer, or a function to retrieve the last created particle / its internal ID - If not, how are internal EDEM particle IDs assigned in practice?
Are newly created particles always assigned increasing IDs?
If I create particles in one timestep, can I assume that their internal IDs are in the newly added ID range? - What happens when particles are deleted?
Are deleted particle IDs reused later?
Or once an internal particle ID has been assigned, is it never used again during the same simulation? - Would it be reasonable to identify newly created particles by scanning only the newly added internal particle IDs and matching them through a custom particle property such as my local particle ID?
The reason I ask is that I would like to build a reliable mapping:
local factory particle ID -> internal EDEM particle ID
This would let me track particles later through the API without having to guess or scan the full particle space repeatedly.
Any clarification on the actual ID assignment logic, or on the recommended API workflow for this, would be very helpful.
Thank you very much.