← Back to team overview

yade-dev team mailing list archive

Re: [Branch ~yade-dev/yade/trunk] Rev 1816: 1. TranslationEngine and PressTestEngines are activated

 

> -
>        Real dt=Omega::instance().getTimeStep();
> -       const int sign = 1; // ?
>        FOREACH(body_id_t id,subscribedBodies){
>                assert(id<(body_id_t)bodies->size());
> -               if(ParticleParameters* p =
> dynamic_cast<ParticleParameters*>((*bodies)[id]->physicalParameters.get())){
> -                       p->se3.position+=sign*dt*velocity*translationAxis;
> -                       p->velocity=sign*velocity*translationAxis;
> -               } else{
> -
> Body::byId(id,ncb)->physicalParameters->se3.position+=sign*dt*velocity*translationAxis;
> -               }
> +               Body* b=Body::byId(id,ncb).get();
> +               if(!b) continue;
> +               b->state->pos+=dt*velocity*translationAxis;
> +               b->state->vel=velocity*translationAxis;
>        }
>  }
>

I did not understand, why there is 'sign' is used, so I deleted it.
If I am not right, please, let me know or fix it.

Thank you.

References