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

FArrayBox.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_FARRAYBOX_H
00029 #define CH_FARRAYBOX_H
00030 
00031 //
00032 // $Id: FArrayBox.H,v 1.9 2003/11/12 22:07:58 graves Exp $
00033 //
00034 
00035 #ifndef WRAPPER
00036 #include <iostream>
00037 
00038 //#include <Pointers.H>
00039 #include "Box.H"
00040 #include "BaseFab.H"
00041 #endif
00042 
00043 #include "REAL.H"
00044 #include "SPACE.H"
00045 
00046 
00047 
00049 
00066 class FArrayBox 
00067   : public BaseFab<Real>
00068 {
00069 
00070 
00071 public:
00072 
00074 
00077   FArrayBox ();
00078 
00084   FArrayBox (const Box& b, int ncomp, Real* alias=NULL);
00085   void define(const Box& b, int ncomp, Real* alias = NULL) {resize(b, ncomp, alias);}
00086 
00088 
00091   FArrayBox(const Interval& a_comps, FArrayBox& a_original)
00092     : BaseFab<Real>(a_comps, a_original) { }
00093 
00095   void define(const Interval& a_comps, FArrayBox& a_original)
00096   {
00097     BaseFab<Real>::define(a_comps, a_original);
00098   }
00099 
00101 
00104   explicit FArrayBox (std::istream& is);
00105 
00107 
00110   virtual ~FArrayBox ();
00111 
00113 
00119   virtual Real norm (int p=2,
00120                      int comp=0,
00121                      int numcomp=1) const;
00122 
00124 
00129   virtual Real norm (const Box& subbox,
00130                      int        p=2,
00131                      int        comp=0,
00132                      int        numcomp=1) const;
00133 
00135 
00140   virtual Real sumPow(const Box& subbox,
00141                       int        p=2,
00142                       int        comp=0,
00143                       int        numcomp=1) const;
00144 
00146 
00150   Real dotProduct(const FArrayBox& fab2) const;
00151 
00152 
00154 
00157   Real min (int comp = 0) const;
00158 
00160 
00165   Real min (const Box& subbox,
00166             int        comp = 0) const;
00167 
00169 
00172   Real max (int comp = 0) const;
00173 
00175 
00180   Real max (const Box& subbox,
00181             int        comp = 0) const;
00182 
00184 
00187   IntVect minIndex (int comp = 0) const;
00188 
00190 
00193   IntVect minIndex (const Box& subbox,
00194                     int        comp = 0) const;
00196 
00199   IntVect maxIndex (int comp = 0) const;
00200 
00202 
00206   IntVect maxIndex (const Box& subbox,
00207                     int        comp = 0) const;
00208 
00210 
00216   int maskLT (BaseFab<int>& mask,
00217               Real             val,
00218               int           comp = 0) const;
00219 
00221 
00228   int maskLE (BaseFab<int>& mask,
00229               Real             val,
00230               int           comp = 0) const;
00232 
00238   int maskEQ (BaseFab<int>& mask,
00239               Real             val,
00240               int           comp = 0) const;
00242 
00248   int maskGT (BaseFab<int>& mask,
00249               Real             val,
00250               int           comp = 0) const;
00251 
00253 
00260   int maskGE (BaseFab<int>& mask,
00261               Real             val,
00262               int           comp = 0) const;
00263 
00264 
00266 
00270   void abs ();
00271 
00273 
00278   void abs (int comp,
00279             int numcomp=1);
00280 
00282 
00287   void abs (const Box& subbox,
00288             int        comp = 0,
00289             int        numcomp=1);
00290 
00292 
00295   Real sum (int comp,
00296             int numcomp = 1) const;
00297 
00299 
00303   Real sum (const Box& subbox,
00304             int        comp,
00305             int        numcomp = 1) const;
00306 
00308 
00312   FArrayBox& invert (Real v);
00314 
00319   FArrayBox& invert (Real          v,
00320                      const Box& subbox,
00321                      int        comp=0,
00322                      int        numcomp=1);
00324 
00329   FArrayBox& invert (Real   v,
00330                      int comp,
00331                      int numcomp=1);
00332 
00333 
00334 
00336 
00341   FArrayBox& negate (const Box& subbox,
00342                      int        comp=0,
00343                      int        numcomp=1);
00345 
00350   FArrayBox& negate (int comp,
00351                      int numcomp=1);
00353 
00358   FArrayBox& negate ();
00359 
00361 
00366   FArrayBox& plus (Real          r,
00367                    const Box& b,
00368                    int        comp=0,
00369                    int        numcomp=1);
00370 
00372 
00377   FArrayBox& plus (Real   r,
00378                    int comp,
00379                    int numcomp=1);
00380 
00381 
00383 
00387   FArrayBox& operator+= (Real r);
00388 
00390 
00396   FArrayBox& operator+= (const FArrayBox& f);
00397 
00399 
00405   FArrayBox& plus (const FArrayBox& src);
00406 
00408 
00412   FArrayBox& plus (Real r);
00413   FArrayBox& plus_real (Real r) {return this->plus(r);}
00414 
00416 
00422   FArrayBox& plus (const FArrayBox& src, const Real& scale);
00423 
00425 
00430   FArrayBox& plus (const FArrayBox& src, const Real& scale, 
00431                    int                srccomp,
00432                    int                destcomp,
00433                    int                numcomp=1);
00434 
00435 
00437 
00444   FArrayBox& plus (const FArrayBox& src,
00445                    int                srccomp,
00446                    int                destcomp,
00447                    int                numcomp=1);
00448 
00449 
00451 
00459   FArrayBox& plus (const FArrayBox& src,
00460                    const Box&         subbox,
00461                    int                srccomp,
00462                    int                destcomp,
00463                    int                numcomp=1);
00464 
00465 
00467 
00479   FArrayBox& plus (const FArrayBox& src,
00480                    const Box&         srcbox,
00481                    const Box&         destbox,
00482                    int                srccomp,
00483                    int                destcomp,
00484                    int                numcomp=1);
00485 
00487   FArrayBox& plus (const FArrayBox& src,
00488                    const Box&         srcbox,
00489                    const Box&         destbox,
00490                    const Real&        scale,
00491                    int                srccomp,
00492                    int                destcomp,
00493                    int                numcomp=1);
00494 
00496 
00500   FArrayBox& operator-= (Real r);
00501 
00503 
00509   FArrayBox& operator-= (const FArrayBox& f);
00510 
00512 
00518   FArrayBox& minus (const FArrayBox& src);
00519 
00527   FArrayBox& minus (const FArrayBox& src,
00528                     int                srccomp,
00529                     int                destcomp,
00530                     int                numcomp=1);
00531 
00540   FArrayBox& minus (const FArrayBox& src,
00541                     const Box&         subbox,
00542                     int                srccomp,
00543                     int                destcomp,
00544                     int                numcomp=1);
00545 
00547 
00559   FArrayBox& minus (const FArrayBox& src,
00560                     const Box&         srcbox,
00561                     const Box&         destbox,
00562                     int                srccomp,
00563                     int                destcomp,
00564                     int                numcomp=1);
00565 
00567 
00570   FArrayBox& operator*= (Real r);
00571 
00573 
00576   FArrayBox& mult (Real r);
00577 
00579 
00584   FArrayBox& mult (Real   r,
00585                    int comp,
00586                    int numcomp=1);
00587 
00589 
00594   FArrayBox& mult (Real          r,
00595                    const Box& b,
00596                    int        comp=0,
00597                    int        numcomp=1);
00598 
00600 
00606   FArrayBox& operator*= (const FArrayBox& f);
00607 
00609 
00615   FArrayBox& mult (const FArrayBox& src);
00616 
00618 
00625   FArrayBox& mult (const FArrayBox& src,
00626                    int                srccomp,
00627                    int                destcomp,
00628                    int                numcomp=1);
00629 
00631 
00639   FArrayBox& mult (const FArrayBox& src,
00640                    const Box&         subbox,
00641                    int                srccomp,
00642                    int                destcomp,
00643                    int                numcomp=1);
00644 
00646 
00658   FArrayBox& mult (const FArrayBox& src,
00659                    const Box&         srcbox,
00660                    const Box&         destbox,
00661                    int                srccomp,
00662                    int                destcomp,
00663                    int                numcomp=1);
00664 
00666 
00669   FArrayBox& operator/= (Real r);
00670 
00672 
00675   FArrayBox& divide (Real r);
00676 
00678 
00682   FArrayBox& divide (Real   r,
00683                      int comp,
00684                      int numcomp=1);
00685 
00687 
00692   FArrayBox& divide (Real          r,
00693                      const Box& b,
00694                      int        comp=0,
00695                      int        numcomp=1);
00696 
00698 
00704   FArrayBox& operator/= (const FArrayBox& src);
00705 
00707 
00713   FArrayBox& divide (const FArrayBox& src);
00714 
00716 
00723   FArrayBox& divide (const FArrayBox& src,
00724                      int                srccomp,
00725                      int                destcomp,
00726                      int                numcomp=1);
00727 
00729 
00737   FArrayBox& divide (const FArrayBox& src,
00738                      const Box&         subbox,
00739                      int                srccomp,
00740                      int                destcomp,
00741                      int                numcomp=1);
00742 
00744 
00756   FArrayBox& divide (const FArrayBox& src,
00757                      const Box&         srcbox,
00758                      const Box&         destbox,
00759                      int                srccomp,
00760                      int                destcomp,
00761                      int                numcomp=1);
00762 
00764   Real get(const IntVect& iv, int comp) const { return this->operator()(iv, comp);}
00765 
00767   void set(const IntVect& iv, int comp, Real val) {  this->operator()(iv, comp) = val;}
00768 
00769 protected:
00770 
00771   virtual void performCopy (const BaseFab<Real>& src,
00772                             const Box&        srcbox,
00773                             int               srccomp,
00774                             const Box&        destbox,
00775                             int               destcomp,
00776                             int               numcomp);
00777 
00778 private:
00779   //
00780   // These are disallowed.
00781   //
00782   FArrayBox (const FArrayBox&);
00783   FArrayBox& operator= (const FArrayBox&);
00784 };
00785 
00786 
00787 #endif /*CH_FARRAYBOX_H*/

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