← Back to team overview

yade-users team mailing list archive

Re: Force Container

 

> why has ForceContainer to store also displacements and rotations? For
> instance, in NewtonIntegrator, I see:
> state->pos += state->vel*dt + scene->forces.getMove(id);
> Could not we use just state->pos?
That is only used for forced non-dynamic diplacements and rotations. If
you see for rotations (in leapfrogSphericalRotate or
leapfrogAsphericalRotate), it it used only if such forced rotations are
used at all (which is rare), since the computation is expensive. For
displacements, I thought it will be no big benefit to have

state->pos += state->vel*dt;
if(scene->forces.getMoveRotUsed()) scene->pos+=scene->forces.getMove(id);

instead of 

state->pos += state->vel*dt + scene->forces.getMove(id);

I changed it in the code to the first form now, though, for clarity.

Vaclav





References