MpiDataClass.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2023, 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_ */
void copyDataFromMPIParticleToParticle(MPIParticle *bP, BaseParticle *p, ParticleHandler *particleHandler)
Copies data from an MPIParticle class to a BaseParticle.
Definition: MpiDataClass.cc:105
MpiPeriodicParticleIDBase MpiPeriodicGhostParticleID
Definition: MpiDataClass.h:167
MPIParticleVelocity copyVelocityFrom(BaseParticle *particles)
Copies the velocity from a particle to an MPIParticleVelocity class.
Definition: MpiDataClass.cc:190
MPIParticlePosition copyPositionFrom(BaseParticle *particle)
Copies the position from a particle to an MPIParticlePosition class.
Definition: MpiDataClass.cc:174
MpiPeriodicParticleIDBase MpiPeriodicParticleID
Definition: MpiDataClass.h:166
Vec3D getMPISum(Vec3D &val)
Definition: MpiDataClass.cc:199
MPIParticle copyDataFromParticleToMPIParticle(BaseParticle *p)
Copies data from a BaseParticle to an MPIParticle class and returns this.
Definition: MpiDataClass.cc:124
Definition: BaseParticle.h:54
Data class to send an empty class over MPI.
Definition: MpiDataClass.h:131
Definition: MpiDataClass.h:70
static BaseParticle * newParticle()
Definition: MpiDataClass.cc:165
void copyDataFromMPIParticleToParticle(BaseParticle *p)
Definition: MpiDataClass.cc:92
void copyDataFromParticleToMPIParticle(BaseParticle *p)
Definition: MpiDataClass.cc:152
Mdouble liquidVolume
Definition: MpiDataClass.h:72
Data class to send a particle force over MPI.
Definition: MpiDataClass.h:114
Vec3D torque
Definition: MpiDataClass.h:117
Vec3D force
Definition: MpiDataClass.h:116
Data class to send a particle position over MPI.
Definition: MpiDataClass.h:90
Vec3D position
Definition: MpiDataClass.h:93
Quaternion orientation
Definition: MpiDataClass.h:94
Mdouble liquidVolume
Definition: MpiDataClass.h:95
unsigned int id
Definition: MpiDataClass.h:92
Data class to send a particle velocity over MPI.
Definition: MpiDataClass.h:103
Vec3D velocity
Definition: MpiDataClass.h:105
Vec3D angularVelocity
Definition: MpiDataClass.h:106
Data class to send a particle over MPI.
Definition: MpiDataClass.h:81
Definition: MpiDataClass.h:40
bool isFixed
Definition: MpiDataClass.h:52
Vec3D angularVelocity
Definition: MpiDataClass.h:47
Vec3D position
Definition: MpiDataClass.h:46
static BaseParticle * newParticle()
Definition: MpiDataClass.cc:157
void copyDataFromMPIParticleToParticle(BaseParticle *p)
Copies data from a BaseParticle to an MPIParticle class and returns this.
Definition: MpiDataClass.cc:51
unsigned int HGridLevel
Definition: MpiDataClass.h:44
unsigned int id
Definition: MpiDataClass.h:42
Mdouble radius
Definition: MpiDataClass.h:45
unsigned communicationComplexity
Definition: MpiDataClass.h:50
unsigned int indSpecies
Definition: MpiDataClass.h:43
bool isMaser
Definition: MpiDataClass.h:51
void copyDataFromParticleToMPIParticle(BaseParticle *p)
Definition: MpiDataClass.cc:131
Quaternion orientation
Definition: MpiDataClass.h:49
Vec3D velocity
Definition: MpiDataClass.h:48
Definition: MpiDataClass.h:59
void copyDataFromParticleToMPIParticle(BaseParticle *p)
Definition: MpiDataClass.cc:145
Mdouble epsilon2
Definition: MpiDataClass.h:63
static BaseParticle * newParticle()
Definition: MpiDataClass.cc:161
Vec3D axes
Definition: MpiDataClass.h:61
Mdouble epsilon1
Definition: MpiDataClass.h:62
void copyDataFromMPIParticleToParticle(BaseParticle *p)
Definition: MpiDataClass.cc:85
Definition: MpiDataClass.h:148
std::vector< int > periodicComplexity
Definition: MpiDataClass.h:159
std::vector< int > realPeriodicComplexity
Definition: MpiDataClass.h:161
int targetProcessor
Definition: MpiDataClass.h:154
BaseParticle * otherParticle
Definition: MpiDataClass.h:151
std::vector< int > targetPeriodicComplexity
Definition: MpiDataClass.h:160
BaseParticle * particle
Definition: MpiDataClass.h:150
Container to store all BaseParticle.
Definition: ParticleHandler.h:48
This class contains the 4 components of a quaternion and the standard operators and functions needed ...
Definition: Quaternion.h:63
Definition: SuperQuadricParticle.h:57
Definition: Vector.h:51