177 particlePosition.
id = particle->
getId();
180 if (std::is_base_of<MPILiquidFilmParticle,MPIParticle>())
182 return particlePosition;
196 return particleVelocity;
201 #ifdef MERCURY_USE_MPI
203 Vec3D valGlobal = {0.0,0.0,0.0};
205 communicator.allReduce(val.
X, valGlobal.
X, MPI_SUM);
206 communicator.allReduce(val.
Y, valGlobal.
Y, MPI_SUM);
207 communicator.allReduce(val.
Z, valGlobal.
Z, MPI_SUM);
216 #ifdef MERCURY_USE_MPI
218 double valGlobal = 0.0;
220 communicator.allReduce(val, valGlobal, MPI_SUM);
void copyDataFromMPIParticleToParticle(BaseParticle *p)
Copies data from a BaseParticle to an MPIParticle class and returns this.
This class contains all information and functions required for communication between processors...
void copyDataFromParticleToMPIParticle(BaseParticle *p)
unsigned int getId() const
Returns the unique identifier of any particular object.
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
static MPIContainer & Instance()
fetch the instance to be used for communication
Mdouble X
the vector components
static BaseParticle * newParticle()
A spherical particle is the most simple particle used in MercuryDPM.
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
bool isMaserParticle() const
Indicates if this particle belongs to the maser boundary.
void setHGridLevel(const unsigned int level)
Sets the particle's HGrid level.
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Data class to send a particle velocity over MPI.
static BaseParticle * newParticle()
void setHandler(ParticleHandler *handler)
Sets the pointer to the particle's ParticleHandler.
virtual void setAxes(const Vec3D &axes)
Only ustilised in case of superquadric particles.
void setHGridY(const int y)
Sets the particle's HGrid cell Y-coordinate.
void setCommunicationComplexity(unsigned complexity)
Set the communication complexity of the particle.
virtual Mdouble getExponentEps1() const
Only ustilised in case of superquadric particles. Had to create a virtual function to allow function ...
virtual Vec3D getAxes() const
Only ustilised in case of superquadric particles. Had to create a virtual function to allow function ...
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 (used in periodic bounda...
virtual Mdouble getExponentEps2() const
Only ustilised in case of superquadric particles. Had to create a virtual function to allow function ...
virtual const Vec3D & getAngularVelocity() const
Returns the angular velocity of this interactable.
void setSpecies(const ParticleSpecies *species)
void setHGridX(const int x)
Sets the particle's HGrid cell X-coordinate.
ParticleHandler * getHandler() const
Returns pointer to the particle's ParticleHandler.
virtual void setExponents(const Mdouble &eps1, const Mdouble &eps2)
Only ustilised in case of superquadric particles.
void copyDataFromMPIParticleToParticle(BaseParticle *p)
void copyDataFromMPIParticleToParticle(MPIParticle *bP, BaseParticle *p, ParticleHandler *particleHandler)
Copies data from an MPIParticle class to a BaseParticle and sets the particleHandler and species...
static BaseParticle * newParticle()
MPIParticle copyDataFromParticleToMPIParticle(BaseParticle *p)
Copies data from a SuperQuadricParticle to an MPIParticle class and returns this. ...
void copyDataFromParticleToMPIParticle(BaseParticle *p)
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Data class to send a particle over MPI.
void setHGridZ(const int z)
Sets the particle's HGrid cell Z-coordinate.
Vec3D getMPISum(Vec3D &val)
Sums the values over all processors using MPI_reduce.
Mdouble getRadius() const
Returns the particle's radius.
bool isFixed() const override
Is fixed Particle function. It returns whether a Particle is fixed or not, by checking its inverse Ma...
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Container to store all BaseParticle.
MPIParticlePosition copyPositionFrom(BaseParticle *particle)
Copies the position from a particle to an MPIParticlePosition class.
unsigned communicationComplexity
Data class to send a particle position over MPI.
void setMaserParticle(bool flag)
Flags the status of the particle if it belongs to the maser boundary or not.
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
unsigned getCommunicationComplexity()
Obtains the communication complexity of the particle.
void setHGridPrevObject(BaseParticle *p)
Sets the pointer to the previous object in the particle's HGrid cell & level.
void setOrientation(const Quaternion &orientation)
Sets the orientation of this BaseInteractable.
unsigned int getIndSpecies() const
Returns the index of the species associated with the interactable object.
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
MPIParticleVelocity copyVelocityFrom(BaseParticle *particle)
Copies the velocity from a particle to an MPIParticleVelocity class.
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
unsigned int getHGridLevel() const
Returns particle's HGrid level.
void setInPeriodicDomain(bool flag)
Flags the status of the particle wether it is in the periodic communication zone or not...
const Quaternion & getOrientation() const
Returns the orientation of this BaseInteractable.
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
void copyDataFromParticleToMPIParticle(BaseParticle *p)
void copyDataFromMPIParticleToParticle(BaseParticle *p)
void setId(unsigned long id)
Assigns a unique identifier to each object in the handler (container) which remains constant even aft...
void fixParticle()
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to ...