OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
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
17 
19 //
20 // Is the domain specification object compressed?
21 //
23 
24 template<class PA, class T, unsigned D, class C>
25 inline bool
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
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
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
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
81 {
82  return false;
83 }
84 
86 //
87 // Plugbase.
88 //
90 
91 template<class PA, class T, unsigned D, class C>
92 inline bool
94 {
95  return p.plugBase(f.Domain);
96 }
97 
98 template<class PA, class T, unsigned D, class C>
99 inline bool
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&
118 {
119  return p.offset(e.I);
120 }
121 
122 template<class PA, class T, unsigned D>
123 inline T&
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
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
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  ***************************************************************************/
static void abort(const char *=0, int exitcode=(-1))
Definition: IpplInfo.cpp:696
constexpr double e
The value of .
Definition: Physics.h:40
Definition: rbendmap.h:8
#define ERRORMSG(msg)
Definition: IpplInfo.h:399
bool plugBase(const NDIndex< Dim > &)
static bool matchType(int t)
bool for_each(const BareFieldIterator< T, D > &p, SameFieldID s, C)
Definition: AssignDefs.h:30
NDIndex< D > Domain
Definition: AssignDefs.h:71
const_iterator_iv nextLField()