← Back to team overview

yade-dev team mailing list archive

Re: static_cast in GSTS

 

2010/5/17 Václav Šmilauer <eudoxos@xxxxxxxx>

> > NormShearPhys*
> > phys=YADE_CAST<NormShearPhys*>(contact->interactionPhysics.get());
> > assert(phys);
> > // all we need for getting stiffness
> > Vector3r& normal=geom->normal; Real& kn=phys->kn; Real& ks=phys->ks;
> > Real& radius1=geom->refR1; Real& radius2=geom->refR2;
> > Real fn = (static_cast<NormShearPhys *>
> > (contact->interactionPhysics.get()))->normalForce.squaredNorm();
> > if (fn==0) continue;//Is it a problem with some laws? I still don't
> > see why.
> >
> > Two questions:
> > 1) Why are we here casting to the class NormShearPhys instead of
> > FrictPhys class?
> That is to make code more generic. Only normal and shear
> forces/stiffnesses are needed in the computation and that is already
> provided by NormShearPhys. FrictPhys is derived from NormShearPhys, but
> data added in FrictPhys are not needed.
>
> In this case, e.g. CpmPhys will work with GSTS (although I don't use
> it), since it also derives from NormShearPhys, but not from FrictPhys.
>
Ok. So is the derived class object also a base class object? Exactly the
same one?
cheers, Chiara

>
> > 2) Why do we need to continue if fn==0?
> IIRC Bruno told me that was to avoid contacts that transmit no force,
> even if they have non-zero nominal stiffness. Exact zero will be there
> for interactions that really had no force at all.
>
> I am not completely persuaded on that, since most likely contacts with
> exactly zero force will be already erased.

Yes, that is why I was guessing about that.

>
> HTH, Vaclav
>
>
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev<https://launchpad.net/%7Eyade-dev>
> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev<https://launchpad.net/%7Eyade-dev>
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References