MPISphericalParticle Class Reference

#include <MpiDataClass.h>

+ Inheritance diagram for MPISphericalParticle:

Public Member Functions

void copyDataFromMPIParticleToParticle (BaseParticle *p)
 Copies data from a BaseParticle to an MPIParticle class and returns this. More...
 
void copyDataFromParticleToMPIParticle (BaseParticle *p)
 

Static Public Member Functions

static BaseParticlenewParticle ()
 

Public Attributes

unsigned int id
 
unsigned int indSpecies
 
unsigned int HGridLevel
 
Mdouble radius
 
Vec3D position
 
Vec3D angularVelocity
 
Vec3D velocity
 
Quaternion orientation
 
unsigned communicationComplexity
 
bool isMaser
 
bool isFixed
 

Member Function Documentation

◆ copyDataFromMPIParticleToParticle()

void MPISphericalParticle::copyDataFromMPIParticleToParticle ( BaseParticle p)

Copies data from a BaseParticle to an MPIParticle class and returns this.

In order to create ghost particles on other processors, data of particles have to be transmitted to other processors. Only the required data is sent. The data is sent in an MPIParticle data class and this function copies the data from a particle into that class.

Parameters
[in]pPointer to a base particle from which data is copied
Returns
MPIParticle class is returned filled with data from BaseParticle p

Copies data from an MPIParticle class to a BaseParticle

When processors recieve data of ghost particles they have to add, they recieve them in the MPIParticle class. This function turns the MPIParticle class back into a BaseParticle and initialises hGrid values to "default"

Parameters
[in]bPPointer to an MPIParticle which contains data for a ghost particle
[in,out]pPointer to BaseParticle, a ghost particle that will be added to the domain
52 {
53 
54  //Set important quantities
55  p->setId(id);
56  p->setRadius(radius);
62 
63  //Set HGrid values
64  p->setHGridNextObject(nullptr);
65  p->setHGridPrevObject(nullptr);
66  p->setHGridX(99999);
67  p->setHGridY(99999);
68  p->setHGridZ(99999);
70 
71  //This is not a periodic particle
72  p->setPeriodicFromParticle(nullptr);
73  p->setInPeriodicDomain(false);
74 
75  //Fix maser if it is maser
77 
78  //Fixed particles need to be fixed again
79  if (isFixed)
80  {
81  p->fixParticle();
82  }
83 }
virtual void setOrientation(const Quaternion &orientation)
Sets the orientation of this BaseInteractable.
Definition: BaseInteractable.h:260
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
Definition: BaseInteractable.cc:360
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:350
virtual void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
void setId(unsigned long id)
Assigns a unique identifier to each object in the handler (container) which remains constant even aft...
Definition: BaseObject.cc:72
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
void setInPeriodicDomain(bool flag)
Flags the status of the particle whether it is in the periodic communication zone or not.
Definition: BaseParticle.cc:292
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
void setHGridZ(const int z)
Sets the particle's HGrid cell Z-coordinate.
Definition: BaseParticle.h:465
void setHGridLevel(const unsigned int level)
Sets the particle's HGrid level.
Definition: BaseParticle.h:472
void setCommunicationComplexity(unsigned complexity)
Set the communication complexity of the particle.
Definition: BaseParticle.cc:196
void setHGridX(const int x)
Sets the particle's HGrid cell X-coordinate.
Definition: BaseParticle.h:449
void setMaserParticle(bool flag)
Flags the status of the particle if it belongs to the maser boundary or not.
Definition: BaseParticle.cc:312
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
void setHGridPrevObject(BaseParticle *p)
Sets the pointer to the previous object in the particle's HGrid cell & level.
Definition: BaseParticle.h:488
void setHGridY(const int y)
Sets the particle's HGrid cell Y-coordinate.
Definition: BaseParticle.h:457
bool isFixed
Definition: MpiDataClass.h:52
Vec3D angularVelocity
Definition: MpiDataClass.h:47
Vec3D position
Definition: MpiDataClass.h:46
unsigned int HGridLevel
Definition: MpiDataClass.h:44
Mdouble radius
Definition: MpiDataClass.h:45
unsigned communicationComplexity
Definition: MpiDataClass.h:50
bool isMaser
Definition: MpiDataClass.h:51
Quaternion orientation
Definition: MpiDataClass.h:49
Vec3D velocity
Definition: MpiDataClass.h:48

