yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #08217
Re: : Add damping coefficient to material
-
To:
yade-dev@xxxxxxxxxxxxxxxxxxx
-
From:
Klaus Thoeni <klaus.thoeni@xxxxxxxxx>
-
Date:
Thu, 19 Jan 2012 21:25:39 +1100
-
In-reply-to:
<CALF6qJmXu3Y-T-WYTa8u_cK1MjpFmiR9KqxyCUjOE=6TtV5Dkg@mail.gmail.com>
-
User-agent:
KMail/1.13.6 (Linux/2.6.38-8-generic; KDE/4.6.5; x86_64; ; )
Hi Anton,
I just had a look at py/tests/clump.py, that's the test which fails. I added
this after line 60 (before NewtonIntegrator is called):
for b in O.bodies: print b.material
and that's what I get:
<FrictMat instance at 0x1014c10>
None
So the second body has no material. I think it's more a problem in the test.
In a, lets say, real simulation the material always exists (or not?), so I am
not sure if checking for the material makes sense and it would be quit
inefficient.
However, I am not familiar with the testing stuff. Is there anyone who knows
why the second body gives 'None' for the material?
Klaus
On Thu, 19 Jan 2012 06:31:09 PM Anton Gladky wrote:
> > Real getDampCoeff() { return material->damping; };
>
> Can you check here a material existence?
>
> Anton
>
> On Thu, Jan 19, 2012 at 8:14 AM, Klaus Thoeni <klaus.thoeni@xxxxxxxxx>
wrote:
> > Hi guys,
> >
> > can anyone help me on this?
> >
> > Klaus
> >
> > On Thu, 12 Jan 2012 06:03:16 PM Klaus Thoeni wrote:
> >> Hi guys,
> >>
> >> as discussed with Bruno in Barcelona I need different non-viscous
> >> damping coefficients for different materials. I introduced this
> >> capability by adding a variable damping to the base class material
> >> which is initialised with NaN. The body class has a function
> >> getDampCoeff() and in
> >> NewtonIntegrator I use this function in order to change the damping
> >> coefficients. When running some examples it seems that everything works
> >> fine. However, I just run 'yade --test' and it gives me a seg fault:
> >>
> >> testVelocity (yade.TestSimpleClump)
> >> Clump: velocities of member assigned by NewtonIntegrator ...
> >> Segmentation fault
> >>
> >> I think I now where the problem is. In NewtonIntegrator I call something
> >> like:
> >>
> >> if(!isnan(b->getDampCoeff())) dampcoeff=b->getDampCoeff();
> >>
> >> where getDampCoeff() is defined in body.hpp as:
> >>
> >> Real getDampCoeff() { return material->damping; };
> >>
> >> I think the test doesn't have a material and therefore I get the seg
> >> fault. Right? How can we fix this so that I can commit the code?
> >>
> >> Klaus
> >
> > _______________________________________________
> > 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
References