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.23 2004/04/06 22:25:01 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 #include "IntVect.H"
00045 
00047 
00055 class RealVect
00056 {
00057 public:
00058 
00063 
00065 
00068   RealVect ();
00069 
00071 
00076   RealVect (D_DECL(Real i, Real j, Real k));
00077 
00079 
00082   RealVect (const RealVect& rhs);
00083 
00085 
00089   RealVect (const IntVect & iv){
00090     for(int d=0 ; d<SpaceDim ; ++d ){ vect[d] = (Real)iv[d] ; }
00091   }
00093 
00096   RealVect& operator= (const RealVect& rhs);
00097 
00099 
00103   Real& operator[] (int i);
00104 
00106 
00109   const Real& operator[] (int i) const;
00110 
00111 
00118 
00120 
00124   bool operator== (const RealVect& p) const;
00125 
00127 
00131   bool operator!= (const RealVect& p) const;
00132 
00139 
00141 
00144   RealVect& operator+= (Real s);
00145 
00147 
00150   RealVect& operator+= (const RealVect& p);
00151 
00153 
00157   RealVect& operator-= (Real s);
00158 
00160 
00163   RealVect& operator-= (const RealVect& p);
00164 
00166 
00170   RealVect operator- (Real s) const;
00171  
00173 
00176   RealVect& operator*= (Real s);
00177 
00179 
00182   RealVect& operator*= (const RealVect& p);
00183 
00185 
00188   RealVect operator* (const RealVect& p) const;
00189 
00191 
00195   RealVect operator* (Real s) const;
00196 
00198 
00201   RealVect& operator/= (Real s);
00202 
00204 
00207   RealVect& operator/= (const RealVect& p);
00208 
00209 //XXX  ///
00210 //XXX  /**
00211 //XXX     Returns component-wise quotient of this RealVect by argument.
00212 //XXX  */
00213 //XXX  RealVect operator/ (const RealVect& p) const;
00214 
00216 
00220   RealVect operator/ (Real s) const;
00221 
00228 
00230 
00233   const Real* dataPtr() const;
00234 
00236 
00239   Real* dataPtr() ;
00240 
00247 
00249 
00260   friend RealVect BASISREALV(int dir);
00261 
00263 
00266   static const RealVect Zero;
00267 
00269 
00272   static const RealVect Unit;
00273 
00280 
00282 
00286   friend RealVect operator+ (Real            s,
00287                              const RealVect& p);
00288 
00290 
00293   friend RealVect operator- (Real            s,
00294                              const RealVect& p);
00295 
00297 
00301   friend RealVect operator* (Real            s,
00302                              const RealVect& p);
00304 
00308   friend RealVect operator/ (Real            s,
00309                              const RealVect& p);
00310 
00312 
00315   friend RealVect operator+ (const RealVect& s,
00316                              const RealVect& p);
00317 
00319 
00322   friend RealVect operator- (const RealVect& s,
00323                              const RealVect& p);
00324 
00326 
00329   friend RealVect operator* (const RealVect& s,
00330                              const RealVect& p);
00332 
00335   friend RealVect operator/ (const RealVect& s,
00336                              const RealVect& p);
00337 
00340 
00341 
00344   friend std::ostream& operator<< (std::ostream& ostr,
00345                                    const RealVect& p);
00346 
00347   friend class HDF5Handle;
00348 
00349   static size_t io_offset;
00350 private:
00351 
00355   Real vect[SpaceDim];
00356 
00357 };
00358 
00359 extern RealVect BASISREALV(int idir);
00360 /*
00361 #include "CH_HDF5.H"
00362 #include "SPMD.H"
00363 
00364 template < >
00365 int linearSize(const RealVect& vindex);
00366   
00367 //VolIndex specialization of linearIn
00368 template < >
00369 void linearIn(RealVect& a_outputT, const void* const inBuf);
00370   
00371 //VolIndex specialization of linearOut
00372 template < >
00373 void linearOut(void* const a_outBuf, const RealVect& a_inputT); 
00374 
00375 */
00376 
00377 #endif /*CH_RealVect_H*/
00378 

Generated on Wed Jun 2 13:53:35 2004 for Chombo&INSwithParticles by doxygen 1.3.2