← Back to team overview

yade-users team mailing list archive

Re: Function for sphere packing

 

> Hello all,

Hi Bruno :)
 
> I think some of you (Yuannian, Lionel,...) will be interested by the 
> function "GenerateCloud" I have pasted at the end of this post, which 
> generate a cloud of non-overlapping spheres inside a box (thanks to the 
> number generator from Janek;)).
> I use it in the triaxial test file generator, but I have not made it a 
> member of TriaxialTest, so that it is easy to re-use by simply copy-paste.

Heh, your words exactly underline what is wrong with filegenerator. Yes
currently there is no ther way, than to copy-paste, when someone else
wants to use this code. I want to make it much better, so that there
will be no duplicate code at all in all the sources.

> Using this function together with TriaxialStressController, it is now 
> possible to generate compact random assemblies in Yade :).
> I am not completly satisfied by this method, so all this is still in 
> development....
> 
> BTW (Janek?...):
> 1) I want to increase the radii of spheres during the simulation, is it 
> enough to multiply the radius by "r" and the size of the bounding boxes 
> by the same "r"??

You need to change the radius of Sphere, and InteractingSphere. Bounding
volume will get updated automatically - because in the engines list you
have BoundingVolumeDispatcher, which contains InteractingSphere2AABB.
(just look inside InteractingSphere2AABB, and you will see what is done
on each timestep).

(note to self - consider renaming BoundingVolumeDispatcher to
BoundingVolumeUpdater ...)

BTW - putting BoundingVolumeDispatcher only in the initializers list to
skip this step in each iteration will not work, because Speres'
positions are changing on each timestep. Maybe this function could be
split into two parts - one that updates position, other that updates
size. But I'm not sure if there will be any speed increase here. It's
already very short....

Also I plan to find a way to avoid duplicate Spheres - we have currently
Sphere and InteractingSphere. The idea is to allow separate
Interacting???? class, but use the original GeometricalModel (Sphere)
when Interacting???? is not defined. And when it will be defined, it will
allow to have a different interacting radius (for example to cleanly
solve problems that Luc had with capillary law). When I do that, you
will have to change radius in only one place. But that's the future ;)


> 2) Is the group-mask stuff working currently?

If you want to have groups of bodies treated in different way, this is
currently the only way to go. But to be honest I'm not sure if it
works... It should, but it's a huge mess already. You can try to use it.
If it won't work, you will eventually find and fix errors, so it will
work for you. I'm sorry about this poor answer :/

The idea was that each bit in this integer represents one group, so
that body can belong to many groups, where number of bits is the maximum
total number of groups. But I was still finding some bugs related to
that here and there.

I have now a clear idea how to solve this, make it very clean, intuitive
and much simpler than currently. This change is an important part of the
forthcoming redesign.

So if you need it now, you can modify it as much as you want. In the end
- the next yade version will be totally different in this aspect.


-- 
Janek Kozicki                                                         |
_______________________________________________
Yade-users mailing list
Yade-users@xxxxxxxxxxxxxxxx
http://bat.berlios.de/mailman/listinfo/yade-users



References