00001 // -*- C++ -*- 00002 //----------------------------------------------------------------------------- 00003 // The IPPL Framework - Visit http://people.web.psi.ch/adelmann/ for more details 00004 // 00005 // This program was prepared by the Regents of the University of California at 00006 // ParticleDebug.h , Tim Williams 8/6/1998 00007 // Helper functions to print out (formatted ASCII) ParticleAttrib elements. 00008 // Intended mainly for use from within a debugger, called interactively, but 00009 // also callable as template functions from source code. To call from many 00010 // debuggers, the user has to provide nontemplate wrapper functions, as 00011 // described in ParticleDebugFunctions.cpp. 00012 00013 #ifndef PARTICLE_DEBUG_H 00014 #define PARTICLE_DEBUG_H 00015 00016 // forward declarations 00017 class Inform; 00018 template<class T> class ParticleAttrib; 00019 00020 // extern declarations of global variables in ParticleDebugFunctions.cpp 00021 extern Inform* PtclDbgInform; 00022 extern bool PtclDbgInformIsSet; 00023 // extern declarations of global variables in FieldDebugFunctions.cpp 00024 extern Inform* FldDbgInform; 00025 extern bool FldDbgInformIsSet; 00026 extern int elementsPerLine; 00027 extern int digitsPastDecimal; 00028 extern int widthOfElements; 00029 00030 // forward declarations of global functions in ParticleDebugFunctions.cpp 00031 void setPtclDbgInform(Inform& inform); 00032 00033 //============================================================================= 00034 // Helper functions to print out (formatted ASCII) ParticleAttrib elements. 00035 // Intended mainly for use from within a debugger, called interactively. 00036 // pap(ParticleAttrib&) print all elements of ParticleAttrib 00037 // epap(ParticleAttrib&,....) prints single element of ParticleAttrib 00038 // specification of integer particle index 00039 // spap(ParticleAttrib&,....) prints strided range of elements of 00040 // ParticleAttrib; requires specification 00041 // of (base,bound,stride) for particle index values 00042 //============================================================================= 00043 00044 //------------------------------------------------------ 00045 // Function prototypes; see ParticleDebug.cpp for comments: 00046 //------------------------------------------------------ 00047 // For printing all elements of a ParticleAttrib: 00048 #ifdef __MWERKS__ 00049 // Work around CW4 bug with default arguments of template functions 00050 template<class T> 00051 void pap(ParticleAttrib<T>& pattr) {pap(pattr,true);} 00052 #endif // __MWERKS__ 00053 template<class T> 00054 void pap(ParticleAttrib<T>& pattr, bool docomm = true); 00055 00056 // For printing one element of a ParticleAttrib: 00057 #ifdef __MWERKS__ 00058 // Work around CW4 bug with default arguments of template functions 00059 template<class T> 00060 void epap(ParticleAttrib<T>& pattr, int i) {epap(pattr,i,true);} 00061 #endif // __MWERKS__ 00062 template<class T> 00063 void epap(ParticleAttrib<T>& pattr, int i, bool docomm = true); 00064 00065 // For printing strided subrange of elements of a ParticleAttrib: 00066 #ifdef __MWERKS__ 00067 // Work around CW4 bug with default arguments of template functions 00068 template<class T> 00069 void spap(ParticleAttrib<T>& pattr, 00070 int ibase, int ibound, int istride) { 00071 spap(pattr,ibase,ibound,istride,true);} 00072 #endif // __MWERKS__ 00073 template<class T> 00074 void spap(ParticleAttrib<T>& pattr, 00075 int ibase, int ibound, int istride, bool docomm = true); 00076 00077 #include "Utility/ParticleDebug.cpp" 00078 00079 #endif // PARTICLE_DEBUG_H 00080 00081 // $Id: ParticleDebug.h,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $ 00082 00083 /*************************************************************************** 00084 * $RCSfile: addheaderfooter,v $ $Author: adelmann $ 00085 * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:17 $ 00086 * IPPL_VERSION_ID: $Id: addheaderfooter,v 1.1.1.1 2003/01/23 07:40:17 adelmann Exp $ 00087 ***************************************************************************/ 00088