Commit 64f89925 authored by berenger-bramas's avatar berenger-bramas

Add an velocity extension to host velocity on each particles.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@331 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 529877f3
#ifndef FEXTENDVELOCITY_HPP
#define FEXTENDVELOCITY_HPP
// [--License--]
#include "../Utils/FGlobal.hpp"
#include "../Utils/F3DPosition.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FExtendVelocity
* Please read the license
*
* This class is an extenssion.
* It proposes a 3d array as a velocity vector.
*/
class FExtendVelocity {
protected:
F3DPosition velocity; //< 3D vector stored in a position object
public:
/** Default constructor */
FExtendVelocity() {
}
/** Copy constructor */
FExtendVelocity(const FExtendVelocity& other) : velocity(other.velocity) {
}
/** Copy operator */
FExtendVelocity& operator=(const FExtendVelocity& other) {
this->velocity = other.velocity;
return *this;
}
/** Return the velocity */
const F3DPosition& getVelocity() const {
return this->velocity;
}
/** Set Velocity */
void incVelocity(const F3DPosition& inVelocity) {
this->velocity += inVelocity;
}
/** Set Velocity with 3 FReals */
void incVelocity(const FReal inVx, const FReal inVy, const FReal inVz) {
this->velocity.incX(inVx);
this->velocity.incY(inVy);
this->velocity.incZ(inVz);
}
/** set the velocity from 3 variables */
void setVelocity(const FReal inVx, const FReal inVy, const FReal inVz) {
this->velocity.setPosition(inVx , inVy, inVz);
}
};
#endif //FEXTENDVELOCITY_HPP
// [--END--]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment