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
PAssignDefs.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 PASSIGN_DEFS_H
12
#define PASSIGN_DEFS_H
13
14
// include files
15
#include "
PETE/IpplExpressions.h
"
16
#include "
AppTypes/AppTypeTraits.h
"
17
18
// forward declarations
19
template
<
class
T>
class
ParticleAttrib
;
20
template
<
class
T,
unsigned
Dim>
class
ParticleAttribElem
;
21
22
24
//
25
// Evaluation functor.
26
//
28
29
template
<
class
T>
30
inline
T
&
31
for_each
(
ParticleAttribIterator<T>
& p,
EvalFunctor_0
)
32
{
33
return
*p;
34
}
35
36
template
<
class
T>
37
inline
const
T
&
38
for_each
(
ParticleAttribConstIterator<T>
& p,
EvalFunctor_0
)
39
{
40
return
*p;
41
}
42
43
#define DEFINE_EVALFUNCTOR_PAE(D) \
44
\
45
template<class T> \
46
inline typename AppTypeTraits<T>::Element_t& \
47
for_each(ParticleAttribElemIterator<T,D>& p, EvalFunctor_0) \
48
{ \
49
return *p; \
50
}
51
52
DEFINE_EVALFUNCTOR_PAE
(1)
53
DEFINE_EVALFUNCTOR_PAE
(2)
54
DEFINE_EVALFUNCTOR_PAE
(3)
55
DEFINE_EVALFUNCTOR_PAE
(4)
56
DEFINE_EVALFUNCTOR_PAE
(5)
57
DEFINE_EVALFUNCTOR_PAE
(6)
58
59
61
//
62
// Count the elements in an expression.
63
//
65
66
template<class
T
, class C>
67
inline
int
68
for_each
(const
ParticleAttribIterator
<T>& p,
PETE_CountElems
, C)
69
{
70
return
p.size();
71
}
72
73
template
<
class
T,
class
C>
74
inline
int
75
for_each
(
const
ParticleAttribConstIterator<T>
& p,
PETE_CountElems
, C)
76
{
77
return
p.
size
();
78
}
79
80
#define DEFINE_COUNTFUNCTOR_PAE(D) \
81
\
82
template<class T, class C> \
83
inline int \
84
for_each(const ParticleAttribElemIterator<T,D>& p, PETE_CountElems, C) \
85
{ \
86
return p.getParticleAttribElem().size(); \
87
}
88
89
DEFINE_COUNTFUNCTOR_PAE
(1)
90
DEFINE_COUNTFUNCTOR_PAE
(2)
91
DEFINE_COUNTFUNCTOR_PAE
(3)
92
DEFINE_COUNTFUNCTOR_PAE
(4)
93
DEFINE_COUNTFUNCTOR_PAE
(5)
94
DEFINE_COUNTFUNCTOR_PAE
(6)
95
96
98
//
99
// Increment the pointers in an expression.
100
//
102
103
template<class
T
, class C>
104
inline
int
105
for_each
(
ParticleAttribIterator
<T>& p,
PETE_Increment
, C)
106
{
107
++p;
108
return
0;
109
}
110
111
template
<
class
T,
class
C>
112
inline
int
113
for_each
(
ParticleAttribConstIterator<T>
& p,
PETE_Increment
, C)
114
{
115
++p;
116
return
0;
117
}
118
119
#define DEFINE_INCFUNCTOR_PAE(D) \
120
\
121
template<class T, class C> \
122
inline int \
123
for_each(ParticleAttribElemIterator<T,D>& p, PETE_Increment, C) \
124
{ \
125
++p; \
126
return 0; \
127
}
128
129
DEFINE_INCFUNCTOR_PAE
(1)
130
DEFINE_INCFUNCTOR_PAE
(2)
131
DEFINE_INCFUNCTOR_PAE
(3)
132
DEFINE_INCFUNCTOR_PAE
(4)
133
DEFINE_INCFUNCTOR_PAE
(5)
134
DEFINE_INCFUNCTOR_PAE
(6)
135
136
137
138
#endif // PASSIGN_DEFS_H
139
140
/***************************************************************************
141
* $RCSfile: PAssignDefs.h,v $ $Author: adelmann $
142
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:28 $
143
* IPPL_VERSION_ID: $Id: PAssignDefs.h,v 1.1.1.1 2003/01/23 07:40:28 adelmann Exp $
144
***************************************************************************/
145
T
Definition:
rbendmap.h:8
DEFINE_INCFUNCTOR_PAE
#define DEFINE_INCFUNCTOR_PAE(D)
Definition:
PAssignDefs.h:119
DEFINE_COUNTFUNCTOR_PAE
#define DEFINE_COUNTFUNCTOR_PAE(D)
Definition:
PAssignDefs.h:80
EvalFunctor_0
Definition:
PETE.h:198
ParticleAttribIterator
Definition:
ParticleAttrib.h:91
ParticleAttribElem
Definition:
ParticleAttribElem.h:67
PETE_CountElems
Definition:
PETE.h:221
ParticleAttrib
Definition:
MakeDataSource.h:25
IpplExpressions.h
AppTypeTraits.h
PETE_Increment
Definition:
PETE.h:209
for_each
bool for_each(const BareFieldIterator< T, D > &p, SameFieldID s, C)
Definition:
AssignDefs.h:30
DEFINE_EVALFUNCTOR_PAE
#define DEFINE_EVALFUNCTOR_PAE(D)
Definition:
PAssignDefs.h:43
ParticleAttribConstIterator
Definition:
ParticleAttrib.h:92
ParticleAttribConstIterator::size
size_t size() const
Definition:
ParticleAttrib.h:800
Generated on Sat Jan 4 2020 14:47:37 for OPAL (Object Oriented Parallel Accelerator Library) by
1.8.5