OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
SubFieldAssign.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_FIELD_ASSIGN_H
12 #define SUB_FIELD_ASSIGN_H
13 
14 // include files
15 #include "Field/Assign.h"
16 
17 // forward declarations
18 template<class T, unsigned int Dim, class S> class SubBareField;
19 
20 
21 /***************************************************************************
22  Versions of the assign function used to assign values to a SubBareField
23  in an expression. SubFieldAssign uses information in SubFieldAssignDefs
24  for specific definitions of for_each operations used in assign.
25 
26  So far, only the assign function for the simple case where everything is
27  perfectly aligned is implemented ... to complete this, assign must handle
28  assigments between non-conforming layouts which requires general
29  communication. Also, support will have to be added for:
30  - Assigning single-element subfield's to scalars
31  - Slice operations between fields of unequal dimension
32  ***************************************************************************/
33 
34 
36 // SubBareField = Expression
37 template<class T1, unsigned Dim, class S, class RHS, class OP>
38 void
40 
41 
43 // SubBareField = constant
44 template<class T, unsigned D, class S, class OP>
45 inline void
46 assign(SubBareField<T,D,S> a, const T& b, OP op, ExprTag<true>) {
47  assign(a, PETE_Scalar<T>(b), op, ExprTag<true>());
48 }
49 
50 
52 
53 #define SUB_ASSIGNMENT_OPERATORS(FUNC,OP) \
54  \
55 template<class T, unsigned D, class S> \
56 inline void \
57 FUNC(const SubBareField<T,D,S>& lhs, const T& rhs) \
58 { \
59  assign(lhs,PETE_Scalar<T>(rhs), OP(),ExprTag<true>()); \
60 }
61 
62 
71 
72 #include "SubField/SubFieldAssign.hpp"
73 
74 #endif // SUB_FIELD_ASSIGN_H
75 
76 /***************************************************************************
77  * $RCSfile: SubFieldAssign.h,v $ $Author: adelmann $
78  * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $
79  * IPPL_VERSION_ID: $Id: SubFieldAssign.h,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $
80  ***************************************************************************/
void mineq(const PETE_Expr< LHS > &lhs, const PETE_Expr< RHS > &rhs)
Definition: Assign.h:230
Definition: Assign.h:47
void maxeq(const PETE_Expr< LHS > &lhs, const PETE_Expr< RHS > &rhs)
Definition: Assign.h:231
Definition: rbendmap.h:8
#define SUB_ASSIGNMENT_OPERATORS(FUNC, OP)
void assign(const BareField< T, Dim > &a, RHS b, OP op, ExprTag< true >)