Hi all,
I recently ran into a little issue with the Particles Parameters set up. After the Particles subsection has been partially moved out from the Postprocessors subsection, it is now impossible to specify the number of particles if using the “random uniform” particle generator.
According to the updated cookbook composition_passive_particles.prm
, it looks like one can get away with it by using the “probability density function” with a function expression of “0”. However, I also notice that in the source code random_uniform.cc
, the function expression is given as Functions::ConstantFunction<dim>(1.0)
. Does it mean the same thing as have a function expression of “0”?
Best,
Lucy
Hi Lucy,
This is poorly described at the moment, but the “random uniform” particle generator uses the parameters from the “probability density function”, because it is just a special case of that generator (i.e. “random uniform” just means create particles randomly in the whole domain with a probability density function of particles that is constant across the domain). So at the moment in order to specify the number of particles for random uniform, just set the parameter “Particles/Generator/Probability density function/Number of particles” and ignore all the other parameters of probability density function. However, you are right that this is not well documented and also not intuitive. We could change the subsection in random_uniform.cc to use a subsection “Random uniform” instead.
Best,
Rene
Take a look at Update subsection for random uniform particle generator by gassmoeller · Pull Request #6092 · geodynamics/aspect · GitHub. I separated the input parameters of the two generators ‘random uniform’ and ‘probability density function’. There are still some test issues, but this should fix your problem.
Hi Rene,
Thanks for the clarification!
I have one short follow-up question: if I set the function expression in the “probability density function” subsection to be “1”, what probability density function I am actually using? Would it be the same as using “probability density function” using all the defaulted setting?
Best,
Lucy
If you use the “probability density function” with a pdf that is “1” over the whole domain you will get exactly the result of the “random uniform” generator. Previously the pdf generator by default used a pdf function of 0, which does not work (you may have noticed), I changed that in this recent pull request: Fix default value of probability density function particle generator by gassmoeller · Pull Request #6093 · geodynamics/aspect · GitHub.