26 #ifndef BASEPARTICLE_H
27 #define BASEPARTICLE_H
43 #ifdef CONTACT_LIST_HGRID
198 void read(std::istream& is)
override;
204 virtual void oldRead(std::istream& is);
209 void write(std::ostream& os)
const override;
214 std::string
getName()
const override;
253 #ifdef CONTACT_LIST_HGRID
491 #ifdef CONTACT_LIST_HGRID
640 virtual std::vector<Mdouble>
getFieldVTK(
unsigned i)
const;
695 #ifdef CONTACT_LIST_HGRID
double Mdouble
Definition: GeneralDefine.h:34
#define MERCURYDPM_DEPRECATED
Definition: GeneralDefine.h:37
Defines the basic properties that a interactable object can have.
Definition: BaseInteractable.h:55
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Definition: BaseInteractable.cc:329
const ParticleSpecies * getSpecies() const
Returns a pointer to the species of this BaseInteractable.
Definition: BaseInteractable.h:108
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
Definition: BaseParticle.h:54
void setInverseInertia(MatrixSymmetric3D inverseInertia)
Sets the particle's inertia_ (and adjusts invInertia_ accordingly)
Definition: BaseParticle.cc:519
void write(std::ostream &os) const override
Particle print function, which accepts an std::ostream as input.
Definition: BaseParticle.cc:336
bool isPeriodicGhostParticle() const
Indicates if this particle is a ghost in the periodic boundary.
Definition: BaseParticle.cc:297
bool isMaserParticle_
Indicates the periodic complexity at current time step. Used to update periodic status.
Definition: BaseParticle.h:722
Vec3D getMomentum() const
Definition: BaseParticle.h:328
void setPreviousPosition(const Vec3D &pos)
Sets the particle's position in the previous time step.
Definition: BaseParticle.cc:614
virtual Mdouble getInfo() const
Returns some user-defined information about this object (by default, species ID).
Definition: BaseParticle.cc:358
bool isFixed() const override
Is fixed Particle function. It returns whether a Particle is fixed or not, by checking its inverse Ma...
Definition: BaseParticle.h:93
bool isClump_
The particle is pebble.
Definition: BaseParticle.h:748
Mdouble getInteractionDistance(const BaseInteractable *i) const
Returns the interactionDistance_ of the mixed species of this particle and the particle or wall i.
Definition: BaseParticle.h:369
Mdouble getGravitationalEnergy() const
Calculates the particle's gravitational energy.
virtual std::string getTypeVTK(unsigned i) const
Definition: BaseParticle.cc:841
virtual void oldRead(std::istream &is)
Definition: BaseParticle.cc:386
virtual void setAxes(const Vec3D &axes)
Only ustilised in case of superquadric particles.
Definition: BaseParticle.h:527
unsigned int getParticleDimensions() const
Returns the particle's dimensions (either 2 or 3).
Definition: BaseParticle.cc:784
BaseParticle * periodicFromParticle_
Pointer to the previous Particle in the same HGrid cell.
Definition: BaseParticle.h:710
void setPeriodicComplexity(std::vector< int > complexity)
Set the periodic communication complexity of the particle.
Definition: BaseParticle.cc:206
virtual void setExponents(const Mdouble &eps1, const Mdouble &eps2)
Only ustilised in case of superquadric particles.
Definition: BaseParticle.h:532
const std::vector< int > & getPreviousPeriodicComplexity() const
Sets the previous periodic communication complexity of the particle.
Definition: BaseParticle.cc:271
virtual unsigned getNumberOfFieldsVTK() const
Definition: BaseParticle.cc:836
BaseInteraction * getInteractionWith(BaseParticle *P, unsigned timeStamp, InteractionHandler *interactionHandler) override
Checks if particle is in interaction with given particle P, and if so, returns vector of pointer to t...
Definition: BaseParticle.cc:690
void setPeriodicFromParticle(BaseParticle *p)
Assigns the pointer to the 'original' particle this one's a periodic copy of (used in periodic bounda...
Definition: BaseParticle.h:441
virtual bool isInContactWith(const BaseParticle *P) const
Get whether or not this particle is in contact with the given particle.
Definition: BaseParticle.cc:865
virtual void setInfo(Mdouble info)
Sets some user-defined information about this object (by default, species ID).
Definition: BaseParticle.cc:353
void printHGrid(std::ostream &os) const
Adds particle's HGrid level and cell coordinates to an ostream.
Definition: BaseParticle.cc:427
bool isInMPIDomain()
Indicates if the particle is in the communication zone of the mpi domain.
Definition: BaseParticle.cc:276
void setInPeriodicDomain(bool flag)
Flags the status of the particle whether it is in the periodic communication zone or not.
Definition: BaseParticle.cc:292
BaseParticle * getHGridPrevObject() const
Returns pointer to previous object in particle's HGrid level & cell.
Definition: BaseParticle.h:250
virtual Mdouble getKineticEnergy() const
Calculates the particle's translational kinetic energy.
Definition: BaseParticle.cc:451
Vec3D previousPosition_
Displacement (only used in StatisticsVector, StatisticsPoint)
Definition: BaseParticle.h:725
MatrixSymmetric3D getInvInertia() const
Returns the inverse of the particle's inertia tensor.
Definition: BaseParticle.h:286
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
virtual Mdouble getExponentEps2() const
Only ustilised in case of superquadric particles. Had to create a virtual function to allow function ...
Definition: BaseParticle.cc:862
bool isInPeriodicDomain_
Definition: BaseParticle.h:718
MERCURYDPM_DEPRECATED void setMass(Mdouble mass)
Sets the particle's mass.
Definition: BaseParticle.cc:568
void movePrevious(const Vec3D &posMove)
Adds a vector to the particle's previousPosition_.
Definition: BaseParticle.cc:624
Mdouble getWallInteractionRadius(const BaseWall *wall) const
returns the radius plus the interactionDistance
Definition: BaseParticle.h:386
void setInfiniteInertia()
Sets the particle's inertia_ to 'infinite' (1e20) and its invInertia_ to 0.
Definition: BaseParticle.cc:528
BaseParticle * hGridPrevObject_
Pointer to the next Particle in the same HGrid cell.
Definition: BaseParticle.h:707
std::vector< int > periodicComplexity_
Indicates the periodic complexity at previous time step.
Definition: BaseParticle.h:721
MatrixSymmetric3D getInertia() const
Definition: BaseParticle.h:331
virtual Mdouble getVolume() const
Get Particle volume function, which required a reference to the Species vector. It returns the volume...
Definition: BaseParticle.cc:143
bool isPebble() const
Checks if particle is a pebble (belongs to a clump)
Definition: BaseParticle.h:673
bool isMPIParticle() const
Indicates if this particle is a ghost in the MPI domain.
Definition: BaseParticle.cc:181
unsigned communicationComplexity_
returns true if it flagged as being in MPI domain
Definition: BaseParticle.h:715
Mdouble getSurfaceArea() const
Definition: BaseParticle.h:325
void setHGridNextObject(BaseParticle *p)
Sets the pointer to the next object in the particle's HGrid cell & level.
Definition: BaseParticle.h:480
void fixParticle()
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to ...
Definition: BaseParticle.cc:167
const HGridCell & getHGridCell() const
Definition: BaseParticle.h:651
virtual std::vector< Mdouble > getFieldVTK(unsigned i) const
Definition: BaseParticle.cc:851
void setInMPIDomain(bool flag)
Flags the status of the particle if wether it is in the communication zone or not.
Definition: BaseParticle.cc:281
Mdouble radius_
Definition: BaseParticle.h:684
BaseParticle * clumpParticle
Function that updates necessary quantities of a clump particle after adding a pebble.
Definition: BaseParticle.h:744
Vec3D getAngularMomentum() const
Definition: BaseParticle.cc:579
unsigned int getHGridLevel() const
Returns particle's HGrid level.
Definition: BaseParticle.h:234
virtual Mdouble getExponentEps1() const
Only ustilised in case of superquadric particles. Had to create a virtual function to allow function ...
Definition: BaseParticle.cc:859
BaseParticle * getHGridNextObject() const
Returns pointer to next object in particle's HGrid level & cell.
Definition: BaseParticle.h:242
bool isInPeriodicDomain() const
Indicates if the particle is in the periodic boundary communication zone.
Definition: BaseParticle.cc:287
std::vector< int > previousPeriodicComplexity_
Indicates if the particle is a ghost particle of a periodic particle.
Definition: BaseParticle.h:720
ParticleHandler * getHandler() const
Returns pointer to the particle's ParticleHandler.
Definition: BaseParticle.cc:673
void setHGridZ(const int z)
Sets the particle's HGrid cell Z-coordinate.
Definition: BaseParticle.h:465
virtual std::string getNameVTK(unsigned i) const
Definition: BaseParticle.cc:846
bool isMaserParticle() const
Indicates if this particle belongs to the maser boundary.
Definition: BaseParticle.cc:307
const Vec3D getDisplacement2(Mdouble xmin, Mdouble xmax, Mdouble ymin, Mdouble ymax, Mdouble zmin, Mdouble zmax, Mdouble t) const
Definition: BaseParticle.cc:473
Mdouble getMass() const
Returns the particle's mass.
Definition: BaseParticle.h:322
virtual void integrateBeforeForceComputation(double time, double timeStep)
First step of Velocity Verlet integration.
Definition: BaseParticle.cc:720
void setHGridLevel(const unsigned int level)
Sets the particle's HGrid level.
Definition: BaseParticle.h:472
virtual Vec3D getCenterOfMass()
Definition: BaseParticle.h:678
void setMPIParticle(bool flag)
Flags the mpi particle status.
Definition: BaseParticle.cc:191
bool isPebble_
pointer to a clump particle (for a pebble)
Definition: BaseParticle.h:746
void setPreviousPeriodicComplexity(std::vector< int > complexity)
Set the previous periodic communication complexity of the paritcle.
Definition: BaseParticle.cc:266
virtual void integrateAfterForceComputation(double time, double timeStep)
Second step of Velocity Verlet integration.
Definition: BaseParticle.cc:762
const Vec3D & getDisplacement() const
Returns the particle's displacement relative to the previous time step.
Definition: BaseParticle.h:395
void setCommunicationComplexity(unsigned complexity)
Set the communication complexity of the particle.
Definition: BaseParticle.cc:196
bool isClump() const
Checks if particle is a clump (container)
Definition: BaseParticle.h:664
void unfix()
Unfix Particle function, which required a reference to the Species vector. It unfixes a Particle by c...
Definition: BaseParticle.cc:322
virtual Mdouble getRotationalEnergy() const
Calculates the particle's rotational kinetic energy.
Definition: BaseParticle.cc:460
const Vec3D & getPreviousPosition() const
Returns the particle's position in the previous time step.
Definition: BaseParticle.h:403
void setHandler(ParticleHandler *handler)
Sets the pointer to the particle's ParticleHandler.
Definition: BaseParticle.cc:663
Mdouble getSumOfInteractionRadii(const BaseParticle *particle) const
returns the sum of the radii plus the interactionDistance
Definition: BaseParticle.h:379
void angularAccelerate(const Vec3D &angVel)
Increases the particle's angularVelocity_ by the given vector.
Definition: BaseParticle.cc:644
Mdouble getMaxInteractionRadius() const
Returns the particle's interaction radius, which might be different from radius_ (e....
Definition: BaseParticle.h:362
Vec3D displacement_
Indicates if this particle belongs to the maser boundary or is released into the wide open world.
Definition: BaseParticle.h:724
virtual BaseParticle * copy() const =0
Particle copy method. It calls to copy constructor of this Particle, useful for polymorphism.
MatrixSymmetric3D invInertia_
Inverse Particle mass (for computation optimization)
Definition: BaseParticle.h:686
void setHGridX(const int x)
Sets the particle's HGrid cell X-coordinate.
Definition: BaseParticle.h:449
void setPeriodicGhostParticle(bool flag)
Flags the status of the particle to be a ghost in periodic boundary or not.
Definition: BaseParticle.cc:302
Mdouble invMass_
Particle radius_.
Definition: BaseParticle.h:685
void setMaserParticle(bool flag)
Flags the status of the particle if it belongs to the maser boundary or not.
Definition: BaseParticle.cc:312
bool isMPIParticle_
Pointer to originating Particle.
Definition: BaseParticle.h:713
Mdouble info_
Definition: BaseParticle.h:733
BaseParticle * getClump() const
Definition: BaseParticle.h:656
BaseParticle * hGridNextObject_
Definition: BaseParticle.h:706
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:553
int getHGridY() const
Returns particle's HGrid cell Y-coordinate.
Definition: BaseParticle.h:272
HGridCell hGridCell
Definition: BaseParticle.h:704
~BaseParticle() override
Particle destructor, needs to be implemented and checked if it removes tangential spring information.
Definition: BaseParticle.cc:125
virtual void actionsAfterAddObject()
Definition: BaseParticle.h:742
BaseParticle * getPeriodicFromParticle() const
Returns the 'original' particle this one's a periodic copy of.
Definition: BaseParticle.h:341
void accelerate(const Vec3D &vel)
Increases the particle's velocity_ by the given vector.
Definition: BaseParticle.cc:634
bool isPeriodicGhostParticle_
bool that indicates if a particle is in the periodic domain of any boundary
Definition: BaseParticle.h:719
void read(std::istream &is) override
Particle read function, which accepts an std::istream as input.
Definition: BaseParticle.cc:374
Mdouble getCurvature(const Vec3D &labFixedCoordinates) const override
Definition: BaseParticle.h:296
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:818
void setHGridPrevObject(BaseParticle *p)
Sets the pointer to the previous object in the particle's HGrid cell & level.
Definition: BaseParticle.h:488
ParticleHandler * handler_
Inverse Particle inverse inertia (for computation optimization)
Definition: BaseParticle.h:693
unsigned getCommunicationComplexity()
Obtains the communication complexity of the particle.
Definition: BaseParticle.cc:201
virtual void actionsAfterTimeStep()
Definition: BaseParticle.h:642
void setMassForP3Statistics(Mdouble mass)
Sets the particle's mass This function should not be used, but is necessary to extend the CG toolbox ...
Definition: BaseParticle.cc:589
MERCURYDPM_DEPRECATED void setIndSpecies(unsigned int indSpecies) override
Definition: BaseParticle.cc:794
virtual bool isSphericalParticle() const =0
BaseParticle()
Basic Particle constructor, creates an Particle at (0,0,0) with radius, mass and inertia equal to 1.
Definition: BaseParticle.cc:32
std::string getName() const override
Returns the name of the object.
Definition: BaseParticle.cc:348
virtual void setInertia()
Definition: BaseParticle.cc:505
void setDisplacement(const Vec3D &disp)
Sets the particle's displacement (= difference between current position and that of the previous time...
Definition: BaseParticle.cc:605
void setHGridY(const int y)
Sets the particle's HGrid cell Y-coordinate.
Definition: BaseParticle.h:457
const std::vector< int > & getPeriodicComplexity()
Obtains the periodic communication complexity of the particle.
Definition: BaseParticle.cc:231
void addDisplacement(const Vec3D &addDisp)
Adds a vector to the particle's displacement_.
Definition: BaseParticle.cc:653
int getHGridX() const
Returns particle's HGrid cell X-coordinate.
Definition: BaseParticle.h:265
bool isInMPIDomain_
returns true if the particle acts as an MPI particle instead of a real particle
Definition: BaseParticle.h:714
Mdouble getInvMass() const override
Returns the inverse of the particle's mass.
Definition: BaseParticle.h:293
int getHGridZ() const
Returns particle's HGrid cell Z-coordinate.
Definition: BaseParticle.h:279
virtual void computeMass(const ParticleSpecies &s)
Computes the particle's (inverse) mass and inertia.
Definition: BaseParticle.cc:876
virtual Vec3D getAxes() const
Only ustilised in case of superquadric particles. Had to create a virtual function to allow function ...
Definition: BaseParticle.cc:856
Mdouble getInteractionDistance() const
returns the largest separation distance at which adhesive short-range forces can occur.
Definition: BaseSpecies.h:146
Basic class for walls.
Definition: BaseWall.h:49
Definition: HGridCell.h:33
unsigned int getHGridLevel() const
Definition: HGridCell.h:86
void setHGridZ(int HGridZ)
Definition: HGridCell.h:81
int getHGridX() const
Definition: HGridCell.h:56
void setHGridX(int HGridX)
Definition: HGridCell.h:61
int getHGridZ() const
Definition: HGridCell.h:76
void setHGridY(int HGridY)
Definition: HGridCell.h:71
void setHGridLevel(unsigned int HGridLevel)
Definition: HGridCell.h:91
int getHGridY() const
Definition: HGridCell.h:66
In the HGrid class, here all information about the HGrid is stored.
Definition: HGrid.h:43
Container to store Interaction objects.
Definition: InteractionHandler.h:45
Implementation of a 3D symmetric matrix.
Definition: MatrixSymmetric.h:37
static MatrixSymmetric3D inverse(const MatrixSymmetric3D &A)
Computes the inverse of a matrix; exits if the inverse doesn't exist.
Definition: MatrixSymmetric.cc:288
Container to store all BaseParticle.
Definition: ParticleHandler.h:48
Definition: ParticleSpecies.h:37
const BaseSpecies * getMixedSpecies(const ParticleSpecies *s) const
Definition: ParticleSpecies.cc:238
void computeMass(BaseParticle *p) const
Compute Particle mass function, which required a reference to the Species vector. It computes the Par...
Definition: ParticleSpecies.cc:167
Mdouble getMaxInteractionDistance() const
returns the largest separation distance at which adhesive short-range forces can occur.
Definition: ParticleSpecies.h:113
Container to store all ParticleSpecies.
Definition: SpeciesHandler.h:37
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73
const Mdouble pi
Definition: ExtendedMath.h:45
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51