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
31 {
32 
33  //Set important quantities
34  p->setId(id);
35  p->setRadius(radius);
36  p->setPosition(position);
37  p->setAngularVelocity(angularVelocity);
38  p->setVelocity(velocity);
39  p->setOrientation(orientation);
40  p->setCommunicationComplexity(communicationComplexity);
41 
42  //Set HGrid values
43  p->setHGridNextObject(nullptr);
44  p->setHGridPrevObject(nullptr);
45  p->setHGridX(99999);
46  p->setHGridY(99999);
47  p->setHGridZ(99999);
48  p->setHGridLevel(HGridLevel);
49 
50  //This is not a periodic particle
51  p->setPeriodicFromParticle(nullptr);
52  p->setInPeriodicDomain(false);
53 
54  //Fix maser if it is maser
55  p->setMaserParticle(isMaser);
56 
57  //Fixed particles need to be fixed again
58  if (isFixed)
59  {
60  p->fixParticle();
61  }
62 }
float * p
Definition: Tutorial_Map_using.cpp:9
bool isFixed
Definition: MpiDataClass.h:31
Vec3D angularVelocity
Definition: MpiDataClass.h:26
Vec3D position
Definition: MpiDataClass.h:25
unsigned int HGridLevel
Definition: MpiDataClass.h:23
Mdouble radius
Definition: MpiDataClass.h:24
unsigned communicationComplexity
Definition: MpiDataClass.h:29
bool isMaser
Definition: MpiDataClass.h:30
Quaternion orientation
Definition: MpiDataClass.h:28
Vec3D velocity
Definition: MpiDataClass.h:27

References angularVelocity, communicationComplexity, HGridLevel, isFixed, isMaser, orientation, p, position, radius, and velocity.

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

◆ copyDataFromParticleToMPIParticle()

void MPISphericalParticle::copyDataFromParticleToMPIParticle ( BaseParticle p)
110  {
111  id = p->getId();
112  indSpecies = p->getIndSpecies();
113  radius = p->getRadius();
114  position = p->getPosition();
115  angularVelocity = p->getAngularVelocity();
116  velocity = p->getVelocity();
117  orientation = p->getOrientation();
118  HGridLevel = p->getHGridLevel();
119  communicationComplexity = p->getCommunicationComplexity();
120  isMaser = p->isMaserParticle();
121  isFixed = p->isFixed();
122 }
unsigned int indSpecies
Definition: MpiDataClass.h:22

References angularVelocity, communicationComplexity, HGridLevel, indSpecies, isFixed, isMaser, orientation, p, 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
136  {
137  return new SphericalParticle;
138 }
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:16

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: