OPAL (Object Oriented Parallel Accelerator Library)
2.2.0
OPAL
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ippl
src
Particle
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
24
#include "
Particle/ParticleLayout.h
"
25
#include "
Particle/IpplParticleBase.h
"
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
;
44
typedef
pair_t
*
pair_iterator
;
45
46
typedef
typename
ParticleLayout<T, Dim>::SingleParticlePos_t
47
SingleParticlePos_t
;
48
typedef
typename
ParticleLayout<T, Dim>::Index_t
Index_t
;
49
50
// type of attributes this layout should use for position and ID
51
typedef
ParticleAttrib<SingleParticlePos_t>
ParticlePos_t
;
52
typedef
ParticleAttrib<Index_t>
ParticleIndex_t
;
53
54
public
:
55
// constructor and destructor
56
ParticleUniformLayout
();
57
~ParticleUniformLayout
();
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.
67
void
update
(
IpplParticleBase
<
ParticleUniformLayout<T,Dim>
>& p,
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
84
#include "
Particle/ParticleUniformLayout.hpp
"
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
***************************************************************************/
ParticleUniformLayout::ParticleUniformLayout
ParticleUniformLayout()
Definition:
ParticleUniformLayout.hpp:39
ParticleUniformLayout::pair_iterator
pair_t * pair_iterator
Definition:
ParticleUniformLayout.h:44
Vektor< T, Dim >
ParticleUniformLayout::Change
int * Change
Definition:
ParticleUniformLayout.h:80
ParticleLayout::Index_t
unsigned Index_t
Definition:
ParticleLayout.h:63
ParticleUniformLayout::Index_t
ParticleLayout< T, Dim >::Index_t Index_t
Definition:
ParticleUniformLayout.h:48
ParticleUniformLayout::SingleParticlePos_t
ParticleLayout< T, Dim >::SingleParticlePos_t SingleParticlePos_t
Definition:
ParticleUniformLayout.h:47
IpplParticleBase.h
ParticleUniformLayout::ParticleIndex_t
ParticleAttrib< Index_t > ParticleIndex_t
Definition:
ParticleUniformLayout.h:52
ParticleUniformLayout::printDebug
void printDebug(Inform &)
Definition:
ParticleUniformLayout.hpp:313
ParticleLayout.h
IpplParticleBase
Definition:
MakeDataSource.h:26
ParticleUniformLayout::ParticlePos_t
ParticleAttrib< SingleParticlePos_t > ParticlePos_t
Definition:
ParticleUniformLayout.h:51
ParticleUniformLayout::update
void update(IpplParticleBase< ParticleUniformLayout< T, Dim > > &p, const ParticleAttrib< char > *canSwap=0)
Definition:
ParticleUniformLayout.hpp:65
ParticleUniformLayout::LocalSize
int * LocalSize
Definition:
ParticleUniformLayout.h:79
ParticleAttrib
Definition:
MakeDataSource.h:25
ParticleUniformLayout::MsgCount
int * MsgCount
Definition:
ParticleUniformLayout.h:81
ParticleUniformLayout::pair_t
int pair_t
Definition:
ParticleUniformLayout.h:43
ParticleUniformLayout::~ParticleUniformLayout
~ParticleUniformLayout()
Definition:
ParticleUniformLayout.hpp:51
ParticleLayout
Definition:
ParticleLayout.h:54
ParticleUniformLayout
Definition:
ParticleBalancer.h:30
Inform
Definition:
Inform.h:41
ParticleUniformLayout.hpp
Generated on Sat Jan 4 2020 14:47:37 for OPAL (Object Oriented Parallel Accelerator Library) by
1.8.5