← Back to team overview

yade-dev team mailing list archive

Re: [Branch ~yade-dev/yade/trunk] Rev 2072: 1. penetrationDepth() is added to DemXDofGeom

 

> virtual Real penetrationDepth(){throw;};

Why do you throw on penetrationDepth for Dem3DofGeom?

Just return (refR1+refR2)-refLength-displacementN() in the base class.
There is no reason to have this function reimplemented in
Dem3DofGeom_SphereSphere etc since everything is defined in the parent
class. (Make sure you understand how virtual functions work;
displacementN() will call function of the derived class, even if called
from Dem3DofGeom::penerationDepth().) Please fix that. 

Cheers, Vaclav





Follow ups

References