Skip to content

Understanding the number of fluid particles #237

Answered by janbender
carosto asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@carosto
Comment options

Answer selected by carosto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants