OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
ParticleUniformLayout.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /***************************************************************************
3  *
4  * The IPPL Framework
5  *
6  *
7  * Visit http://people.web.psi.ch/adelmann/ for more details
8  *
9  ***************************************************************************/
10 
11 #ifndef PARTICLE_UNIFORM_LAYOUT_H
12 #define PARTICLE_UNIFORM_LAYOUT_H
13 
14 /*
15  * ParticleUniformLayout - particle layout based on uniform distribution.
16  *
17  * This is a specialized version of ParticleLayout, which places particles
18  * on processors simply based on their global index. The total number
19  * of atoms on each processor is kept as uniform as possible, with no
20  * regard as to the relative location of each atom.
21  */
22 
23 // include files
26 
27 #include <iostream>
28 
29 // forward declarations
30 class Inform;
31 template<class T, unsigned Dim> class ParticleUniformLayout;
32 template<class T, unsigned Dim>
33 std::ostream& operator<<(std::ostream&, const ParticleUniformLayout<T,Dim>&);
34 
35 
36 // ParticleUniformLayout class definition. Template parameters are the type
37 // and dimension of the ParticlePos object used for the particles.
38 template<class T, unsigned Dim>
39 class ParticleUniformLayout : public ParticleLayout<T, Dim> {
40 
41 public:
42  // pair iterator definition ... this layout does not allow for pairlists
43  typedef int pair_t;
45 
49 
50  // type of attributes this layout should use for position and ID
53 
54 public:
55  // constructor and destructor
58 
59  //
60  // Particle swapping/update routines
61  //
62 
63  // Update the location and indices of all atoms in the given IpplParticleBase
64  // object. This handles swapping particles among processors if
65  // needed, and handles create and destroy requests. When complete,
66  // all nodes have correct layout information.
68  const ParticleAttrib<char>* canSwap = 0);
69 
70  //
71  // I/O
72  //
73 
74  // Print out information for debugging purposes.
75  void printDebug(Inform&);
76 
77 private:
78  // Particle redistribution data for each node; used in update
79  int *LocalSize;
80  int *Change;
81  int *MsgCount;
82 };
83 
85 
86 #endif // PARTICLE_UNIFORM_LAYOUT_H
87 
88 /***************************************************************************
89  * $RCSfile: ParticleUniformLayout.h,v $ $Author: adelmann $
90  * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:29 $
91  * IPPL_VERSION_ID: $Id: ParticleUniformLayout.h,v 1.1.1.1 2003/01/23 07:40:29 adelmann Exp $
92  ***************************************************************************/
std::ostream & operator<<(std::ostream &, const ParticleUniformLayout< T, Dim > &)
ParticleAttrib< SingleParticlePos_t > ParticlePos_t
ParticleLayout< T, Dim >::SingleParticlePos_t SingleParticlePos_t
void update(IpplParticleBase< ParticleUniformLayout< T, Dim > > &p, const ParticleAttrib< char > *canSwap=0)
ParticleLayout< T, Dim >::Index_t Index_t
ParticleAttrib< Index_t > ParticleIndex_t
unsigned Index_t
Definition: Inform.h:42