← Back to team overview

yade-dev team mailing list archive

Re: [Bug 923929] Re: OMP force container fails to reset forces on clump members

 

> 1. Why will adding a vector of zeros [1] helps resetting the forces of clumps?
Because the size of the force container is adjusted dynamically. Adding
a zero force to body "id" instructs the container that "id" is a valid
index, then it will be resetted, otherwise it is not known by the
container. This is weird, of course.

> 2. Why is the collected force of the clumps members added to the ForceContainer [2] ...
Why not? The container is supposed to contain total forces on bodies.
Thus, we need one force per clump. The line you are linking is
incrementing by the forces from each member of the clump.


> 3. and why is this force then again retaken from the ForceContainer? [3]
Because "total += f" (L150) does not mean total==f.
If we need the total we have to get it.
There can be forces applied directly on the clump (user defined forces,
for instance). That is why "total" and "f" may be different.

> There is no need to update the forces in the ForceContainer, because
> there will be reset to zero at the next step. The force is only used to
> calculate the acceleration in [4].
I don't understand this point. It doesn't seem correct to state that the
force is "only used in [4]".
If I write this line is a script, I will be using the force as well, but
this is not something you can anticipate looking at the c++ code:
f=O.forces.f[clumpId]
So we better have them defined correctly.

I hope it helps.

Bruno

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

Title:
  OMP force container fails to reset forces on clump members

Status in Yet Another Dynamic Engine:
  Incomplete

Bug description:
  When clumps are used and no gravity engine is present, force containers are not reseting the forces on clump members. Junk values are accumulated over time and the clump itself soon disappears.
  A workaround is to addForce(0,0,0) once at startup on all bodies, this is done in Newton::action() currently.
  This is most probably (still to check) because containers sizes are checked vs. body Id only in addForce, which is never applied on clump members before they are in contact with something. Not clear is why the same problem does not appear also on standalone bodies.
  The crashing example was obtained from a series of personal scripts from Klaus Thoeni, not disclosed here.

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


References