← Back to team overview

yade-dev team mailing list archive

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

 

Hi Christian

On Wednesday 02 October 2013 07:18:28 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

Are you sure that updateProperties is not called for each sphere in the clump 
list? This means you would loop over the grid and all spheres for each sphere.

BTW, the loop over the grid could probably be parallelised with some 
#pragma omp parallel for reduction(+:M,Sg,Ig). 

> > 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 ;)

Of course, that would be nice, something like appendClumped(listOfBodies, 
divisor). I was actually about to have a look how to implement it as well. So 
let me know if you are doing it.

Klaus

-- 
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.
https://bugs.launchpad.net/bugs/1229783

Title:
  Loading clumps takes too much time

Status in Yet Another Dynamic Engine:
  In Progress

Bug description:
  The examples/packs/packs.py hangs in line 46 [1] because
  of appendClumped command.

  Changing it to "append" fixes the problem. So, it seems, 
  appendClump has infinite loop  somewhere.

  [1]
  https://github.com/yade/trunk/blob/master/examples/packs/packs.py#L46

To manage notifications about this bug go to:
https://bugs.launchpad.net/yade/+bug/1229783/+subscriptions


References