OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
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 #ifdef __MWERKS__
39 // Work around partial-specialization template matching bug in CW4
40 template<class T, class C, unsigned int D>
41 inline bool
43 {
44  return p.DomainCompressed();
45 }
46 
47 template<class T, class C, unsigned int D>
48 inline bool
50 {
51  return p.DomainCompressed();
52 }
53 
54 template<class T, class C, unsigned int D>
55 inline bool
57 {
58  return p.DomainCompressed();
59 }
60 #endif // __MWERKS__
61 
62 template<class T, class C, unsigned int D>
63 inline bool
65 {
66  return true;
67 }
68 
69 template<class C>
70 inline bool
72 {
73  return false;
74 }
75 
76 template<class T, class C>
77 inline bool
79 {
80  return true;
81 }
82 
83 
85 //
86 // Do the terms all use the same kind of subset object?
87 //
89 
91  typedef bool PETE_Return_t;
92  int fID;
93  SameSubsetType(int id) : fID(id) {}
94 };
95 
96 template<class T, class S, class C, unsigned int D>
97 inline bool
99 {
100  return p.matchType(s.fID);
101 }
102 
103 #ifdef __MWERKS__
104 // Work around partial-specialization template matching bug in CW4
105 template<class T, class C, unsigned int D>
106 inline bool
108 {
109  return p.matchType(s.fID);
110 }
111 
112 template<class T, class C, unsigned int D>
113 inline bool
115 {
116  return p.matchType(s.fID);
117 }
118 
119 template<class T, class C, unsigned int D>
120 inline bool
122 {
123  return p.matchType(s.fID);
124 }
125 #endif // __MWERKS__
126 
127 template<class T, class C, unsigned int D>
128 inline bool
130 {
131  return false;
132 }
133 
134 template<class C>
135 inline bool
137 {
138  return true;
139 }
140 
141 template<class T, class C>
142 inline bool
144 {
145  return true;
146 }
147 
148 
150 //
151 // Initialize all subset objects in an expression before the loop starts
152 //
154 
155 struct SubsetInit {
156  typedef int PETE_Return_t;
157 };
158 
159 template<class T, class S, class C, unsigned int D>
160 inline int
162 {
163  p.initialize();
164  return 0;
165 }
166 
167 #ifdef __MWERKS__
168 // Work around partial-specialization template matching bug in CW4
169 template<class T, class C, unsigned int D>
170 inline int
172 {
173  p.initialize();
174  return 0;
175 }
176 
177 template<class T, class C, unsigned int D>
178 inline int
180 {
181  p.initialize();
182  return 0;
183 }
184 
185 template<class T, class C, unsigned int D>
186 inline int
188 {
189  p.initialize();
190  return 0;
191 }
192 #endif // __MWERKS__
193 
194 template<class T, class C, unsigned int D>
195 inline int
197 {
198  return 0;
199 }
200 
201 template<class C>
202 inline int
204 {
205  return 0;
206 }
207 
208 template<class T, class C>
209 inline int
211 {
212  return 0;
213 }
214 
215 
217 //
218 // Set a subfield iterator to point to the next lfield
219 //
221 
223  typedef int PETE_Return_t;
224 };
225 
226 template<class T, class S, class C, unsigned int D>
227 inline int
229 {
230  p.nextLField();
231  return 0;
232 }
233 
234 #ifdef __MWERKS__
235 // Work around partial-specialization template matching bug in CW4
236 template<class T, class C, unsigned int D>
237 inline int
239 {
240  p.nextLField();
241  return 0;
242 }
243 
244 template<class T, class C, unsigned int D>
245 inline int
247 {
248  p.nextLField();
249  return 0;
250 }
251 
252 template<class T, class C, unsigned int D>
253 inline int
255 {
256  p.nextLField();
257  return 0;
258 }
259 #endif // __MWERKS__
260 
261 template<class T, class C, unsigned int D>
262 inline int
264 {
265  return 0;
266 }
267 
268 template<class C>
269 inline int
271 {
272  return 0;
273 }
274 
275 template<class T, class C>
276 inline int
278 {
279  return 0;
280 }
281 
282 
284 //
285 // Do any of the terms in an expression have an ID equal to a given one?
286 //
288 
289 template<class T, class S, class C, unsigned int D>
290 inline bool
292 {
293  return p.getBareField().get_Id() == s.fID;
294 }
295 
296 #ifdef __MWERKS__
297 // Work around partial-specialization template matching bug in CW4
298 template<class T, class C, unsigned int D>
299 inline bool
300 for_each(const SubFieldIter<T,D,SIndex<D> > &p, const SameFieldID &s, C)
301 {
302  return p.getBareField().get_Id() == s.fID;
303 }
304 
305 template<class T, class C, unsigned int D>
306 inline bool
307 for_each(const SubFieldIter<T,D,NDIndex<D> > &p, const SameFieldID &s, C)
308 {
309  return p.getBareField().get_Id() == s.fID;
310 }
311 
312 template<class T, class C, unsigned int D>
313 inline bool
314 for_each(const SubFieldIter<T,D,SOffset<D> > &p, const SameFieldID &s, C)
315 {
316  return p.getBareField().get_Id() == s.fID;
317 }
318 #endif // __MWERKS__
319 
321 //
322 // Plugbase.
323 //
325 
326 template<class T, unsigned D, class S, class C>
327 inline bool
329 {
330  return p.plugBase(f.Domain);
331 }
332 
333 #ifdef __MWERKS__
334 // Work around partial-specialization template matching bug in CW4
335 template<class T, unsigned D, class C>
336 inline bool
337 for_each(SubFieldIter<T,D,SIndex<D> > &p, const PlugBase<D>& f, C)
338 {
339  return p.plugBase(f.Domain);
340 }
341 
342 template<class T, unsigned D, class C>
343 inline bool
344 for_each(SubFieldIter<T,D,NDIndex<D> > &p, const PlugBase<D>& f, C)
345 {
346  return p.plugBase(f.Domain);
347 }
348 
349 template<class T, unsigned D, class C>
350 inline bool
351 for_each(SubFieldIter<T,D,SOffset<D> > &p, const PlugBase<D>& f, C)
352 {
353  return p.plugBase(f.Domain);
354 }
355 #endif // __MWERKS__
356 
358 //
359 // Check for compression.
360 //
362 
363 template<class T, class S, class C, unsigned int D>
364 inline bool
366 {
367  return p.IsCompressed();
368 }
369 
370 #ifdef __MWERKS__
371 // Work around partial-specialization template matching bug in CW4
372 template<class T, class C, unsigned int D>
373 inline bool
375 {
376  return p.IsCompressed();
377 }
378 
379 template<class T, class C, unsigned int D>
380 inline bool
382 {
383  return p.IsCompressed();
384 }
385 
386 template<class T, class C, unsigned int D>
387 inline bool
389 {
390  return p.IsCompressed();
391 }
392 #endif // __MWERKS__
393 
395 //
396 // Evaluation functors.
397 // First, no arguments.
398 //
400 
401 template<class T, class S, unsigned int D>
402 inline T&
404 {
405  return *p;
406 }
407 
408 #ifdef __MWERKS__
409 // Work around partial-specialization template matching bug in CW4
410 template<class T, unsigned int D>
411 inline T&
413 {
414  return *p;
415 }
416 
417 template<class T, unsigned int D>
418 inline T&
420 {
421  return *p;
422 }
423 
424 template<class T, unsigned int D>
425 inline T&
427 {
428  return *p;
429 }
430 #endif // __MWERKS__
431 
433 //
434 // Evaluation functors.
435 // One argument.
436 //
438 
439 template<class T, class S, unsigned int D>
440 inline T&
442 {
443  return p.offset(e.I);
444 }
445 
446 #ifdef __MWERKS__
447 // Work around partial-specialization template matching bug in CW4
448 template<class T, unsigned int D>
449 inline T&
451 {
452  return p.offset(e.I);
453 }
454 
455 template<class T, unsigned int D>
456 inline T&
458 {
459  return p.offset(e.I);
460 }
461 
462 template<class T, unsigned int D>
463 inline T&
465 {
466  return p.offset(e.I);
467 }
468 #endif // __MWERKS__
469 
471 //
472 // Evaluation functors.
473 // Two arguments.
474 //
476 
477 template<class T, class S, unsigned int D>
478 inline T&
480 {
481  return p.offset(e.I,e.J);
482 }
483 
484 #ifdef __MWERKS__
485 // Work around partial-specialization template matching bug in CW4
486 template<class T, unsigned int D>
487 inline T&
489 {
490  return p.offset(e.I,e.J);
491 }
492 
493 template<class T, unsigned int D>
494 inline T&
496 {
497  return p.offset(e.I,e.J);
498 }
499 
500 template<class T, unsigned int D>
501 inline T&
503 {
504  return p.offset(e.I,e.J);
505 }
506 #endif // __MWERKS__
507 
509 //
510 // Evaluation functors.
511 // Three arguments.
512 //
514 
515 template<class T, class S, unsigned int D>
516 inline T&
518 {
519  return p.offset(e.I,e.J,e.K);
520 }
521 
522 #ifdef __MWERKS__
523 // Work around partial-specialization template matching bug in CW4
524 template<class T, unsigned int D>
525 inline T&
527 {
528  return p.offset(e.I,e.J,e.K);
529 }
530 
531 template<class T, unsigned int D>
532 inline T&
534 {
535  return p.offset(e.I,e.J,e.K);
536 }
537 
538 template<class T, unsigned int D>
539 inline T&
541 {
542  return p.offset(e.I,e.J,e.K);
543 }
544 #endif // __MWERKS__
545 
547 //
548 // Step in some dimension.
549 //
551 
552 template<class T, class S, class C, unsigned int D>
553 inline int
555 {
556  p.step(s.D);
557  return 0;
558 }
559 
560 #ifdef __MWERKS__
561 // Work around partial-specialization template matching bug in CW4
562 template<class T, class C, unsigned int D>
563 inline int
565 {
566  p.step(s.D);
567  return 0;
568 }
569 
570 template<class T, class C, unsigned int D>
571 inline int
573 {
574  p.step(s.D);
575  return 0;
576 }
577 
578 template<class T, class C, unsigned int D>
579 inline int
581 {
582  p.step(s.D);
583  return 0;
584 }
585 #endif // __MWERKS__
586 
588 //
589 // Rewind in some dimension.
590 //
592 
593 template<class T, class S, class C, unsigned int D>
594 inline int
596 {
597  p.rewind(s.D);
598  return 0;
599 }
600 
601 #ifdef __MWERKS__
602 // Work around partial-specialization template matching bug in CW4
603 template<class T, class C, unsigned int D>
604 inline int
606 {
607  p.rewind(s.D);
608  return 0;
609 }
610 
611 template<class T, class C, unsigned int D>
612 inline int
614 {
615  p.rewind(s.D);
616  return 0;
617 }
618 
619 template<class T, class C, unsigned int D>
620 inline int
622 {
623  p.rewind(s.D);
624  return 0;
625 }
626 #endif // __MWERKS__
627 
629 //
630 // Does an iterator reference something with unit stride?
631 // Don't worry about it for now.
632 //
634 
635 template<class T, unsigned int D, class S, class C>
636 inline bool
638 {
639  return false;
640 }
641 
642 #ifdef __MWERKS__
643 // Work around partial-specialization template matching bug in CW4
644 template<class T, unsigned int D, class C>
645 inline bool
647 {
648  return false;
649 }
650 
651 template<class T, unsigned int D, class C>
652 inline bool
654 {
655  return false;
656 }
657 
658 template<class T, unsigned int D, class C>
659 inline bool
661 {
662  return false;
663 }
664 #endif // __MWERKS__
665 
667 //
668 // Ask each term to fill guard cells and compress itself
669 //
671 
672 template<class T, unsigned int D, class S, class C, class T1>
673 inline int
675 {
676  //tjw3/3/99 p.FillGCIfNecessary(f.I, f.I);
677  p.FillGCIfNecessary();
678  return 0;
679 }
680 
681 #ifdef __MWERKS__
682 // Work around partial-specialization template matching bug in CW4
683 template<class T, unsigned int D, class C, class T1>
684 inline int
686 {
687  //tjw3/3/99 p.FillGCIfNecessary(f.I, f.I);
688  p.FillGCIfNecessary();
689  return 0;
690 }
691 
692 template<class T, unsigned int D, class C, class T1>
693 inline int
695 {
696  //tjw3/3/99 p.FillGCIfNecessary(f.I, f.I);
697  p.FillGCIfNecessary();
698  return 0;
699 }
700 
701 template<class T, unsigned int D, class C, class T1>
702 inline int
704 {
705  //tjw3/3/99 p.FillGCIfNecessary(f.I, f.I);
706  p.FillGCIfNecessary();
707  return 0;
708 }
709 
710 #endif // __MWERKS__
711 
712 
713 #endif // SUB_FIELD_ASSIGN_DEFS_H
714 
715 /***************************************************************************
716  * $RCSfile: SubFieldAssignDefs.h,v $ $Author: adelmann $
717  * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $
718  * IPPL_VERSION_ID: $Id: SubFieldAssignDefs.h,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $
719  ***************************************************************************/
constexpr double e
The value of .
Definition: Physics.h:40
Definition: rbendmap.h:8
Definition: SIndex.h:28
unsigned D
Definition: AssignTags.h:111
unsigned D
Definition: AssignTags.h:104
bool for_each(const BareFieldIterator< T, D > &p, SameFieldID s, C)
Definition: AssignDefs.h:30
NDIndex< D > Domain
Definition: AssignDefs.h:71