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

FluxBox.H

Go to the documentation of this file.
00001 /* _______              __
00002   / ___/ /  ___  __ _  / /  ___
00003  / /__/ _ \/ _ \/  ' \/ _ \/ _ \
00004  \___/_//_/\___/_/_/_/_.__/\___/ 
00005 */
00006 
00007 // FluxBox.H
00008 
00009 //
00010 // This software is copyright (C) by the Lawrence Berkeley
00011 // National Laboratory.  Permission is granted to reproduce
00012 // this software for non-commercial purposes provided that
00013 // this notice is left intact.
00014 // 
00015 // It is acknowledged that the U.S. Government has rights to
00016 // this software under Contract DE-AC03-765F00098 between
00017 // the U.S.  Department of Energy and the University of
00018 // California.
00019 //
00020 // This software is provided as a professional and academic
00021 // contribution for joint exchange. Thus it is experimental,
00022 // is provided ``as is'', with no warranties of any kind
00023 // whatsoever, no support, no promise of updates, or printed
00024 // documentation. By using this software, you acknowledge
00025 // that the Lawrence Berkeley National Laboratory and
00026 // Regents of the University of California shall have no
00027 // liability with respect to the infringement of other
00028 // copyrights by any part of this software.
00029 //
00030 // Dan Martin, Fri, Jan 14, 2000
00031 
00032 #ifndef _FluxBox_H_
00033 #define _FluxBox_H_
00034 
00035 #include "Box.H"
00036 #include "Vector.H"
00037 #include "FArrayBox.H"
00038 
00040 
00042 class FluxBox
00043 {
00044 
00045 public:
00047   FluxBox();
00048 
00050   FluxBox(const Box& bx, int n=1);
00051 
00053   ~FluxBox();
00054 
00056   void resize(const Box& bx, int n=1);
00057 
00059   void define(const Box& bx, int n=1);
00060 
00062   void clear();
00063 
00064   //  access functions
00065 
00067   int nComp() const;
00068 
00070   const Box& box() const;
00071 
00073   FArrayBox& getFlux(const int dir);
00074 
00076   const FArrayBox& getFlux(const int dir) const;
00077 
00079   FArrayBox& operator[] (const int dir);
00080 
00082   const FArrayBox& operator[] (const int dir) const;
00083 
00084 
00085   //  data modification functions
00086 
00088   void setVal(const Real val);
00089 
00091   void setVal(const Real val, const int dir);
00092 
00094   void setVal(const Real val, const int dir, const int startComp,
00095               const int nComp);
00096 
00098   void setVal(const Real val, const Box& bx);
00099 
00101 
00104   void setVal(const Real val, const Box& bx, const int dir, 
00105               const int startComp, const int nComp);
00106 
00108   void copy(const FluxBox& src);
00109 
00111   void copy(const FluxBox& src, const int srcComp, 
00112             const int destComp, const int numComp);
00113 
00115   void copy(const FluxBox& src, const int dir, const int srcComp,
00116             const int destComp, const int numComp);
00117 
00119 
00124   void copy(const Box& R, const Interval& Cdest,  const FluxBox& src,
00125             const Interval& Csrc);
00126 
00128 
00144   void copy (const Box&        srcbox,
00145              const Interval&   srccomps,
00146              const Box&        destbox,
00147              const FluxBox&    src,
00148              const Interval&    destcomps);
00149 
00150   
00151 
00153   FluxBox& shift (const IntVect& v);
00154 
00155 
00156   //  Linearization Functions
00157   
00159 
00164   int size(const Box& bx, const Interval& comps) const;
00165 
00166 
00168 
00173   void linearOut(void*buf, const Box& R, const Interval& comps) const;
00174   
00176 
00179   void linearIn(void*buf, const Box& R, const Interval& comps);
00180 
00182   static int preAllocatable() {return 0;}
00183 
00184   
00185 
00186 protected:
00190   Box m_bx;
00191 
00195   int m_nvar;
00196 
00200   Vector<FArrayBox*> m_fluxes;
00201 
00202 
00203 private:
00204   // these are disallowed
00205   
00207   FluxBox (const FluxBox&);
00209   FluxBox& operator = (const FluxBox&);
00210 
00211 };
00212 
00213   
00214 
00215 #endif
00216 
00217 

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