MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_ */
void copyDataFromMPIParticleToParticle(BaseParticle *p)
Copies data from a BaseParticle to an MPIParticle class and returns this.
Definition: MpiDataClass.cc:51
Implementation of a 3D quaternion (by Vitaliy).
Definition: Quaternion.h:62
std::vector< int > realPeriodicComplexity
Definition: MpiDataClass.h:161
void copyDataFromParticleToMPIParticle(BaseParticle *p)
static BaseParticle * newParticle()
unsigned int id
Definition: MpiDataClass.h:92
double Mdouble
Definition: GeneralDefine.h:34
Data class to send a particle velocity over MPI.
Definition: MpiDataClass.h:102
unsigned int indSpecies
Definition: MpiDataClass.h:43
static BaseParticle * newParticle()
Data class to send an empty class over MPI.
Definition: MpiDataClass.h:130
MpiPeriodicParticleIDBase MpiPeriodicParticleID
Definition: MpiDataClass.h:166
Mdouble epsilon1
Definition: MpiDataClass.h:62
Quaternion orientation
Definition: MpiDataClass.h:94
MPIParticlePosition copyPositionFrom(BaseParticle *particle)
Copies the position from a particle to an MPIParticlePosition class.
void copyDataFromMPIParticleToParticle(BaseParticle *p)
Definition: MpiDataClass.cc:92
static BaseParticle * newParticle()
Quaternion orientation
Definition: MpiDataClass.h:49
void copyDataFromParticleToMPIParticle(BaseParticle *p)
Data class to send a particle over MPI.
Definition: MpiDataClass.h:81
std::vector< int > targetPeriodicComplexity
Definition: MpiDataClass.h:160
std::vector< int > periodicComplexity
Definition: MpiDataClass.h:159
MPIParticle copyDataFromParticleToMPIParticle(BaseParticle *p)
Copies data from a BaseParticle to an MPIParticle class and returns this.
Container to store all BaseParticle.
unsigned communicationComplexity
Definition: MpiDataClass.h:50
Data class to send a particle position over MPI.
Definition: MpiDataClass.h:89
Mdouble epsilon2
Definition: MpiDataClass.h:63
void copyDataFromMPIParticleToParticle(MPIParticle *bP, BaseParticle *p, ParticleHandler *particleHandler)
Copies data from an MPIParticle class to a BaseParticle.
unsigned int HGridLevel
Definition: MpiDataClass.h:44
Definition: Vector.h:49
MPIParticleVelocity copyVelocityFrom(BaseParticle *particles)
Copies the velocity from a particle to an MPIParticleVelocity class.
BaseParticle * otherParticle
Definition: MpiDataClass.h:151
Data class to send a particle force over MPI.
Definition: MpiDataClass.h:113
Vec3D getMPISum(Vec3D &val)
Sums the values over all processors using MPI_reduce.
MpiPeriodicParticleIDBase MpiPeriodicGhostParticleID
Definition: MpiDataClass.h:167
void copyDataFromParticleToMPIParticle(BaseParticle *p)
void copyDataFromMPIParticleToParticle(BaseParticle *p)
Definition: MpiDataClass.cc:85