← Back to team overview

yade-dev team mailing list archive

Re: [Bug 1229783] Re: Loading clumps takes too much time

 

Thanks Christian for comments.
Is that possible to use the same method as before, where the inertia was
just the total inertia of members? We should really keep that option
even if the default is now to compute inertia automaticaly. Reasons are
that sometimes we want something fast and we don't care about physical
correctness, or someone may want to define inertia his own way.
It is not nice if appendClumped() is forcing a round of
updateProperties() when overlaps are present.

For the TODO, it seems to me that the best way is to add arguments to
clump() and other functions, and give them default values.
Body::id_t clump(vector<Body::id_t> ids,unsigned int discretization,
bool updateProp){
...
.def("clump",&pyBodyContainer::clump,(python::arg("discretization")=5,
python::arg("updateProp")=true),"Clump given bodies together...

This way, you don't force everyone to type all arguments and you can
define reasonable defaults, but at the same time it is very flexible.

Bruno


On 02/10/13 09:18, Christian Jakob wrote:
>> If I have a clump with, let's say, 20 particles. Will there be 20
>> computations of inertia (each time we add a new member) or only one?
> Bruno, as you know there are several ways of creating/modifying a clump.
>
> Each call of Clump::updateProperties(clumpBody); 
> will cause approximation of inertia and this takes some time...
>
> updateProperties is called in following methods:
>
> - clump() (see [1])
> - appendClumped() (which calls clump() method)
> - addToClump() (see [2])
> - releaseFromClump() (see [3]) and
> - replaceByClumps (which also calls clump() method)
>
> If you use addToClump() method it is possible to add more than one body
> via python list. The updateProperties method will be called once per
> addToClump() call.
>
> [1] https://github.com/yade/trunk/blob/master/py/wrapper/yadeWrapper.cpp#L152
> [2] https://github.com/yade/trunk/blob/master/py/wrapper/yadeWrapper.cpp#L182
> [3] https://github.com/yade/trunk/blob/master/py/wrapper/yadeWrapper.cpp#L197
>
>> We should find a default behavior that do not take ages to compute
>> anyway, be it at the price of big approximations.
> I agree. As you can see here [4] there is a TODO. Edge length of one
> cell for approximation of inertia tensor is defined as minimum clump
> member radius divided by divisor (actually 15). To avoid worst case of a
> clump with one very small member a maximum number of cells is defined
> [5]. The maximum number of cells is limited to 150^3 = 3.375 million.
>
> If we change default of divisor (in woo it is 5), the accuracy of inertia approx. will be lower but the scheme would be much faster. I think the best way would be to make it choosable for users (see TODO). 
> I can do it with some help from dev-side. Where and can divisor be defined and choosable by users (NOTE that updateProperties is called by 5 methods (see above)!)
>
> [4] https://github.com/yade/trunk/blob/master/core/Clump.cpp#L153
> [5] https://github.com/yade/trunk/blob/master/core/Clump.cpp#L156
>
>> loading a clump takes ages indeed (I have clumps with 100 particles) but not
>> sure if this is a bug. Maybe there is something wrong with the loops?
> Klaus, would you agree with my suggestions? Then you could choose
> accuracy/speed of inertia approximation by yourself ;)
>


-- 
_______________
Bruno Chareyre
Associate Professor
ENSE³ - Grenoble INP
Lab. 3SR
BP 53
38041 Grenoble cedex 9
Tél : +33 4 56 52 86 21
Fax : +33 4 76 82 70 43
________________



Follow ups

References