OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
src
ippl
src
SubField
SubFieldAssign.h
Go to the documentation of this file.
1
/***************************************************************************
2
*
3
* The IPPL Framework
4
*
5
***************************************************************************/
6
7
#ifndef SUB_FIELD_ASSIGN_H
8
#define SUB_FIELD_ASSIGN_H
9
10
// include files
11
#include "
Field/Assign.h
"
12
13
// forward declarations
14
template
<
class
T,
unsigned
int
Dim,
class
S>
class
SubBareField
;
15
16
17
/***************************************************************************
18
Versions of the assign function used to assign values to a SubBareField
19
in an expression. SubFieldAssign uses information in SubFieldAssignDefs
20
for specific definitions of for_each operations used in assign.
21
22
So far, only the assign function for the simple case where everything is
23
perfectly aligned is implemented ... to complete this, assign must handle
24
assigments between non-conforming layouts which requires general
25
communication. Also, support will have to be added for:
26
- Assigning single-element subfield's to scalars
27
- Slice operations between fields of unequal dimension
28
***************************************************************************/
29
30
32
// SubBareField = Expression
33
template
<
class
T1,
unsigned
Dim,
class
S,
class
RHS,
class
OP>
34
void
35
assign
(
SubBareField<T1,Dim,S>
a
, RHS b, OP op,
ExprTag<true>
);
36
37
39
// SubBareField = constant
40
template
<
class
T,
unsigned
D,
class
S,
class
OP>
41
inline
void
42
assign
(
SubBareField<T,D,S>
a
,
const
T
& b, OP op,
ExprTag<true>
) {
43
assign
(
a
,
PETE_Scalar<T>
(b), op,
ExprTag<true>
());
44
}
45
46
48
49
#define SUB_ASSIGNMENT_OPERATORS(FUNC,OP) \
50
\
51
template<class T, unsigned D, class S> \
52
inline void \
53
FUNC(const SubBareField<T,D,S>& lhs, const T& rhs) \
54
{ \
55
assign(lhs,PETE_Scalar<T>(rhs), OP(),ExprTag<true>()); \
56
}
57
58
59
SUB_ASSIGNMENT_OPERATORS
(
assign
,
OpAssign
)
60
SUB_ASSIGNMENT_OPERATORS
(operator<<,
OpAssign
)
61
SUB_ASSIGNMENT_OPERATORS
(operator+=,
OpAddAssign
)
62
SUB_ASSIGNMENT_OPERATORS
(operator-=,
OpSubtractAssign
)
63
SUB_ASSIGNMENT_OPERATORS
(operator*=,
OpMultipplyAssign
)
64
SUB_ASSIGNMENT_OPERATORS
(operator/=,
OpDivideAssign
)
65
SUB_ASSIGNMENT_OPERATORS
(
mineq
,
OpMinAssign
)
66
SUB_ASSIGNMENT_OPERATORS
(
maxeq
,
OpMaxAssign
)
67
68
#include "SubField/SubFieldAssign.hpp"
69
70
#endif
// SUB_FIELD_ASSIGN_H
Assign.h
a
std::complex< double > a
Definition:
IpplExpressions.h:56
mineq
void mineq(const SubBareField< T, D, S > &lhs, const T &rhs)
Definition:
SubFieldAssign.h:65
SUB_ASSIGNMENT_OPERATORS
#define SUB_ASSIGNMENT_OPERATORS(FUNC, OP)
Definition:
SubFieldAssign.h:49
assign
void assign(SubBareField< T1, Dim, S > a, RHS b, OP op, ExprTag< true >)
Definition:
SubFieldAssign.hpp:44
maxeq
void maxeq(const SubBareField< T, D, S > &lhs, const T &rhs)
Definition:
SubFieldAssign.h:66
Attrib::Legacy::Distribution::T
@ T
Definition:
Distribution.h:189
ExprTag
Definition:
Assign.h:48
OpMinAssign
Definition:
IpplTypeComputations.h:615
OpMaxAssign
Definition:
IpplTypeComputations.h:619
PETE_Scalar
Definition:
PETE.h:143
OpAssign
Definition:
TypeComputations.h:553
OpAddAssign
Definition:
TypeComputations.h:558
OpSubtractAssign
Definition:
TypeComputations.h:563
OpMultipplyAssign
Definition:
TypeComputations.h:568
OpDivideAssign
Definition:
TypeComputations.h:573
SubBareField
Definition:
SubBareField.h:57
Generated on Wed Aug 25 2021 16:40:59 for OPAL (Object Oriented Parallel Accelerator Library) by
1.9.1