OPAL (Object Oriented Parallel Accelerator Library)
2.2.0
OPAL
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ippl
src
SubParticle
SubParticleAssignDefs.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 SUB_PARTICLE_ASSIGN_DEFS_H
12
#define SUB_PARTICLE_ASSIGN_DEFS_H
13
14
// include files
15
#include "
SubField/SubFieldAssignDefs.h
"
16
#include "
SubParticle/SubParticleAssign.h
"
17
19
//
20
// Is the domain specification object compressed?
21
//
23
24
template
<
class
PA,
class
T,
unsigned
D,
class
C>
25
inline
bool
26
for_each
(
SubParticleAttribIter<PA,T,D>
&,
DomainCompressed
, C)
27
{
28
return
false
;
29
}
30
32
//
33
// Do the terms all use the same kind of subset object?
34
//
36
37
template
<
class
PA,
class
T,
unsigned
D,
class
C>
38
inline
bool
39
for_each
(
SubParticleAttribIter<PA,T,D>
&p,
SameSubsetType
s,C)
40
{
41
return
p.
matchType
(s.
fID
);
42
}
43
45
//
46
// Initialize all subset objects in an expression before the loop starts
47
//
49
50
template
<
class
PA,
class
T,
unsigned
D,
class
C>
51
inline
int
52
for_each
(
SubParticleAttribIter<PA,T,D>
&p,
SubsetInit
, C)
53
{
54
p.
initialize
();
55
return
0;
56
}
57
59
//
60
// Set a subfield iterator to point to the next lfield
61
//
63
64
template
<
class
PA,
class
T,
unsigned
D,
class
C>
65
inline
int
66
for_each
(
SubParticleAttribIter<PA,T,D>
&p,
SubsetNextLField
,C)
67
{
68
p.
nextLField
();
69
return
0;
70
}
71
73
//
74
// Do any of the terms in an expression have an ID equal to a given one?
75
//
77
78
template
<
class
PA,
class
T,
unsigned
D,
class
C>
79
inline
bool
80
for_each
(
SubParticleAttribIter<PA,T,D>
&,
SameFieldID
, C)
81
{
82
return
false
;
83
}
84
86
//
87
// Plugbase.
88
//
90
91
template
<
class
PA,
class
T,
unsigned
D,
class
C>
92
inline
bool
93
for_each
(
SubParticleAttribIter<PA,T,D>
&p,
const
PlugBase<D>
& f, C)
94
{
95
return
p.
plugBase
(f.
Domain
);
96
}
97
98
template
<
class
PA,
class
T,
unsigned
D,
class
C>
99
inline
bool
100
for_each
(
SubParticleAttribIter<PA,T,D>
&,
IsCompressed
, C)
101
{
102
return
false
;
103
}
104
106
//
107
// Evaluation functors.
108
// Just need EvalFunctor_1 here. EvalFunctor_0 is defined since we
109
// need it to compile, but it should never be called because it is
110
// only used when things are compressed, and SubParticleAttrib's are
111
// never compressed.
112
//
114
115
template
<
class
PA,
class
T,
unsigned
D>
116
inline
T
&
117
for_each
(
SubParticleAttribIter<PA,T,D>
&p,
const
EvalFunctor_1
&
e
)
118
{
119
return
p.
offset
(e.
I
);
120
}
121
122
template
<
class
PA,
class
T,
unsigned
D>
123
inline
T
&
124
for_each
(
SubParticleAttribIter<PA,T,D>
&p,
const
EvalFunctor_0
&)
125
{
126
// we should never be here
127
ERRORMSG
(
"SubParticleAttrib::iterator -> EvalFunctor_0 called."
);
128
Ippl::abort
();
129
130
// this is here just so we can have some kind of return value
131
return
p.
offset
(0);
132
}
133
135
//
136
// Does an iterator reference something with unit stride?
137
//
139
140
template
<
class
PA,
class
T,
unsigned
D,
class
C>
141
inline
bool
142
for_each
(
SubParticleAttribIter<PA,T,D>
&p,
HasUnitStride
, C)
143
{
144
return
true
;
145
}
146
147
149
//
150
// Ask each term to fill guard cells and compress itself
151
//
153
154
template
<
class
PA,
class
T,
unsigned
D,
class
C,
class
T1>
155
inline
int
156
for_each
(
SubParticleAttribIter<PA,T,D>
&,
const
FillGCIfNecessaryTag<D,T1>
&, C)
157
{
158
return
0;
159
}
160
161
162
#endif // SUB_PARTICLE_ASSIGN_DEFS_H
163
164
/***************************************************************************
165
* $RCSfile: SubParticleAssignDefs.h,v $ $Author: adelmann $
166
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $
167
* IPPL_VERSION_ID: $Id: SubParticleAssignDefs.h,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $
168
***************************************************************************/
EvalFunctor_1::I
int I
Definition:
AssignTags.h:44
IpplInfo::abort
static void abort(const char *=0, int exitcode=(-1))
Definition:
IpplInfo.cpp:696
Physics::e
constexpr double e
The value of .
Definition:
Physics.h:40
EvalFunctor_1
Definition:
AssignTags.h:42
HasUnitStride
Definition:
AssignTags.h:121
SubParticleAttribIter
Definition:
SubParticleAttrib.h:66
T
Definition:
rbendmap.h:8
SameSubsetType::fID
int fID
Definition:
SubFieldAssignDefs.h:92
IsCompressed
Definition:
AssignTags.h:31
ERRORMSG
#define ERRORMSG(msg)
Definition:
IpplInfo.h:399
SubFieldAssignDefs.h
EvalFunctor_0
Definition:
PETE.h:198
SubParticleAttribIter::plugBase
bool plugBase(const NDIndex< Dim > &)
Definition:
SubParticleAttrib.h:121
SubParticleAttribIter::offset
T & offset(int i)
Definition:
SubParticleAttrib.h:104
SubParticleAssign.h
FillGCIfNecessaryTag
Definition:
AssignTags.h:134
SubsetNextLField
Definition:
SubFieldAssignDefs.h:222
SubParticleAttribIter::matchType
static bool matchType(int t)
Definition:
SubParticleAttrib.h:98
SubsetInit
Definition:
SubFieldAssignDefs.h:155
PlugBase
Definition:
AssignDefs.h:69
for_each
bool for_each(const BareFieldIterator< T, D > &p, SameFieldID s, C)
Definition:
AssignDefs.h:30
PlugBase::Domain
NDIndex< D > Domain
Definition:
AssignDefs.h:71
SubParticleAttribIter::nextLField
const_iterator_iv nextLField()
Definition:
SubParticleAttrib.h:111
SubParticleAttribIter::initialize
void initialize()
Definition:
SubParticleAttrib.h:100
SameSubsetType
Definition:
SubFieldAssignDefs.h:90
DomainCompressed
Definition:
SubFieldAssignDefs.h:27
SameFieldID
Definition:
AssignTags.h:23
Generated on Sat Jan 4 2020 14:47:39 for OPAL (Object Oriented Parallel Accelerator Library) by
1.8.5