References angularVelocity, communicationComplexity, BaseParticle::fixParticle(), HGridLevel, isFixed, isMaser, orientation, position, radius, BaseInteractable::setAngularVelocity(), BaseParticle::setCommunicationComplexity(), BaseParticle::setHGridLevel(), BaseParticle::setHGridNextObject(), BaseParticle::setHGridPrevObject(), BaseParticle::setHGridX(), BaseParticle::setHGridY(), BaseParticle::setHGridZ(), BaseObject::setId(), BaseParticle::setInPeriodicDomain(), BaseParticle::setMaserParticle(), BaseInteractable::setOrientation(), BaseParticle::setPeriodicFromParticle(), BaseInteractable::setPosition(), BaseParticle::setRadius(), BaseInteractable::setVelocity(), and velocity.

Referenced by MPISuperQuadric::copyDataFromMPIParticleToParticle(), MPILiquidFilmParticle::copyDataFromMPIParticleToParticle(), and copyDataFromMPIParticleToParticle().

◆ copyDataFromParticleToMPIParticle()

void MPISphericalParticle::copyDataFromParticleToMPIParticle ( BaseParticle p)
131  {
132  id = p->getId();
133  indSpecies = p->getIndSpecies();
134  radius = p->getRadius();
135  position = p->getPosition();
137  velocity = p->getVelocity();
139  HGridLevel = p->getHGridLevel();
141  isMaser = p->isMaserParticle();
142  isFixed = p->isFixed();
143 }
const Quaternion & getOrientation() const
Returns the orientation of this BaseInteractable.
Definition: BaseInteractable.h:230
virtual const Vec3D & getAngularVelocity() const
Returns the angular velocity of this interactable.
Definition: BaseInteractable.cc:341
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Definition: BaseInteractable.cc:329
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
unsigned int getIndSpecies() const
Returns the index of the species associated with the interactable object.
Definition: BaseInteractable.h:88
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.h:125
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
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
unsigned int getHGridLevel() const
Returns particle's HGrid level.
Definition: BaseParticle.h:234
bool isMaserParticle() const
Indicates if this particle belongs to the maser boundary.
Definition: BaseParticle.cc:307
unsigned getCommunicationComplexity()
Obtains the communication complexity of the particle.
Definition: BaseParticle.cc:201
unsigned int indSpecies
Definition: MpiDataClass.h:43

References angularVelocity, communicationComplexity, BaseInteractable::getAngularVelocity(), BaseParticle::getCommunicationComplexity(), BaseParticle::getHGridLevel(), BaseObject::getId(), BaseInteractable::getIndSpecies(), BaseInteractable::getOrientation(), BaseInteractable::getPosition(), BaseParticle::getRadius(), BaseInteractable::getVelocity(), HGridLevel, indSpecies, isFixed, BaseParticle::isFixed(), isMaser, BaseParticle::isMaserParticle(), orientation, position, radius, and velocity.

Referenced by ParticleHandler::addGhostObject(), ParticleHandler::addObject(), InsertionBoundary::checkBoundaryBeforeTimeStep(), copyDataFromParticleToMPIParticle(), MPISuperQuadric::copyDataFromParticleToMPIParticle(), MPILiquidFilmParticle::copyDataFromParticleToMPIParticle(), and DPMBase::synchroniseParticle().

◆ newParticle()

BaseParticle * MPISphericalParticle::newParticle ( )
static
157  {
158  return new SphericalParticle;
159 }
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37

Referenced by Domain::processReceivedBoundaryParticleData(), and PeriodicBoundaryHandler::processReceivedGhostParticleData().

Member Data Documentation

◆ angularVelocity

Vec3D MPISphericalParticle::angularVelocity

◆ communicationComplexity

unsigned MPISphericalParticle::communicationComplexity

◆ HGridLevel

unsigned int MPISphericalParticle::HGridLevel

◆ id

unsigned int MPISphericalParticle::id

◆ indSpecies

unsigned int MPISphericalParticle::indSpecies

◆ isFixed

bool MPISphericalParticle::isFixed

◆ isMaser

bool MPISphericalParticle::isMaser

◆ orientation

Quaternion MPISphericalParticle::orientation

◆ position

Vec3D MPISphericalParticle::position

◆ radius

Mdouble MPISphericalParticle::radius

◆ velocity

Vec3D MPISphericalParticle::velocity

The documentation for this class was generated from the following files: