MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

Detailed Description

Definition at line 39 of file MpiDataClass.h.

Member Function Documentation

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.

[in]pPointer to a base particle from which data is copied
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"

[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

Definition at line 51 of file

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().

52 {
54  //Set important quantities
55  p->setId(id);
56  p->setRadius(radius);
63  //Set HGrid values
64  p->setHGridNextObject(nullptr);
65  p->setHGridPrevObject(nullptr);
66  p->setHGridX(99999);
67  p->setHGridY(99999);
68  p->setHGridZ(99999);
71  //This is not a periodic particle
72  p->setPeriodicFromParticle(nullptr);
73  p->setInPeriodicDomain(false);
75  //Fix maser if it is maser
78  //Fixed particles need to be fixed again
79  if (isFixed)
80  {
81  p->fixParticle();
82  }
83 }
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
void setHGridLevel(const unsigned int level)
Sets the particle's HGrid level.
Definition: BaseParticle.h:469
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
void setHGridY(const int y)
Sets the particle's HGrid cell Y-coordinate.
Definition: BaseParticle.h:454
void setCommunicationComplexity(unsigned complexity)
Set the communication complexity of the particle.
void setHGridNextObject(BaseParticle *p)
Sets the pointer to the next object in the particle's HGrid cell & level.
Definition: BaseParticle.h:477
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:438
void setHGridX(const int x)
Sets the particle's HGrid cell X-coordinate.
Definition: BaseParticle.h:446
Quaternion orientation
Definition: MpiDataClass.h:49
void setHGridZ(const int z)
Sets the particle's HGrid cell Z-coordinate.
Definition: BaseParticle.h:462
unsigned communicationComplexity
Definition: MpiDataClass.h:50
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.
void setHGridPrevObject(BaseParticle *p)
Sets the pointer to the previous object in the particle's HGrid cell & level.
Definition: BaseParticle.h:485
void setOrientation(const Quaternion &orientation)
Sets the orientation of this BaseInteractable.
unsigned int HGridLevel
Definition: MpiDataClass.h:44
void setInPeriodicDomain(bool flag)
Flags the status of the particle wether it is in the periodic communication zone or not...
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
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 ...
void MPISphericalParticle::copyDataFromParticleToMPIParticle ( BaseParticle p)

Definition at line 131 of file

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(), MPISuperQuadric::copyDataFromParticleToMPIParticle(), MPILiquidFilmParticle::copyDataFromParticleToMPIParticle(), copyDataFromParticleToMPIParticle(), and DPMBase::synchroniseParticle().

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 }
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.h:125
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
bool isMaserParticle() const
Indicates if this particle belongs to the maser boundary.
unsigned int indSpecies
Definition: MpiDataClass.h:43
virtual const Vec3D & getAngularVelocity() const
Returns the angular velocity of this interactable.
Quaternion orientation
Definition: MpiDataClass.h:49
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:345
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
unsigned communicationComplexity
Definition: MpiDataClass.h:50
unsigned getCommunicationComplexity()
Obtains the communication complexity of the particle.
unsigned int HGridLevel
Definition: MpiDataClass.h:44
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.
unsigned int getHGridLevel() const
Returns particle's HGrid level.
Definition: BaseParticle.h:234
const Quaternion & getOrientation() const
Returns the orientation of this BaseInteractable.
BaseParticle * MPISphericalParticle::newParticle ( )

Member Data Documentation

Vec3D MPISphericalParticle::angularVelocity
unsigned MPISphericalParticle::communicationComplexity
unsigned int MPISphericalParticle::HGridLevel
unsigned int MPISphericalParticle::id

Definition at line 42 of file MpiDataClass.h.

unsigned int MPISphericalParticle::indSpecies
bool MPISphericalParticle::isFixed
bool MPISphericalParticle::isMaser
Quaternion MPISphericalParticle::orientation
Vec3D MPISphericalParticle::position
Mdouble MPISphericalParticle::radius
Vec3D MPISphericalParticle::velocity

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