OPAL (Object Oriented Parallel Accelerator Library)
2024.1
OPAL
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ippl
src
Particle
PAssign.hpp
Go to the documentation of this file.
1
// -*- C++ -*-
2
/***************************************************************************
3
*
4
* The IPPL Framework
5
*
6
* This program was prepared by PSI.
7
* All rights in the program are reserved by PSI.
8
* Neither PSI nor the author(s)
9
* makes any warranty, express or implied, or assumes any liability or
10
* responsibility for the use of this software
11
*
12
* Visit www.amas.web.psi for more details
13
*
14
***************************************************************************/
15
16
// -*- C++ -*-
17
/***************************************************************************
18
*
19
* The IPPL Framework
20
*
21
*
22
* Visit http://people.web.psi.ch/adelmann/ for more details
23
*
24
***************************************************************************/
25
26
// include files
27
#include "
Particle/PAssign.h
"
28
#include "
Particle/PAssignDefs.h
"
29
#include "
Particle/ParticleAttrib.h
"
30
#include "
Particle/ParticleAttribElem.h
"
31
#include "
PETE/IpplExpressions.h
"
32
#include "
Utility/IpplStats.h
"
33
34
35
37
38
template
<
class
T,
unsigned
Dim,
class
RHS,
class
OP>
39
void
40
assign
(
const
ParticleAttribElem<T,Dim>
& ca, RHS b, OP op)
41
{
42
// Cast away Const-ness. Aarrgghh!!
43
ParticleAttribElem<T,Dim>
& a = (
ParticleAttribElem<T,Dim>
&) ca;
44
typename
RHS::Wrapped& bb = b.
PETE_unwrap
();
45
46
// Begin/End iterators for the ParticleAttribElem on the left hand side.
47
typename
ParticleAttribElem<T,Dim>::iterator
pa = a.
begin
(), aend = a.
end
();
48
for
( ; pa != aend ; ++pa) {
49
PETE_apply
( op, *pa,
for_each
(bb,
EvalFunctor_0
()) );
50
for_each
(bb,
PETE_Increment
(),
PETE_NullCombiner
());
51
}
52
53
INCIPPLSTAT
(incParticleExpressions);
54
}
55
56
template
<
class
T,
class
RHS,
class
OP>
57
void
58
assign
(
const
ParticleAttrib<T>
& ca, RHS b, OP op)
59
{
60
// Cast away Const-ness. Aarrgghh!!
61
ParticleAttrib<T>
& a = (
ParticleAttrib<T>
&) ca;
62
typename
RHS::Wrapped& bb = b.
PETE_unwrap
();
63
64
// Begin and end iterators for the ParticleAttrib on the left hand side.
65
typename
ParticleAttrib<T>::iterator
pa = a.
begin
(), aend = a.
end
();
66
for
( ; pa != aend ; ++pa) {
67
PETE_apply
( op, *pa,
for_each
(bb,
EvalFunctor_0
()) );
68
for_each
(bb,
PETE_Increment
(),
PETE_NullCombiner
());
69
}
70
71
INCIPPLSTAT
(incParticleExpressions);
72
}
73
75
76
/***************************************************************************
77
* $RCSfile: PAssign.cpp,v $ $Author: adelmann $
78
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:28 $
79
* IPPL_VERSION_ID: $Id: PAssign.cpp,v 1.1.1.1 2003/01/23 07:40:28 adelmann Exp $
80
***************************************************************************/
ParticleAttrib::end
iterator end()
Definition:
ParticleAttrib.h:175
assign
void assign(const BareField< T, Dim > &a, RHS b, OP op, ExprTag< true >)
INCIPPLSTAT
#define INCIPPLSTAT(stat)
Definition:
IpplStats.h:236
ParticleAttribElemIterator
Definition:
ParticleAttribElem.h:40
PAssignDefs.h
ParticleAttrib::begin
iterator begin()
Definition:
ParticleAttrib.h:174
ParticleAttrib.h
PETE_Increment
Definition:
PETE.h:184
IpplStats.h
ParticleAttribElem.h
PETE_apply
void PETE_apply(const OpPeriodic< T > &, T &a, const T &b)
Definition:
BCond.hpp:353
EvalFunctor_0
Definition:
PETE.h:178
ParticleAttribElem::begin
iterator begin() const
Definition:
ParticleAttribElem.h:94
PETE_NullCombiner
Definition:
PETE.h:456
ParticleAttribElem
Definition:
ParticleAttribElem.h:67
ParticleAttrib
Definition:
MakeDataSource.h:25
for_each
bool for_each(const BareFieldIterator< T, D > &p, SameFieldID s, C)
Definition:
AssignDefs.h:30
PETE_Expr< ParticleAttribElem< T, Dim > >::PETE_unwrap
ParticleAttribElem< T, Dim > & PETE_unwrap()
Definition:
PETE.h:81
PAssign.h
ParticleAttribIterator
Definition:
ParticleAttrib.h:92
ParticleAttribElem::end
iterator end() const
Definition:
ParticleAttribElem.h:97
IpplExpressions.h
Generated on Tue Jul 2 2024 15:05:15 for OPAL (Object Oriented Parallel Accelerator Library) by
1.8.5