revision: v0.14
MpiDataClass.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2020, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef MPIDATACLASS_H_
27 #define MPIDATACLASS_H_
28 
30 #include "Particles/BaseParticle.h"
31 #include "ParticleHandler.h"
32 
34 
40 {
41 public:
42  unsigned int id;
43  unsigned int indSpecies;
44  unsigned int HGridLevel;
51  bool isMaser; //TODO
52  bool isFixed;
55  static BaseParticle* newParticle ();
56 };
57 
59 {
60 public:
66  static BaseParticle* newParticle ();
67 };
68 
70 {
71 public:
75  static BaseParticle* newParticle ();
76 };
77 
82 //to run simulations with LiquidFilmParticles in parallel, uncomment the line below (and comment the line above).
83 //class MPIParticle : public MPILiquidFilmParticle {};
84 
90 {
91 public:
92  unsigned int id;
96 };
97 
103 {
104 public:
107 };
108 
114 {
115 public:
118 };
119 
130 class Empty
131 {
132 };
133 
148 {
149 public:
150  BaseParticle* particle; //Used to store the pointer of the current particle (ghost or periodic) located on the same domain
151  BaseParticle* otherParticle; //Used to store the pointer of the other particle (ghost or periodic) located on the same domain
152  //int currentProcessor;
153  //int otherProcessor;
154  int targetProcessor; //Stores the target processor where the ghost or periodic is located
155  //int targetID;
156  //int periodicBoundaryIndex;
157  //std::vector<int> previousPeriodicComplexity;
158  //std::vector<int> currentPeriodicComplexity;
159  std::vector<int> periodicComplexity; //Not sure if this is required
160  std::vector<int> targetPeriodicComplexity; //ppid uses this to store the ghost periodic complexity when adding
161  std::vector<int> realPeriodicComplexity; //gpid uses this to store the realPeriodicComplexity of the real particle
162  //std::vector<int> previousRealPeriodicComplexity;
163  //Vec3D targetPosition;
164 };
165 
168 
173 
178 
183 
188 
192 Vec3D getMPISum(Vec3D& val);
193 
197 double getMPISum(double val);
198 
199 #endif /* MPIDATACLASS_H_ */
BaseParticle::setHGridY
void setHGridY(const int y)
Sets the particle's HGrid cell Y-coordinate.
Definition: BaseParticle.h:457
BaseInteractable::getAngularVelocity
virtual const Vec3D & getAngularVelocity() const
Returns the angular velocity of this interactable.
Definition: BaseInteractable.cc:341
BaseParticle::setHGridNextObject
void setHGridNextObject(BaseParticle *p)
Sets the pointer to the next object in the particle's HGrid cell & level.
Definition: BaseParticle.h:480
BaseParticle::setHandler
void setHandler(ParticleHandler *handler)
Sets the pointer to the particle's ParticleHandler.
Definition: BaseParticle.cc:651
MPISphericalParticle::copyDataFromMPIParticleToParticle
void copyDataFromMPIParticleToParticle(BaseParticle *p)
Copies data from a BaseParticle to an MPIParticle class and returns this.
Definition: MpiDataClass.cc:51
BaseParticle::setCommunicationComplexity
void setCommunicationComplexity(unsigned complexity)
Set the communication complexity of the particle.
Definition: BaseParticle.cc:190
BaseParticle::setInPeriodicDomain
void setInPeriodicDomain(bool flag)
Flags the status of the particle wether it is in the periodic communication zone or not.
Definition: BaseParticle.cc:286
BaseParticle::setHGridX
void setHGridX(const int x)
Sets the particle's HGrid cell X-coordinate.
Definition: BaseParticle.h:449
MPILiquidFilmParticle::copyDataFromMPIParticleToParticle
void copyDataFromMPIParticleToParticle(BaseParticle *p)
Definition: MpiDataClass.cc:92
BaseParticle::getHGridLevel
unsigned int getHGridLevel() const
Returns particle's HGrid level.
Definition: BaseParticle.h:234
MPISphericalParticle::HGridLevel
unsigned int HGridLevel
Definition: MpiDataClass.h:44
MPISuperQuadric::copyDataFromParticleToMPIParticle
void copyDataFromParticleToMPIParticle(BaseParticle *p)
Definition: MpiDataClass.cc:145
BaseParticle::fixParticle
void fixParticle()
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to ...
Definition: BaseParticle.cc:165
BaseInteractable::setPosition
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
MPISphericalParticle::newParticle
static BaseParticle * newParticle()
Definition: MpiDataClass.cc:157
LiquidFilmParticle.h
MPISphericalParticle::communicationComplexity
unsigned communicationComplexity
Definition: MpiDataClass.h:50
MPIParticlePosition::position
Vec3D position
Definition: MpiDataClass.h:93
MPIParticlePosition::liquidVolume
Mdouble liquidVolume
Definition: MpiDataClass.h:95
BaseParticle::getExponentEps2
virtual Mdouble getExponentEps2() const
Only ustilised in case of superquadric particles. Had to create a virtual function to allow function ...
Definition: BaseParticle.cc:848
Vec3D::X
Mdouble X
the vector components
Definition: Vector.h:65
copyVelocityFrom
MPIParticleVelocity copyVelocityFrom(BaseParticle *particles)
Copies the velocity from a particle to an MPIParticleVelocity class.
Definition: MpiDataClass.cc:190
BaseParticle::isMaserParticle
bool isMaserParticle() const
Indicates if this particle belongs to the maser boundary.
Definition: BaseParticle.cc:301
MpiPeriodicParticleIDBase::particle
BaseParticle * particle
Definition: MpiDataClass.h:150
MPILiquidFilmParticle::newParticle
static BaseParticle * newParticle()
Definition: MpiDataClass.cc:165
copyDataFromMPIParticleToParticle
void copyDataFromMPIParticleToParticle(MPIParticle *bP, BaseParticle *p, ParticleHandler *particleHandler)
Copies data from an MPIParticle class to a BaseParticle and sets the particleHandler and species.
Definition: MpiDataClass.cc:105
MPISphericalParticle::copyDataFromParticleToMPIParticle
void copyDataFromParticleToMPIParticle(BaseParticle *p)
Definition: MpiDataClass.cc:131
copyDataFromParticleToMPIParticle
MPIParticle copyDataFromParticleToMPIParticle(BaseParticle *p)
Copies data from a BaseParticle to an MPIParticle class and returns this.
Definition: MpiDataClass.cc:124
MPISphericalParticle
Definition: MpiDataClass.h:40
getMPISum
Vec3D getMPISum(Vec3D &val)
Definition: MpiDataClass.cc:199
ParticleHandler.h
BaseInteractable::getOrientation
const Quaternion & getOrientation() const
Returns the orientation of this BaseInteractable.
Definition: BaseInteractable.h:230
MPISuperQuadric::axes
Vec3D axes
Definition: MpiDataClass.h:61
copyDataFromMPIParticleToParticle
void copyDataFromMPIParticleToParticle(MPIParticle *bP, BaseParticle *p, ParticleHandler *particleHandler)
Copies data from an MPIParticle class to a BaseParticle.
Definition: MpiDataClass.cc:105
BaseInteractable::getIndSpecies
unsigned int getIndSpecies() const
Returns the index of the species associated with the interactable object.
Definition: BaseInteractable.h:88
BaseParticle::setHGridLevel
void setHGridLevel(const unsigned int level)
Sets the particle's HGrid level.
Definition: BaseParticle.h:472
ParticleSpecies
Definition: ParticleSpecies.h:37
BaseInteractable::getVelocity
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Definition: BaseInteractable.cc:329
BaseParticle::setRadius
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:542
Vec3D
Definition: Vector.h:50
MPILiquidFilmParticle::liquidVolume
Mdouble liquidVolume
Definition: MpiDataClass.h:72
BaseInteractable::setOrientation
void setOrientation(const Quaternion &orientation)
Sets the orientation of this BaseInteractable.
Definition: BaseInteractable.h:260
BaseParticle::setAxes
virtual void setAxes(const Vec3D &axes)
Only ustilised in case of superquadric particles.
Definition: BaseParticle.h:527
MPIParticleForce
Data class to send a particle force over MPI.
Definition: MpiDataClass.h:114
MPISphericalParticle::position
Vec3D position
Definition: MpiDataClass.h:46
BaseObject::setId
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
BaseParticle::getRadius
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
SuperQuadricParticle.h
BaseParticle::getAxes
virtual Vec3D getAxes() const
Only ustilised in case of superquadric particles. Had to create a virtual function to allow function ...
Definition: BaseParticle.cc:842
BaseParticle::setHGridZ
void setHGridZ(const int z)
Sets the particle's HGrid cell Z-coordinate.
Definition: BaseParticle.h:465
MPILiquidFilmParticle
Definition: MpiDataClass.h:70
BaseInteractable::setVelocity
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:350
BaseParticle::setPeriodicFromParticle
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
double
BaseInteractable::setAngularVelocity
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
Definition: BaseInteractable.cc:360
MPISphericalParticle::indSpecies
unsigned int indSpecies
Definition: MpiDataClass.h:43
MpiPeriodicGhostParticleID
MpiPeriodicParticleIDBase MpiPeriodicGhostParticleID
Definition: MpiDataClass.h:167
LiquidFilmParticle
Definition: LiquidFilmParticle.h:36
Logger.h
MPIParticleForce::force
Vec3D force
Definition: MpiDataClass.h:116
BaseParticle::setSpecies
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:804
MPISuperQuadric::newParticle
static BaseParticle * newParticle()
Definition: MpiDataClass.cc:161
MPIParticleVelocity::angularVelocity
Vec3D angularVelocity
Definition: MpiDataClass.h:106
MPISuperQuadric::copyDataFromMPIParticleToParticle
void copyDataFromMPIParticleToParticle(BaseParticle *p)
Definition: MpiDataClass.cc:85
DPMBase::speciesHandler
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1385
BaseParticle::setMaserParticle
void setMaserParticle(bool flag)
Flags the status of the particle if it belongs to the maser boundary or not.
Definition: BaseParticle.cc:306
MpiPeriodicParticleIDBase
Definition: MpiDataClass.h:148
MPISuperQuadric::epsilon2
Mdouble epsilon2
Definition: MpiDataClass.h:63
MPISphericalParticle::velocity
Vec3D velocity
Definition: MpiDataClass.h:48
BaseParticle::setExponents
virtual void setExponents(const Mdouble &eps1, const Mdouble &eps2)
Only ustilised in case of superquadric particles.
Definition: BaseParticle.h:532
DPMBase.h
MPISphericalParticle::angularVelocity
Vec3D angularVelocity
Definition: MpiDataClass.h:47
SphericalParticle
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
MpiPeriodicParticleID
MpiPeriodicParticleIDBase MpiPeriodicParticleID
Definition: MpiDataClass.h:166
MPIParticleForce::torque
Vec3D torque
Definition: MpiDataClass.h:117
MPISphericalParticle::isFixed
bool isFixed
Definition: MpiDataClass.h:52
MPIContainer
This class contains all information and functions required for communication between processors.
Definition: MpiContainer.h:130
getMPISum
Vec3D getMPISum(Vec3D &val)
Definition: MpiDataClass.cc:199
Vec3D::Y
Mdouble Y
Definition: Vector.h:65
MPIParticle
Data class to send a particle over MPI.
Definition: MpiDataClass.h:81
MPISphericalParticle::orientation
Quaternion orientation
Definition: MpiDataClass.h:49
MpiPeriodicParticleIDBase::targetPeriodicComplexity
std::vector< int > targetPeriodicComplexity
Definition: MpiDataClass.h:160
copyDataFromParticleToMPIParticle
MPIParticle copyDataFromParticleToMPIParticle(BaseParticle *p)
Copies data from a SuperQuadricParticle to an MPIParticle class and returns this.
Definition: MpiDataClass.cc:124
MPISphericalParticle::isMaser
bool isMaser
Definition: MpiDataClass.h:51
Quaternion
This class contains the 4 components of a quaternion and the standard operators and functions needed ...
Definition: Quaternion.h:63
MpiPeriodicParticleIDBase::periodicComplexity
std::vector< int > periodicComplexity
Definition: MpiDataClass.h:159
BaseParticle::getExponentEps1
virtual Mdouble getExponentEps1() const
Only ustilised in case of superquadric particles. Had to create a virtual function to allow function ...
Definition: BaseParticle.cc:845
MPILiquidFilmParticle::copyDataFromParticleToMPIParticle
void copyDataFromParticleToMPIParticle(BaseParticle *p)
Definition: MpiDataClass.cc:152
BaseHandler::getObject
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
BaseObject::getId
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.h:125
Empty
Data class to send an empty class over MPI.
Definition: MpiDataClass.h:131
BaseHandler::getDPMBase
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
Definition: BaseHandler.h:725
BaseParticle
Definition: BaseParticle.h:54
MPISphericalParticle::radius
Mdouble radius
Definition: MpiDataClass.h:45
BaseParticle::getHandler
ParticleHandler * getHandler() const
Returns pointer to the particle's ParticleHandler.
Definition: BaseParticle.cc:661
MPIParticleVelocity::velocity
Vec3D velocity
Definition: MpiDataClass.h:105
MPIParticlePosition::id
unsigned int id
Definition: MpiDataClass.h:92
MpiDataClass.h
SuperQuadricParticle
Definition: SuperQuadricParticle.h:56
SphericalParticle.h
copyPositionFrom
MPIParticlePosition copyPositionFrom(BaseParticle *particle)
Copies the position from a particle to an MPIParticlePosition class.
Definition: MpiDataClass.cc:174
MPIParticleVelocity
Data class to send a particle velocity over MPI.
Definition: MpiDataClass.h:103
copyPositionFrom
MPIParticlePosition copyPositionFrom(BaseParticle *particle)
Copies the position from a particle to an MPIParticlePosition class.
Definition: MpiDataClass.cc:174
MPIParticlePosition
Data class to send a particle position over MPI.
Definition: MpiDataClass.h:90
ParticleHandler
Container to store all BaseParticle.
Definition: ParticleHandler.h:48
BaseParticle::isFixed
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
copyVelocityFrom
MPIParticleVelocity copyVelocityFrom(BaseParticle *particle)
Copies the velocity from a particle to an MPIParticleVelocity class.
Definition: MpiDataClass.cc:190
MPISuperQuadric::epsilon1
Mdouble epsilon1
Definition: MpiDataClass.h:62
Vec3D::Z
Mdouble Z
Definition: Vector.h:65
MpiPeriodicParticleIDBase::realPeriodicComplexity
std::vector< int > realPeriodicComplexity
Definition: MpiDataClass.h:161
BaseParticle.h
MPISphericalParticle::id
unsigned int id
Definition: MpiDataClass.h:42
MpiPeriodicParticleIDBase::targetProcessor
int targetProcessor
Definition: MpiDataClass.h:154
BaseParticle::getCommunicationComplexity
unsigned getCommunicationComplexity()
Obtains the communication complexity of the particle.
Definition: BaseParticle.cc:195
MPISuperQuadric
Definition: MpiDataClass.h:59
BaseParticle::setHGridPrevObject
void setHGridPrevObject(BaseParticle *p)
Sets the pointer to the previous object in the particle's HGrid cell & level.
Definition: BaseParticle.h:488
MPIParticlePosition::orientation
Quaternion orientation
Definition: MpiDataClass.h:94
BaseInteractable::getPosition
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
MpiPeriodicParticleIDBase::otherParticle
BaseParticle * otherParticle
Definition: MpiDataClass.h:151
MPIContainer::Instance
static MPIContainer & Instance()
fetch the instance to be used for communication
Definition: MpiContainer.h:134