← Back to team overview

yade-dev team mailing list archive

Re: [Branch ~yade-dev/yade/trunk] Rev 2078: Adaptation to Eigen Library

 

Hi, all!

Can anybody check this commit? I do not completely understand the function.
I have added the "check" for null-vectors, as Eigen is a very strict on it,
it gives NANs.

Thank you.
______________________________


Anton Gladkyy


2010/3/12 <noreply@xxxxxxxxxxxxx>

> ------------------------------------------------------------
> revno: 2078
> committer: Anton Gladky <gladky.anton@xxxxxxxxx>
> branch nick: trunk
> timestamp: Fri 2010-03-12 22:20:32 +0100
> message:
>  Adaptation to Eigen Library
> modified:
>  pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_SphereSphere.cpp
>
>
> --
> lp:yade
> https://code.launchpad.net/~yade-dev/yade/trunk<https://code.launchpad.net/%7Eyade-dev/yade/trunk>
>
> Your team Yade developers is subscribed to branch lp:yade.
> To unsubscribe from this branch go to
> https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription<https://code.launchpad.net/%7Eyade-dev/yade/trunk/+edit-subscription>
> .
>
> === modified file
> 'pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_SphereSphere.cpp'
> --- pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_SphereSphere.cpp
>  2010-03-10 09:18:14 +0000
> +++ pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_SphereSphere.cpp
>  2010-03-12 21:20:32 +0000
> @@ -40,9 +40,12 @@
>  * @note It is not checked whether planePt relly lies on the tangent plane.
> If not, result will be incorrect.
>  */
>  Quaternionr Dem3DofGeom_SphereSphere::rollPlanePtToSphere(const Vector3r&
> planePt, const Real& radius, const Vector3r& planeNormal){
> -       Vector3r axis=planeNormal.Cross(planePt); axis.Normalize();
> -       Real angle=planePt.Length()/radius;
> -       Quaternionr normal2pt(axis,angle);
> +       Quaternionr normal2pt;
> +       if (planePt!=Vector3r::ZERO) {
> +               Vector3r axis=planeNormal.Cross(planePt); axis.Normalize();
> +               Real angle=planePt.Length()/radius;
> +               normal2pt.FromAxisAngle(axis,angle);
> +       }
>        Quaternionr ret; ret.Align(Vector3r::UNIT_X,normal2pt*planeNormal);
>        return ret;
>  }
>
>
> _______________________________________________
> 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