Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

RealVect.H

Go to the documentation of this file.
00001 /* _______              __
00002   / ___/ /  ___  __ _  / /  ___
00003  / /__/ _ \/ _ \/  ' \/ _ \/ _ \
00004  \___/_//_/\___/_/_/_/_.__/\___/ 
00005 */
00006 //
00007 // This software is copyright (C) by the Lawrence Berkeley
00008 // National Laboratory.  Permission is granted to reproduce
00009 // this software for non-commercial purposes provided that
00010 // this notice is left intact.
00011 // 
00012 // It is acknowledged that the U.S. Government has rights to
00013 // this software under Contract DE-AC03-765F00098 between
00014 // the U.S.  Department of Energy and the University of
00015 // California.
00016 //
00017 // This software is provided as a professional and academic
00018 // contribution for joint exchange. Thus it is experimental,
00019 // is provided ``as is'', with no warranties of any kind
00020 // whatsoever, no support, no promise of updates, or printed
00021 // documentation. By using this software, you acknowledge
00022 // that the Lawrence Berkeley National Laboratory and
00023 // Regents of the University of California shall have no
00024 // liability with respect to the infringement of other
00025 // copyrights by any part of this software.
00026 //
00027 
00028 #ifndef CH_REALVECT_H
00029 #define CH_REALVECT_H
00030 
00031 //
00032 // $Id: RealVect.H,v 1.12 2002/07/25 01:06:21 dbs Exp $
00033 //
00034 
00035 #include <cstddef>
00036 #include <cstdlib>
00037 #include <cstring>
00038 #include <iostream>
00039 
00040 #include "SPACE.H"
00041 #include "Misc.H"
00042 #include "REAL.H"
00043 #include <cassert>
00044 
00045 
00046 //
00047 //@Man:
00048 //@Memo: An Real Vector in SpaceDim-Dimensional Space
00049 /*@Doc:
00050 
00051   The class RealVect is an implementation of an Real vector in a
00052   SpaceDim-dimensional space.  
00053   RealVect values are accessed using the operator[] function, as for a normal
00054   C++ array.  In addition, the basic arithmetic operators have been overloaded
00055   to implement scaling and translation operations.
00056 */
00057 
00058 class RealVect
00059 {
00060 public:
00061 
00063 
00065 
00069   RealVect ();
00070 
00072 
00078   RealVect (D_DECL(Real i, Real j, Real k));
00079 
00081 
00085   RealVect (const RealVect& rhs);
00086 
00088 
00092   RealVect& operator= (const RealVect& rhs);
00093 
00095 
00100   Real& operator[] (int i);
00101 
00103 
00107   const Real& operator[] (int i) const;
00108 
00109 
00111 
00113 
00118   bool operator== (const RealVect& p) const;
00119 
00121 
00126   bool operator!= (const RealVect& p) const;
00127 
00129 
00133   RealVect& operator+= (Real s);
00134 
00136 
00140   RealVect& operator+= (const RealVect& p);
00141 
00143 
00148   RealVect& operator-= (Real s);
00149 
00151 
00155   RealVect& operator-= (const RealVect& p);
00156 
00158 
00161   RealVect operator- (const RealVect& p) const;
00162 
00164 
00169   RealVect operator- (Real s) const;
00170  
00172 
00177   RealVect& operator*= (Real s);
00178 
00180 
00184   RealVect& operator*= (const RealVect& p);
00185 
00187 
00191   RealVect operator* (const RealVect& p) const;
00192 
00194 
00199   RealVect operator* (Real s) const;
00200 
00202 
00206   RealVect& operator/= (Real s);
00207 
00209 
00214   RealVect& operator/= (const RealVect& p);
00215 
00217 
00221   RealVect operator/ (const RealVect& p) const;
00222 
00224 
00228   RealVect operator/ (Real s) const;
00229 
00231 
00234   const Real* dataPtr() const;
00235 
00237 
00243   friend RealVect BASISREALV(int dir);
00244 
00246 
00250   static const RealVect Zero;
00251 
00253 
00257   static const RealVect Unit;
00258 
00260 
00265   friend RealVect operator+ (Real            s,
00266                              const RealVect& p);
00267 
00269 
00273   friend RealVect operator- (Real            s,
00274                              const RealVect& p);
00275 
00277 
00282   friend RealVect operator* (Real            s,
00283                              const RealVect& p);
00285 
00290   friend RealVect operator/ (Real            s,
00291                              const RealVect& p);
00292 
00294 
00299   friend RealVect operator+ (const RealVect& s,
00300                              const RealVect& p);
00301 
00303 
00307   friend RealVect operator- (const RealVect& s,
00308                              const RealVect& p);
00309 
00311 
00316   friend RealVect operator* (const RealVect& s,
00317                              const RealVect& p);
00319 
00324   friend RealVect operator/ (const RealVect& s,
00325                              const RealVect& p);
00326 
00327   friend class HDF5Handle;
00328 
00329   static size_t io_offset;
00330 private:
00331 
00332   Real vect[SpaceDim];
00333 
00334 };
00335 
00336 #include "HDF5.H"
00337 #include "SPMD.H"
00338 
00339 template < >
00340 int linearSize(const RealVect& vindex);
00341   
00342 //VolIndex specialization of linearIn
00343 template < >
00344 void linearIn(RealVect& a_outputT, const void* const inBuf);
00345   
00346 //VolIndex specialization of linearOut
00347 template < >
00348 void linearOut(void* const a_outBuf, const RealVect& a_inputT); 
00349 
00350 
00351 #endif /*CH_RealVect_H*/
00352 

Generated on Thu Aug 29 11:05:46 2002 for Chombo&INS by doxygen1.2.16