src/Field/GuardCellSizes.cpp

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 /***************************************************************************
00003  *
00004  * The IPPL Framework
00005  * 
00006  * This program was prepared by PSI. 
00007  * All rights in the program are reserved by PSI.
00008  * Neither PSI nor the author(s)
00009  * makes any warranty, express or implied, or assumes any liability or
00010  * responsibility for the use of this software
00011  *
00012  * Visit http://www.acl.lanl.gov/POOMS for more details
00013  *
00014  ***************************************************************************/
00015 
00016 // -*- C++ -*-
00017 /***************************************************************************
00018  *
00019  * The IPPL Framework
00020  * 
00021  *
00022  * Visit http://people.web.psi.ch/adelmann/ for more details
00023  *
00024  ***************************************************************************/
00025 
00026 // include files
00027 #include "Field/GuardCellSizes.h"
00028 #include "Profile/Profiler.h"
00029 
00030 template<unsigned Dim>
00031 GuardCellSizes<Dim>::GuardCellSizes(unsigned s)
00032 {
00033   TAU_TYPE_STRING(taustr, CT(*this) + " void (unsigned)" );
00034   TAU_PROFILE("GuardCellSizes::GuardCellSizes()", taustr, TAU_FIELD);
00035   for (unsigned d=0; d<Dim; ++d)
00036     Left[d] = Right[d] = s;
00037 }
00038 
00039 template<unsigned Dim>
00040 GuardCellSizes<Dim>::GuardCellSizes(unsigned *s)
00041 {
00042   TAU_TYPE_STRING(taustr, CT(*this) + " void (unsigned * )" );
00043   TAU_PROFILE("GuardCellSizes::GuardCellSizes()", taustr, TAU_FIELD);
00044   for (unsigned d=0; d<Dim; ++d)
00045     Left[d] = Right[d] = s[d];
00046 }
00047 
00048 template<unsigned Dim>
00049 GuardCellSizes<Dim>::GuardCellSizes(unsigned l, unsigned r)
00050 {
00051   TAU_TYPE_STRING(taustr, CT(*this) + " void (unsigned, unsigned)" );
00052   TAU_PROFILE("GuardCellSizes::GuardCellSizes()", taustr, TAU_FIELD);
00053   for (unsigned d=0; d<Dim; ++d) {
00054     Left[d] = l;
00055     Right[d] = r;
00056   }
00057 }
00058 
00059 template<unsigned Dim>
00060 GuardCellSizes<Dim>::GuardCellSizes(unsigned *l, unsigned *r)
00061 {
00062   TAU_TYPE_STRING(taustr, CT(*this) + " void (unsigned * , unsigned * )" );
00063   TAU_PROFILE("GuardCellSizes::GuardCellSizes()", taustr, TAU_FIELD);
00064   for (unsigned d=0; d<Dim; ++d) {
00065     Left[d] = l[d];
00066     Right[d] = r[d];
00067   }
00068 }
00069 
00070 template<unsigned Dim>
00071 void GuardCellSizes<Dim>::set_Left(unsigned s)
00072 {
00073   TAU_TYPE_STRING(taustr, CT(*this) + " void (unsigned)" );
00074   TAU_PROFILE("GuardCellSizes::set_Left()", taustr, TAU_FIELD);
00075   for (unsigned d=0; d<Dim; ++d)
00076     Left[d] = s;
00077 }
00078 
00079 template<unsigned Dim>
00080 void GuardCellSizes<Dim>::set_Left(unsigned *s)
00081 {
00082   TAU_TYPE_STRING(taustr, CT(*this) + " void (unsigned * )" );
00083   TAU_PROFILE("GuardCellSizes::set_Left()", taustr, TAU_FIELD);
00084   for (unsigned d=0; d<Dim; ++d)
00085     Left[d] = s[d];
00086 }
00087 
00088 template<unsigned Dim>
00089 void GuardCellSizes<Dim>::set_Left(unsigned d, unsigned *s)
00090 {
00091   TAU_TYPE_STRING(taustr, CT(*this) + " void (unsigned, unsigned * )" );
00092   TAU_PROFILE("GuardCellSizes::set_Left()", taustr, TAU_FIELD);
00093   Left[d] = s[d];
00094 }
00095 
00096 template<unsigned Dim>
00097 void GuardCellSizes<Dim>::set_Right(unsigned s)
00098 {
00099   TAU_TYPE_STRING(taustr, CT(*this) + " void (unsigned )" );
00100   TAU_PROFILE("GuardCellSizes::set_Right()", taustr, TAU_FIELD);
00101   for (unsigned d=0; d<Dim; ++d)
00102     Right[d] = s;
00103 }
00104 
00105 template<unsigned Dim>
00106 void GuardCellSizes<Dim>::set_Right(unsigned *s)
00107 {
00108   TAU_TYPE_STRING(taustr, CT(*this) + " void (unsigned * )" );
00109   TAU_PROFILE("GuardCellSizes::set_Right()", taustr, TAU_FIELD);
00110   for (unsigned d=0; d<Dim; ++d)
00111     Right[d] = s[d];
00112 }
00113 
00114 template<unsigned Dim>
00115 void GuardCellSizes<Dim>::set_Right(unsigned d, unsigned *s)
00116 {
00117   TAU_TYPE_STRING(taustr, CT(*this) + " void (unsigned, unsigned * )" );
00118   TAU_PROFILE("GuardCellSizes::set_Right()", taustr, TAU_FIELD);
00119   Right[d] = s[d];
00120 }
00121 
00123 
00124 template<unsigned Dim>
00125 ostream&
00126 operator<<(ostream& out, const GuardCellSizes<Dim>& gc)
00127 {
00128   TAU_TYPE_STRING(taustr, "ostream (ostream, " + CT(gc) + " )" );
00129   TAU_PROFILE("operator<<()", taustr, TAU_FIELD | TAU_IO);
00130   for (unsigned d=0; d<Dim; ++d)
00131     out << "[" << gc.left(d) << "," << gc.right(d) << "]";
00132   return out;
00133 }
00134 
00135 /***************************************************************************
00136  * $RCSfile: GuardCellSizes.cpp,v $   $Author: adelmann $
00137  * $Revision: 1.1.1.1 $   $Date: 2003/01/23 07:40:26 $
00138  * IPPL_VERSION_ID: $Id: GuardCellSizes.cpp,v 1.1.1.1 2003/01/23 07:40:26 adelmann Exp $ 
00139  ***************************************************************************/

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