← Back to team overview

yade-users team mailing list archive

Re: [Question #372295]: specific number of spheres in randomDennsePack

 

Question #372295 on Yade changed:
https://answers.launchpad.net/yade/+question/372295

    Status: Open => Answered

Jérôme Duriez proposed the following answer:
Let's imagine for instance you have 10 000 particles in total and would
like 30% of them to be of material2 type. You may randomly pick 3000
particles "b", picking e.g. 3000 random distinct id numbers between 0
and 9999 (which would normally be the id range in such a simulation).
You may need to search on the internet which Python functions exist to
get random numbers.

This is how you would constitute this "listOfParticlesWithMaterial" and
apply b.material = O.materials[idParticulate2].

It would be a little more complicated in case you need to choose the
particles according to their sizes. If it gets too complicated, I would
advice you first start disregarding any size consideration and stick
with the simpler task above, in a first step.

In an even more preliminary step, depending on your current YADE skills,
you may also play with a very basic simulation with 10 particles to get
familiars with id of bodies, bodies themselves, and their materials.

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.