26 #ifndef BASEPARTICLE_H
27 #define BASEPARTICLE_H
31 #include "../ExtendedMath.h"
32 #include "../Vector.h"
38 #ifdef ContactListHgrid
67 void unfix(std::vector<CSpecies>& Species);
79 virtual void read(std::istream& is);
82 virtual void print(std::ostream& os)
const;
91 #ifdef ContactListHgrid
132 #ifdef ContactListHgrid
137 void set_Id (
const int _new);
159 #ifdef USE_SIMPLE_VERLET_INTEGRATION
160 void set_PrevPosition (
const Vec3D& _new);
161 void prevMove (
const Vec3D& _new);
162 const Vec3D& get_PrevPosition();
166 #ifdef ContactListHgrid
200 #ifdef USE_SIMPLE_VERLET_INTEGRATION
Vec3D velocity
Current particle position.
void set_inertia(const Mdouble _new)
int HGRID_x
Hgrid attributes.
BaseParticle * periodicFromParticle
Particle radius.
void set_HGRID_x(const int _new)
Mdouble get_KineticEnergy() const
void add_Torque(const Vec3D &_new)
void set_Force(const Vec3D &_new)
void set_species(const int _new)
void set_HGRID_PrevObject(BaseParticle *_new)
BaseParticle * get_HGRID_PrevObject() const
std::istream & operator>>(std::istream &is, BaseParticle &p)
const Vec3D & get_Velocity() const
ParticleHandler * handler
Mdouble get_InteractionRadius() const
void rotate(const Vec3D &_new)
void set_PreviousPosition(const Vec3D &_new)
void compute_particle_mass(std::vector< CSpecies > &Species)
Compute Particle mass function, which required a reference to the Species vector. It copmuters the Pa...
Mdouble inertia
Inverse Particle mass (for computation optimization)
int get_IndSpecies() const
Mdouble mass
Index of the Particle in the ParticleHandler, used for outputting fstat data.
Mdouble radius
Inverse Particle inverse inertia (for computation optimization)
int _id
Index of the Species of this Particle.
void angularAccelerate(const Vec3D &_new)
BaseParticle * get_PeriodicFromParticle() const
void setHandler(ParticleHandler *handler)
BaseParticle * HGRID_PrevObject
Pointer to the next Particle in the same HGrid cell.
virtual void print(std::ostream &os) const
Particle print function, which accepts an os std::stringstream as input.
void set_HGRID_z(const int _new)
friend std::ostream & operator<<(std::ostream &os, const BaseParticle &b)
writes wall
Vec3D angularVelocity
Current angular position.
Mdouble get_InvInertia() const
BaseParticle * get_HGRID_NextObject() const
Vec3D angle
non changing identifier of particle
ParticleHandler * getHandler() const
void set_Index(const int _new)
const Vec3D & get_Force() const
Mdouble invInertia
Particle inertia.
bool isFixed()
Is fixed Particle function. It returns wether a Particle is fixed or not, by cheking its inverse Mass...
Mdouble get_Radius() const
void set_periodicFromParticle(BaseParticle *_new)
Mdouble get_InvMass() const
const Vec3D get_Displacement2(Mdouble xmin, Mdouble xmax, Mdouble ymin, Mdouble ymax, Mdouble zmin, Mdouble zmax, Mdouble t) const
virtual void read(std::istream &is)
Particle read function, which accepts an os std::stringstream as input.
Vec3D previousPosition
Displacement (only used in StatisticsVector, StatisticsPoint)
virtual ~BaseParticle()
Particle destructor, needs to be implemented and checked if it removes tangential spring information...
This is the HGRID class - This is the actually HGRID code.
void set_IndSpecies(const int _new)
void set_HGRID_y(const int _new)
Mdouble get_WallInteractionRadius() const
int _index
Pointer to the previous Particle in the same HGrid cell.
void add_Force(const Vec3D &_new)
void set_infiniteInertia()
Vec3D torque
Interaction force.
int HGRID_Level
Cell position in the grid.
const Vec3D & get_PreviousPosition() const
void set_HGRID_Level(const int _new)
const Vec3D & get_Displacement() const
void move(const Vec3D &_new)
Vec3D displacement
Torque.
friend std::istream & operator>>(std::istream &is, BaseParticle &b)
reads wall
const Vec3D & get_Position() const
Container to store all BaseParticle.
std::ostream & operator<<(std::ostream &os, const BaseParticle &p)
void set_Radius(const Mdouble _new)
BaseParticle * HGRID_NextObject
Grid level for the object.
void set_Velocity(const Vec3D &_new)
Mdouble invMass
Particle mass.
BaseParticle()
Basic Particle contructors, creates an Particle at (0,0,0) with radius, mass and inertia equal to 1...
const Vec3D & get_Torque() const
Vec3D position
Current angular velocity.
void movePrevious(const Vec3D &_new)
void unfix(std::vector< CSpecies > &Species)
Unfix Particle function, which required a reference to the Species vector. It un fixes a Particle by ...
Mdouble get_Volume(std::vector< CSpecies > &Species) const
Get Particle volume function, which required a reference to the Species vector. It returns the volume...
void set_AngularVelocity(const Vec3D &_new)
void print_HGRID(std::ostream &os)
void set_Angle(const Vec3D &_new)
void set_Displacement(const Vec3D &_new)
virtual void moveInHandler(int newPos)
int indSpecies
Pointer to originating Particle.
void set_Torque(const Vec3D &_new)
Mdouble get_Inertia() const
const Vec3D & get_Angle() const
Vec3D force
Current particle velocity.
void set_HGRID_NextObject(BaseParticle *_new)
Implementation of a 3D vector (by Vitaliy).
Stores properties of the particles and the contact models such as the elastic modulus.
void set_Position(const Vec3D &_new)
void accelerate(const Vec3D &_new)
void set_Id(const int _new)
int get_HGRID_Level() const
virtual BaseParticle * copy() const
Particle copy method. It calls to copy contrustor of this Particle, usefull for polymorfism.
void add_Displacement(const Vec3D &_new)
void fixParticle()
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to ...
void set_Mass(const Mdouble _new)
const Vec3D & get_AngularVelocity() const