src/SubParticle/SubParticleAssignDefs.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 /***************************************************************************
00003  *
00004  * The IPPL Framework
00005  * 
00006  *
00007  * Visit http://people.web.psi.ch/adelmann/ for more details
00008  *
00009  ***************************************************************************/
00010 
00011 #ifndef SUB_PARTICLE_ASSIGN_DEFS_H
00012 #define SUB_PARTICLE_ASSIGN_DEFS_H
00013 
00014 // include files
00015 #include "SubField/SubFieldAssignDefs.h"
00016 #include "SubParticle/SubParticleAssign.h"
00017 
00019 //
00020 // Is the domain specification object compressed?
00021 //
00023 
00024 template<class PA, class T, unsigned D, class C>
00025 inline bool
00026 for_each(SubParticleAttribIter<PA,T,D> &, DomainCompressed, C)
00027 {
00028   return false;
00029 }
00030 
00032 //
00033 // Do the terms all use the same kind of subset object?
00034 //
00036 
00037 template<class PA, class T, unsigned D, class C>
00038 inline bool
00039 for_each(SubParticleAttribIter<PA,T,D> &p,SameSubsetType s,C)
00040 {
00041   return p.matchType(s.ID);
00042 }
00043 
00045 //
00046 // Initialize all subset objects in an expression before the loop starts
00047 //
00049 
00050 template<class PA, class T, unsigned D, class C>
00051 inline int
00052 for_each(SubParticleAttribIter<PA,T,D> &p, SubsetInit, C)
00053 {
00054   p.initialize();
00055   return 0;
00056 }
00057 
00059 //
00060 // Set a subfield iterator to point to the next lfield
00061 //
00063 
00064 template<class PA, class T, unsigned D, class C>
00065 inline int
00066 for_each(SubParticleAttribIter<PA,T,D> &p,SubsetNextLField,C)
00067 {
00068   p.nextLField();
00069   return 0;
00070 }
00071 
00073 //
00074 // Do any of the terms in an expression have an ID equal to a given one?
00075 //
00077 
00078 template<class PA, class T, unsigned D, class C>
00079 inline bool
00080 for_each(SubParticleAttribIter<PA,T,D> &, SameFieldID, C)
00081 {
00082   return false;
00083 }
00084 
00086 //
00087 // Plugbase.
00088 //
00090 
00091 template<class PA, class T, unsigned D, class C>
00092 inline bool
00093 for_each(SubParticleAttribIter<PA,T,D> &p, const PlugBase<D>& f, C)
00094 {
00095   return p.plugBase(f.Domain);
00096 }
00097 
00098 template<class PA, class T, unsigned D, class C>
00099 inline bool
00100 for_each(SubParticleAttribIter<PA,T,D> &, IsCompressed, C)
00101 {
00102   return false;
00103 }
00104 
00106 //
00107 // Evaluation functors.
00108 // Just need EvalFunctor_1 here.  EvalFunctor_0 is defined since we
00109 // need it to compile, but it should never be called because it is
00110 // only used when things are compressed, and SubParticleAttrib's are
00111 // never compressed.
00112 //
00114 
00115 template<class PA, class T, unsigned D>
00116 inline T&
00117 for_each(SubParticleAttribIter<PA,T,D> &p, const EvalFunctor_1 &e)
00118 {
00119   return p.offset(e.I);
00120 }
00121 
00122 template<class PA, class T, unsigned D>
00123 inline T&
00124 for_each(SubParticleAttribIter<PA,T,D> &p, const EvalFunctor_0 &)
00125 {
00126   // we should never be here
00127   ERRORMSG("SubParticleAttrib::iterator -> EvalFunctor_0 called.");
00128   Ippl::abort();
00129 
00130   // this is here just so we can have some kind of return value
00131   return p.offset(0);
00132 }
00133 
00135 //
00136 // Does an iterator reference something with unit stride?
00137 //
00139 
00140 template<class PA, class T, unsigned D, class C>
00141 inline bool
00142 for_each(SubParticleAttribIter<PA,T,D> &p, HasUnitStride, C)
00143 {
00144   return true;
00145 }
00146 
00147 
00149 //
00150 // Ask each term to fill guard cells and compress itself
00151 //
00153 
00154 template<class PA, class T, unsigned D, class C, class T1>
00155 inline int
00156 for_each(SubParticleAttribIter<PA,T,D> &, const FillGCIfNecessaryTag<D,T1> &, C)
00157 {
00158   return 0;
00159 }
00160 
00161 
00162 #endif // SUB_PARTICLE_ASSIGN_DEFS_H
00163 
00164 /***************************************************************************
00165  * $RCSfile: SubParticleAssignDefs.h,v $   $Author: adelmann $
00166  * $Revision: 1.1.1.1 $   $Date: 2003/01/23 07:40:33 $
00167  * IPPL_VERSION_ID: $Id: SubParticleAssignDefs.h,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $ 
00168  ***************************************************************************/

Generated on Mon Jan 16 13:23:56 2006 for IPPL by  doxygen 1.4.6