← Back to team overview

yade-dev team mailing list archive

: Add damping coefficient to material

 

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


Follow ups