26 #ifndef BASEPARTICLE_H
27 #define BASEPARTICLE_H
42 #ifdef CONTACT_LIST_HGRID
96 virtual void read(std::istream& is);
104 virtual void oldRead(std::istream& is);
109 virtual void write(std::ostream& os)
const;
114 virtual std::string
getName()
const;
136 #ifdef CONTACT_LIST_HGRID
272 #ifdef CONTACT_LIST_HGRID
380 #ifdef CONTACT_LIST_HGRID
Mdouble getKineticEnergy() const
Calculates the particle's kinetic energy.
Container to store all ParticleSpecies.
void addDisplacement(const Vec3D &addDisp)
Adds a vector to the particle's displacement_.
Mdouble invInertia_
Particle inertia_.
Mdouble getVolume() const
Get Particle volume function, which required a reference to the Species vector. It returns the volume...
void setInfiniteInertia()
Sets the particle's inertia_ to 'infinite' (1e20) and its invInertia_ to 0.
void setHGridLevel(const unsigned int level)
Sets the particle's HGrid level.
void setInertia(const Mdouble newInertia)
Sets the particle's inertia_ (and adjusts invInertia_ accordingly)
void setDisplacement(const Vec3D &disp)
Sets the particle's displacement (= difference between current position and that of the previous time...
const Vec3D & getPreviousPosition() const
Returns the particle's position in the previous time step.
void setMass(const Mdouble mass)
Sets the particle's mass.
void setHandler(ParticleHandler *handler)
Sets the pointer to the particle's ParticleHandler.
void setHGridY(const int y)
Sets the particle's HGrid cell Y-coordinate.
Mdouble mass_
Pointer to the previous Particle in the same HGrid cell.
ParticleHandler * handler_
Pointer to the particle's ParticleHandler container.
Mdouble invMass_
Particle mass_.
void setHGridNextObject(BaseParticle *p)
Sets the pointer to the next object in the particle's HGrid cell & level.
void setPeriodicFromParticle(BaseParticle *p)
Assigns the pointer to the 'original' particle this one's a periodic copy of.
void unfix()
Unfix Particle function, which required a reference to the Species vector. It unfixes a Particle by c...
void setSpecies(const ParticleSpecies *species)
int getHGridY() const
Returns particle's HGrid cell Y-coordinate.
void setHGridX(const int x)
Sets the particle's HGrid cell X-coordinate.
ParticleHandler * getHandler() const
Returns pointer to the particle's ParticleHandler.
Mdouble getInvMass() const
Returns the particle's invMass_.
void accelerate(const Vec3D &vel)
Increases the particle's velocity_ by the given vector.
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Stores information about interactions between two interactable objects; often particles but could be ...
#define MERCURY_DEPRECATED
Mdouble getWallInteractionRadius() const
Returns the interaction radius for interaction with walls. See also BaseParticle::getInteractionRadiu...
int HGridX_
Hgrid attributes.
virtual std::string getName() const
Returns the name of the object.
BaseParticle * getPeriodicFromParticle() const
Returns the 'original' particle this one's a periodic copy of.
BaseParticle * HGridNextObject_
Grid level for the object.
void printHGrid(std::ostream &os) const
Adds particle's HGrid level and cell coordinates to an ostream.
const Vec3D & getDisplacement() const
Returns the particle's displacement relative to the previous time step.
void integrateBeforeForceComputation(double time, double timeStep)
First step of Velocity Verlet integration.
Mdouble inertia_
Inverse Particle mass (for computation optimization)
Vec3D displacement_
Pointer to originating Particle.
virtual void read(std::istream &is)
Particle read function, which accepts an std::istream as input.
Mdouble getMass() const
Returns the particle's mass_.
virtual ~BaseParticle()
Particle destructor, needs to be implemented and checked if it removes tangential spring information...
void setPreviousPosition(const Vec3D &pos)
Sets the particle's position in the previous time step.
In the HGrid class, here all information about the HGrid is stored.
unsigned int HGridLevel_
Cell position in the grid.
int getHGridZ() const
Returns particle's HGrid cell Z-coordinate.
Container to store Interaction objects.
void setHGridZ(const int z)
Sets the particle's HGrid cell Z-coordinate.
Vec3D previousPosition_
Displacement (only used in StatisticsVector, StatisticsPoint)
BaseParticle * HGridPrevObject_
Pointer to the next Particle in the same HGrid cell.
Mdouble getInertia() const
Returns the particle's inertia_.
MERCURY_DEPRECATED void setIndSpecies(unsigned int indSpecies)
Mdouble getRadius() const
Returns the particle's radius_.
const Vec3D getDisplacement2(Mdouble xmin, Mdouble xmax, Mdouble ymin, Mdouble ymax, Mdouble zmin, Mdouble zmax, Mdouble t) const
BaseInteraction * getInteractionWith(BaseParticle *P, Mdouble timeStamp, InteractionHandler *interactionHandler)
Checks if particle is in interaction with given particle P, and if so, returns pointer to the associa...
Container to store all BaseParticle.
virtual void write(std::ostream &os) const
Particle print function, which accepts an std::ostream as input.
Mdouble getInvInertia() const
Returns the particle's invInertia_.
BaseParticle()
Basic Particle constructor, creates an Particle at (0,0,0) with radius, mass and inertia equal to 1...
virtual MERCURY_DEPRECATED void oldRead(std::istream &is)
deprecated version of the read function.
Mdouble radius_
Inverse Particle inverse inertia (for computation optimization)
void setHGridPrevObject(BaseParticle *p)
Sets the pointer to the previous object in the particle's HGrid cell & level.
Defines the basic properties that a interactable object can have.
void angularAccelerate(const Vec3D &angVel)
Increases the particle's angularVelocity_ by the given vector.
BaseParticle * getHGridPrevObject() const
Returns pointer to previous object in particle's HGrid level & cell.
void integrateAfterForceComputation(double time, double timeStep)
Second step of Velocity Verlet integration.
Implementation of a 3D vector (by Vitaliy).
BaseParticle * getHGridNextObject() const
Returns pointer to next object in particle's HGrid level & cell.
BaseParticle * periodicFromParticle_
Particle radius_.
unsigned int getHGridLevel() const
Returns particle's HGrid level.
unsigned int getParticleDimensions() const
Returns the particle's dimensions (either 2 or 3).
bool isFixed() const
Is fixed Particle function. It returns whether a Particle is fixed or not, by checking its inverse Ma...
Mdouble getInteractionRadius() const
Returns the particle's interaction radius, which might be different from radius_ (e.g., when dealing with wet particles)
virtual BaseParticle * copy() const
Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism.
void movePrevious(const Vec3D &posMove)
Adds a vector to the particle's previousPosition_.
void fixParticle()
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to ...
int getHGridX() const
Returns particle's HGrid cell X-coordinate.