-
Hello, I am slightly confused by the number of fluid particles in my simulation. As part of my scene I am adding a FluidBlock of a fixed size. During initialization, the number of fluid particles is returned as being 350. However, when I print out the number of particles in the fluid model during the simulation (using the numberOfParticles() function of FluidModel), it returns 10,350 as the number. When I just ask for the number of active particles (getNumActiveParticles0()), it returns the expected number of 350. So where are these 10,000 additional, apparently non-active particles coming from? During the simulation, only the 350 active particles seem to be moving. Is there a way to remove these 10,000 additional particles or at least to get the ids of just the active particles, so I can look at just the relevant active particles for my next steps? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The simulator allocates memory for all fluid particles plus the ones that could be emitted by an emitter (this is defined by the value maxEmitterParticles). The default value of maxEmitterParticles is 10000. So this is why you get this number. You find info how to change this value here: https://splishsplash.readthedocs.io/en/latest/file_format.html#id2 While the emitter particles are allocated at simulator start, only the active particles are used. So in your code you should always use the function getNumActiveParticles(). From index 0 to this number you will get your particles in all arrays (position, velocity, ...). Hope that helps. |
Beta Was this translation helpful? Give feedback.
The simulator allocates memory for all fluid particles plus the ones that could be emitted by an emitter (this is defined by the value maxEmitterParticles). The default value of maxEmitterParticles is 10000. So this is why you get this number. You find info how to change this value here:
https://splishsplash.readthedocs.io/en/latest/file_format.html#id2
While the emitter particles are allocated at simulator start, only the active particles are used. So in your code you should always use the function getNumActiveParticles(). From index 0 to this number you will get your particles in all arrays (position, velocity, ...).
Hope that helps.