OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
SubFieldAssignDefs.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_DEFS_H
12 #define SUB_FIELD_ASSIGN_DEFS_H
13 
14 // include files
15 #include "Field/AssignDefs.h"
16 
17 // forward references
18 template<class T, unsigned int D, class S> class SubFieldIter;
19 
20 
22 //
23 // Is the domain specification object compressed?
24 //
26 
28  typedef bool PETE_Return_t;
29 };
30 
31 template<class T, class S, class C, unsigned int D>
32 inline bool
34 {
35  return p.DomainCompressed();
36 }
37 
38 template<class T, class C, unsigned int D>
39 inline bool
41 {
42  return true;
43 }
44 
45 template<class C>
46 inline bool
48 {
49  return false;
50 }
51 
52 template<class T, class C>
53 inline bool
55 {
56  return true;
57 }
58 
59 
61 //
62 // Do the terms all use the same kind of subset object?
63 //
65 
67  typedef bool PETE_Return_t;
68  int fID;
69  SameSubsetType(int id) : fID(id) {}
70 };
71 
72 template<class T, class S, class C, unsigned int D>
73 inline bool
75 {
76  return p.matchType(s.fID);
77 }
78 
79 template<class T, class C, unsigned int D>
80 inline bool
82 {
83  return false;
84 }
85 
86 template<class C>
87 inline bool
89 {
90  return true;
91 }
92 
93 template<class T, class C>
94 inline bool
96 {
97  return true;
98 }
99 
100 
102 //
103 // Initialize all subset objects in an expression before the loop starts
104 //
106 
107 struct SubsetInit {
108  typedef int PETE_Return_t;
109 };
110 
111 template<class T, class S, class C, unsigned int D>
112 inline int
114 {
115  p.initialize();
116  return 0;
117 }
118 
119 template<class T, class C, unsigned int D>
120 inline int
122 {
123  return 0;
124 }
125 
126 template<class C>
127 inline int
129 {
130  return 0;
131 }
132 
133 template<class T, class C>
134 inline int
136 {
137  return 0;
138 }
139 
140 
142 //
143 // Set a subfield iterator to point to the next lfield
144 //
146 
148  typedef int PETE_Return_t;
149 };
150 
151 template<class T, class S, class C, unsigned int D>
152 inline int
154 {
155  p.nextLField();
156  return 0;
157 }
158 
159 template<class T, class C, unsigned int D>
160 inline int
162 {
163  return 0;
164 }
165 
166 template<class C>
167 inline int
169 {
170  return 0;
171 }
172 
173 template<class T, class C>
174 inline int
176 {
177  return 0;
178 }
179 
180 
182 //
183 // Do any of the terms in an expression have an ID equal to a given one?
184 //
186 
187 template<class T, class S, class C, unsigned int D>
188 inline bool
190 {
191  return (int)p.getBareField().get_Id() == s.fID;
192 }
193 
195 //
196 // Plugbase.
197 //
199 
200 template<class T, unsigned D, class S, class C>
201 inline bool
203 {
204  return p.plugBase(f.Domain);
205 }
206 
208 //
209 // Check for compression.
210 //
212 
213 template<class T, class S, class C, unsigned int D>
214 inline bool
216 {
217  return p.IsCompressed();
218 }
219 
221 //
222 // Evaluation functors.
223 // First, no arguments.
224 //
226 
227 template<class T, class S, unsigned int D>
228 inline T&
230 {
231  return *p;
232 }
233 
235 //
236 // Evaluation functors.
237 // One argument.
238 //
240 
241 template<class T, class S, unsigned int D>
242 inline T&
244 {
245  return p.offset(e.I);
246 }
247 
249 //
250 // Evaluation functors.
251 // Two arguments.
252 //
254 
255 template<class T, class S, unsigned int D>
256 inline T&
258 {
259  return p.offset(e.I,e.J);
260 }
261 
263 //
264 // Evaluation functors.
265 // Three arguments.
266 //
268 
269 template<class T, class S, unsigned int D>
270 inline T&
272 {
273  return p.offset(e.I,e.J,e.K);
274 }
275 
277 //
278 // Step in some dimension.
279 //
281 
282 template<class T, class S, class C, unsigned int D>
283 inline int
285 {
286  p.step(s.D);
287  return 0;
288 }
289 
291 //
292 // Rewind in some dimension.
293 //
295 
296 template<class T, class S, class C, unsigned int D>
297 inline int
299 {
300  p.rewind(s.D);
301  return 0;
302 }
303 
305 //
306 // Does an iterator reference something with unit stride?
307 // Don't worry about it for now.
308 //
310 
311 template<class T, unsigned int D, class S, class C>
312 inline bool
314 {
315  return false;
316 }
317 
319 //
320 // Ask each term to fill guard cells and compress itself
321 //
323 
324 template<class T, unsigned int D, class S, class C, class T1>
325 inline int
327 {
328  //tjw3/3/99 p.FillGCIfNecessary(f.I, f.I);
329  p.FillGCIfNecessary();
330  return 0;
331 }
332 
333 #endif // SUB_FIELD_ASSIGN_DEFS_H
334 
335 /***************************************************************************
336  * $RCSfile: SubFieldAssignDefs.h,v $ $Author: adelmann $
337  * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $
338  * IPPL_VERSION_ID: $Id: SubFieldAssignDefs.h,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $
339  ***************************************************************************/
bool for_each(SubFieldIter< T, D, S > &p, DomainCompressed, C)
constexpr double e
The value of.
Definition: Physics.h:39
NDIndex< D > Domain
Definition: AssignDefs.h:71
unsigned D
Definition: AssignTags.h:89
unsigned D
Definition: AssignTags.h:96