← Back to team overview

yade-users team mailing list archive

Re: [Question #230139]: clumps generating randomly in 2D simulation

 

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

    Status: Open => Answered

Christian Jakob proposed the following answer:
I would do somethink like this:

- generate random points in your desired area with random.seed() [1]
- use this points as balance points for your clumps and generate them, use [2] or [3]
- after one clump is generated, check if there are overlaps with other particles -> if there is an overlap, do not generate and try another random point ... something like:

for b in O.bodies:
 if isinstance(b.shape,Sphere):
  if (abs(b.state.pos - randomClumpMemberPos) > (b.shape.radius + ClumpMemberRadius)):
   #create the sphere
  else:
   #try another random point

- then you will get a loose clump packing
- switch on gravity and let your packing settle down

[1] http://docs.python.org/2/library/random.html#random.seed
[2] https://www.yade-dem.org/doc/yade.wrapper.html?highlight=clump#yade.wrapper.BodyContainer.clump
[3] https://www.yade-dem.org/doc/yade.wrapper.html?highlight=clump#yade.wrapper.BodyContainer.appendClumped

hope it helps,

christian

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.