← Back to team overview

yade-dev team mailing list archive

Re: Strange behaviour of function unbalancedForce

 

Hi Bruno,

I derived my WireMat from NormShearPhys and indeed it is working fine now. I 
think for now it's the best solution. Let me know if you are happy with this 
solution.
If in the future we have more cases with normal forces only it might be better 
to introduce the boolean you mentioned. But we would have to check it in 
several lines inthe code.

Regarding the results I got previously. All results where wrong, although they 
where the same if I used one threat. Well, in debug mode the simulation was 
not running because of the assert.

Thanks,
Klaus

On Wed, 12 Oct 2011 12:06:39 AM Bruno Chareyre wrote:
> Yes, deriving from NormShear would do the "trick". It is suboptimal in
> terms of memory usage but the impact will be small.
> There could be other ways, like passing an optional bool "hasShear" to
> the unbalancedForce function, but it would solve only one specific
> problem and if normShearPhys is used everywhere you will indeed hit the
> same problem again with other functions.
> 
> Something I still don't get is why it works _sometimes_, and why your
> interactions don't simply give a crash on the typecasting:
> shared_ptr<NormShearPhys> nsi=YADE_PTR_CAST<NormShearPhys>(I->phys);
> 
> Any idea?
> 
> Bruno
> 
> p.s. Please, don't send mails to me+yade-dev (it makes duplicates in my
> mbox and it disables the reply-to-list feature of thunderbird), yade-dev
> alone will be enough.
> 
> On 11/10/11 09:50, Klaus Thoeni wrote:
> > Hi Bruno,
> > 
> > I just had a look at the code and NormShearPhys is used in many other
> > places as well. This means that it is always assumend that there is a
> > normal and a shear force. So probably I should derive WirePhys from
> > NormSherPhys and set ks and Fs equal to zero.
> > 
> > What do you think?
> > 
> > Klaus
> > 
> > On Mon, 10 Oct 2011 11:51:40 PM Bruno Chareyre wrote:
> >> Hi,
> >> 
> >> If you can get 0 after pausing, then it's a good starting point for
> >> debugging. In release build, you may try and check if there are forces
> >> on the bodies.
> >> In debug build (does it give 0 too?) you could set a breakpoint at
> >> Shop.cpp:162 and see what happens line by line, surely the best way.
> >> 
> >> Bruno
> >> 
> >> On 10/10/11 14:16, Klaus Thoeni wrote:
> >>> Hi,
> >>> 
> >>> yes, if you pause the simulation unbalancedForce() is still exactly 0.
> >>> 
> >>> Regarding the results for displacements:
> >>> - if I run the same file with -j1 I will get exactly the same
> >>> deformation, however the the unbalancedForce is not exactly the same
> >>> - if I compare the displacements of a case where I used
> >>> multi-threading the displacements are exactly the same for a certain
> >>> amount of iterations then the slightly differ (even if unbalancedForce
> >>> is 0 from beginning)
> >>> 
> >>> I am still trying to find out what's going on. Any hints are welcome!
> >>> 
> >>> Thanks,
> >>> Klaus
> >>> 
> >>> 
> >>> 
> >>> On Fri, Oct 7, 2011 at 9:35 PM, Bruno Chareyre
> >>> 
> >>> <bruno.chareyre@xxxxxxxxxxx <mailto:bruno.chareyre@xxxxxxxxxxx>> wrote:
> >>>     I can't imagine any explanation yet. It is strange.
> >>>     I wonder if the unbalanced force will also be exactly 0 if you
> >>>     pause the
> >>>     simulation and type unbalancedForce() in the terminal.
> >>>     Are you sure that the results in terms of positions and deformation
> >>>     of the net are always the same? else it could mean that there is
> >>>     another problem that the unbalanced force is only reflecting.
> >>>     
> >>>     Bruno
> >>>     
> >>>     On 07/10/11 07:08, Klaus Thoeni wrote:
> >>>     > Hi guys,
> >>>     > 
> >>>     > yes, you have to try it several times in order to reproduce the
> >>>     
> >>>     strange
> >>>     
> >>>     > behaviour.
> >>>     > 
> >>>     > However, I found out a bit more. Actually it might be a problem
> >>>     
> >>>     with multi-
> >>>     
> >>>     > threading. Maybe someone can try to reproduce the behaviour. The
> >>>     
> >>>     following
> >>>     
> >>>     > link provides a slightly modified version my script and a bash
> >>>     
> >>>     script which
> >>>     
> >>>     > allows for several executions for -j1 and -j2 (before running the
> >>>     
> >>>     script make
> >>>     
> >>>     > sure it is executable 'chmod +x runscript'). In addition I
> >>>     
> >>>     included as well my
> >>>     
> >>>     > results.
> >>>     > 
> >>>     > http://bit.ly/rtN0w3
> >>>     > 
> >>>     > Something very strange is that my desktop has the same problem
> >>>     
> >>>     even with -j1
> >>>     
> >>>     > (eaven cpu usage is more than 100% and I have no idea why)
> >>>     
> >>>     whereas my notebook
> >>>     
> >>>     > gives the right results in that case (cpu usage is max 100%) just
> >>>     
> >>>     have a look
> >>>     
> >>>     > at the graphs. It would be good to find out if this problem
> >>>     
> >>>     effects just me or
> >>>     
> >>>     > if it is a general problem in YADE. Any hints are welcome and I
> >>>     
> >>>     really
> >>>     
> >>>     > appreciate your help!
> >>>     > 
> >>>     > Thanks
> >>>     > 
> >>>     > Klaus
> >>>     > 
> >>>     > On Thu, 6 Oct 2011 07:58:24 PM Bruno Chareyre wrote:
> >>>     >> I tried the script and didn't find the problem. It needs more
> >>>     >> runs maybe. But first, could you explain how you use the
> >>>     >> function (in a periodic engine/ live typing/a command in the
> >>>     >> script)? It would help understanding what happens.
> >>>     >> 
> >>>     >> Bruno
> >>>     >> 
> >>>     >> On 06/10/11 07:53, Klaus Thoeni wrote:
> >>>     >>> Hi Anton,
> >>>     >>> 
> >>>     >>> I tired it already (I know this issue), still the same
> >>>     
> >>>     behaviour. And now
> >>>     
> >>>     >>> actually I got zero for Bruno's branch as well. Very strange
> >>>     >>> :-( Not sure what the problem is. Would be great if someone
> >>>     >>> could
> >>>     
> >>>     try if
> >>>     
> >>>     >>> he/she gets the same behaviour.
> >>>     >>> 
> >>>     >>> Thanks,
> >>>     >>> Klaus
> >>>     >>> 
> >>>     >>> On Thu, 6 Oct 2011 04:30:53 PM Anton Gladky wrote:
> >>>     >>>> Hi Klaus,
> >>>     >>>> try to start your script with -j1 option.
> >>>     >>>> There are sometimes some issues with "numerical" error in
> >>>     
> >>>     multi-thread
> >>>     
> >>>     >>>> mode.
> >>>     >>>> 
> >>>     >>>> Anton
> >>>     >>>> 
> >>>     >>>> On Thu, Oct 6, 2011 at 6:40 AM, Klaus Thoeni
> >>>     
> >>>     <klaus.thoeni@xxxxxxxxx <mailto:klaus.thoeni@xxxxxxxxx>>
> >>>     
> >>>     > wrote:
> >>>     >>>>> Hi guys,
> >>>     >>>>> 
> >>>     >>>>> I just wanted to use the function unbalancedForce in one of
> >>>     
> >>>     my scripts.
> >>>     
> >>>     >>>>> And look what is happening: running the same simulation
> >>>     
> >>>     several times
> >>>     
> >>>     >>>>> after each other gives different results for the
> >>>     
> >>>     unbalancedForce. Well
> >>>     
> >>>     >>>>> either some values which seem all right or just zero. The
> >>>     
> >>>     script I used
> >>>     
> >>>     >>>>> is:
> >>>     >>>>> examples/WireMatPM/wirecontacttest.py
> >>>     >>>>> 
> >>>     >>>>> Even using different computers and different versions of yade
> >>>     
> >>>     gives
> >>>     
> >>>     >>>>> this problem. However, it doesn't happen all the time. It
> >>>     
> >>>     seems like
> >>>     
> >>>     >>>>> you have to try several times to get the wrog value (which is
> >>>     
> >>>     zero)
> >>>     
> >>>     >>>>> for unbalancedForce and if I use Bruno's collide2 branch it
> >>>     
> >>>     seems to
> >>>     
> >>>     >>>>> work all the time.
> >>>     >>>>> 
> >>>     >>>>> So I don't know if it is a problem with my script or a
> >>>     
> >>>     problem of the
> >>>     
> >>>     >>>>> current trunk version. Can anyone reproduce this problem?
> >>>     >>>>> 
> >>>     >>>>> Thanks
> >>>     >>>>> Klaus
> >>>     >>>>> 
> >>>     >>>>> _______________________________________________
> >>>     >>>>> Mailing list: https://launchpad.net/~yade-dev
> >>>     
> >>>     <https://launchpad.net/%7Eyade-dev>
> >>>     
> >>>     >>>>> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> >>>     
> >>>     <mailto:yade-dev@xxxxxxxxxxxxxxxxxxx>
> >>>     
> >>>     >>>>> Unsubscribe : https://launchpad.net/~yade-dev
> >>>     
> >>>     <https://launchpad.net/%7Eyade-dev>
> >>>     
> >>>     >>>>> More help   : https://help.launchpad.net/ListHelp
> >>>     >>>> 
> >>>     >>>> _______________________________________________
> >>>     >>>> Mailing list: https://launchpad.net/~yade-dev
> >>>     
> >>>     <https://launchpad.net/%7Eyade-dev>
> >>>     
> >>>     >>>> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> >>>     
> >>>     <mailto:yade-dev@xxxxxxxxxxxxxxxxxxx>
> >>>     
> >>>     >>>> Unsubscribe : https://launchpad.net/~yade-dev
> >>>     
> >>>     <https://launchpad.net/%7Eyade-dev>
> >>>     
> >>>     >>>> More help   : https://help.launchpad.net/ListHelp
> >>>     >>> 
> >>>     >>> _______________________________________________
> >>>     >>> Mailing list: https://launchpad.net/~yade-dev
> >>>     
> >>>     <https://launchpad.net/%7Eyade-dev>
> >>>     
> >>>     >>> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> >>>     
> >>>     <mailto:yade-dev@xxxxxxxxxxxxxxxxxxx>
> >>>     
> >>>     >>> Unsubscribe : https://launchpad.net/~yade-dev
> >>>     
> >>>     <https://launchpad.net/%7Eyade-dev>
> >>>     
> >>>     >>> More help   : https://help.launchpad.net/ListHelp
> >>>     
> >>>     --
> >>>     _______________
> >>>     Bruno Chareyre
> >>>     Associate Professor
> >>>     ENSE³ - Grenoble INP
> >>>     11, rue des Mathématiques
> >>>     BP 46
> >>>     38402 St Martin d'Hères, France
> >>>     Tél : +33 4 56 52 86 21 <tel:%2B33%204%2056%2052%2086%2021>
> >>>     Fax : +33 4 76 82 70 43 <tel:%2B33%204%2076%2082%2070%2043>
> >>>     ________________
> >>>     
> >>>     
> >>>     _______________________________________________
> >>>     Mailing list: https://launchpad.net/~yade-dev
> >>>     <https://launchpad.net/%7Eyade-dev>
> >>>     Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> >>>     <mailto:yade-dev@xxxxxxxxxxxxxxxxxxx>
> >>>     Unsubscribe : https://launchpad.net/~yade-dev
> >>>     <https://launchpad.net/%7Eyade-dev>
> >>>     More help   : https://help.launchpad.net/ListHelp


Follow ups

References