yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #07376
Re: clump unbalanced force patch
I see the problem.
The fix is here (and pasted below):
http://bazaar.launchpad.net/~yade-dev/yade/trunk/revision/2640?start_revid=2640#pkg/dem/Shop.cpp
The original unbalancedForce() from triax has been duplicated in shop,
then only the duplicate has been fixed.
I think the code below is simpler than what you did, and it should work.
I'll try and let you know.
We could use th shop version in TriaxSC to remove the duplicate.
Actually, the code could be even simpler (see suggestion) if Newton was
assigning the the correct forces (returned by addForceTorqueFromMembers)
to clump. I'll think about that.
Cheers.
Bruno
160 if(!b || b->isClumpMember() || !b->isDynamic()) continue;
161
if(!b->isClump()){ currF=rb->forces.getForce(b->id).norm(); }
162
else { // for clump, sum forces from members on the clump itself
163
Vector3r f(rb->forces.getForce(b->id)),m(Vector3r::Zero());
164
b->shape->cast<Clump>().addForceTorqueFromMembers(b->state.get(),rb,f,m);
165 currF=f.norm();
166 }
167 maxF=max(currF,maxF); sumF+=currF; nb++;
_____suggestion____
(with Newton assigning forces correctly)
160 if(!b || b->isClumpMember() || !b->isDynamic()) continue;
161 currF=rb->forces.getForce(b->id).norm();
167 maxF=max(currF,maxF); sumF+=currF; nb++;
On 28/03/11 14:56, Janek Kozicki wrote:
> I looked at his commit with command:
>
> bzr diff -r before:2640..2640 | kompare -o -
>
> but I don't see how it could help with unbalanced force.
> Maybe I don't understand something here... and I modified
> TriaxialStressController.cpp, while, maybe the solution is to
> calculate unbalanced force somewhere else?
>
> I don't know how TriaxialStressController.cpp is supposed to call
> UnbalancedForceCallbacks.cpp. But it's a callback, and maybe some
> callback mechanism has slipped my attention.
>
> Currently that triax_clup.py is not working (the force never gets
> balanced), unless the patch is applied.
>
> best regards
> Janek Kozicki
>
> Bruno Chareyre said: (by the date of Mon, 28 Mar 2011 12:55:04 +0200)
>
>> Hi Janek,
>>
>> Vaclav commited a fix for clumps unbalanced forces in r2640 (according
>> to the commit log).
>> Was it not working?
>> I'll have a look.
>>
>> Bruno
>>
>> On 25/03/11 21:39, Janek Kozicki wrote:
>>> Hi Bruno,
>>>
>>> you are very careful about TriaxialStressController.cpp, so I think
>>> that first I will tell you what I changed, instead of surprising you with
>>> a commit. So that you can check this yourself.
>>>
>>> I am attaching a small triax_clump.py which runs triaxial test on
>>> clumps. This will not work, because unbalanced force never gets
>>> balanced. Especially when you use "cigar" (line 82 in this script).
>>>
>>> The problem is described in detail in the attached patch, clump_unbalanced_force.diff
>>> Apply this patch, and then the unbalanced force will handle clumps
>>> correctly, I believe.
>>>
>>> If you like it, then commit this, else let me know what is wrong.
>>>
>>> best regards
>>
>> --
>> _______________
>> Bruno Chareyre
>> Associate Professor
>> ENSE³ - Grenoble INP
>> Lab. 3SR
>> BP 53 - 38041, Grenoble cedex 9 - France
>> Tél : +33 4 56 52 86 21
>> Fax : +33 4 76 82 70 43
>> ________________
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~yade-dev
>> Post to : yade-dev@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~yade-dev
>> More help : https://help.launchpad.net/ListHelp
>>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help : https://help.launchpad.net/ListHelp
--
_______________
Bruno Chareyre
Associate Professor
ENSE³ - Grenoble INP
Lab. 3SR
BP 53 - 38041, Grenoble cedex 9 - France
Tél : +33 4 56 52 86 21
Fax : +33 4 76 82 70 43
________________
References