← Back to team overview

yade-dev team mailing list archive

Material and State classes

 

Hi,

I just commited first version of the PhysicalParameters split (to
Material and State classes) as described at
https://blueprints.launchpad.net/yade/+spec/body-state-material .

I need some opinions on what should be in the parent State class. I put
se3, linear velocity and angularVelocity inside, since it seems that we
have no bodies that don't use them. I didn't add mass and inertia, but
that might be considered as well. I didn't add acceleration and
angularAcceleration (I just forgot).

(Currently, PhysicalParameters has se3 (including orientation), but no
angularVelocity, which is not logical, for instance.)

To summarize, what should be in Body->state? The set to choose from is:

* position, velocity, acceleration, mass;
* orientation, angular velocity, angular acceleration, inertia.

Do we plan, in the future, have bodies that don't need orientation? (I
mean: concrete plans, not just "extensibility" concerns).

In that case, it might be good to replace, progressively, all
body->physicalParameters->se3 by getters (r/w reference) like
Body::getPosition() (or State::getPosition()?), Body::getOrientation(),
Body::getVelocity(), Body::getAngularVelocity() with static_casts
inside. That would let us add orientation-less bodies in the future
without changes to the current code.

Suggestions, opinions?

Cheers, Vaclav

PS. The progress of changes will be such that I will first change core
and some classes in common+dem so that very basic simulations work. The
rest of files will be again flagged and not compiled by default and I
will ask respective maintainers of those files to adjust their code
following a simple guid I will write.




Follow ups