Hi Julian, When you use a tracker to track particles, it's designed to target a "batch." So the intended usage is to generate a new tracker for each "AddClumps," and use an offset to get to a clump in this batch (e.g. *my_tracker->Pos(n)* to get the position of the *n*-th clump). A tracker is in general not modifiable and it is a small data struct that merely points to a location in the entity array. I suppose the reason why you want to consolidate all trackers into one is that you know the offset for all of the particles (aka you know how large each batch is, but you probably have many batches), so offseting into them from a single tracker is more convenient. You can approach this via one of the following three... 1) Like I mentioned last time, DEME is implemented in such a way that if you continuously *AddClumps *and not adding any other type of objects in between each clump insertion, then under the hood the IDs of those clumps are continuous. This means you can directly use the first tracker to index into a clump that is not a part of this batch (aka goes out-of-bound). This is more or less a hack. 2) Save all the trackers generated by each AddClumps call, then write your own data structure that is capable of finding the correct tracker to use based on the offset. Should be pretty easy with two vectors. 3) Forget about trackers and use DEMSolver methods to do it directly via owner IDs. Relevant methods include *SetOwnerPosition*, *SetOwnerVelocity *etc. If you need a initial numbering to start with, you can get it through a tracker using the *GetOwnerID *tracker method. However, those methods are not wrapped in Python yet if I remember.
And you correctly noted that you can get owner IDs using the corresponding tracker. There is no other easy way to get that information. If you have a special use case that requires you to do it differently, you can let me know. Thank you, Ruochun On Sunday, July 14, 2024 at 12:04:32 AM UTC+8 [email protected] wrote: > Hi Ruochun, > I've created a new conversation for this question because this question is > not related to any of my GPU problems, which I'm still working on. I'm > optimistic that the problem will be resolved by running the solvers on > different GPU devices but I haven't had the resources to do that yet. > > I'm trying to add a particle inflow to my simulation right now and I'm > aware that there is no such feature directly implemented yet. > My idea is to add the particles by using the AddClumps and UpdateClumps > methods. My question is if it is possible to add the newly added clumps to > my existing Tracker object since that is the way I'm setting the properties > of the particles in my code. > After looking through the code a little bit, I couldn't find any way to > add the new particles to the same tracking object. Is there a way to do > that? > > Another of mine would be to retrieve the bodyIDs after initialisation and > using them. What is the correct way to get the bodyIDs in that case? I've > seen that it is possible by using a tracker object as well. > > Please let me know if you have any solutions or other ideas that might > help me. > Julian > > -- You received this message because you are subscribed to the Google Groups "ProjectChrono" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/a03606f5-3094-4e63-955b-b5c0e94120cbn%40googlegroups.com.
