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

BaseEBCellFAB.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 //  ANAG, LBNL
00028 
00029 #ifndef _BaseEBCellFAB_H_
00030 #define _BaseEBCellFAB_H_
00031 
00032 #include <cmath>
00033 #include <cstdlib>
00034 #include "Vector.H"
00035 #include "EBISBox.H"
00036 #include "BaseIVFAB.H"
00037 #include "IntVectSet.H"
00038 #include "BaseFab.H"
00039 
00040 
00042 
00054 template <class T>
00055 class BaseEBCellFAB
00056 {
00057 public:
00059   BaseEBCellFAB();
00060 
00062   BaseEBCellFAB(const EBISBox& a_ebisBox, const Box& a_region, int a_nVar);
00063 
00065   void  define(const EBISBox& a_ebisBox, const Box& a_region, int a_nVar);
00066 
00068   virtual ~BaseEBCellFAB();
00069 
00070 
00072   void clear();
00073 
00075   void 
00076   setVal(T value);
00077 
00079   bool isDefined() const;
00080 
00081 
00083   int nComp() const ;
00084 
00086   const Box& getRegion() const ;
00087 
00089   const Box& box() const ;
00090 
00092   const IntVectSet& getMultiCells() const ;
00093 
00095   const BaseIVFAB<T>& getMultiValuedFAB() const;
00096 
00098   BaseIVFAB<T>& getMultiValuedFAB() ;
00099 
00101   const BaseFab<T>& getSingleValuedFAB() const;
00102 
00104   BaseFab<T>& getSingleValuedFAB();
00105 
00107   const T& operator() (const VolIndex& a_ndin,int  a_nVarLoc) const;
00108 
00110   T& operator() (const VolIndex& a_ndin,int  a_nVarLoc);
00111 
00112 
00114   void copy(const Box& RegionFrom, 
00115             const Interval& destInt, 
00116             const Box& RegionTo,
00117             const BaseEBCellFAB<T>& source, 
00118             const Interval& srcInt);
00119 
00121 
00124   static int preAllocatable() 
00125   {
00126     return 1; // symmetric messaging 
00127   } 
00128 
00130   int size(const Box& R, const Interval& comps) const ;
00131 
00133   int regSize(const Box& R, const Interval& comps) const ;
00134 
00136   void linearOut(void* buf, const Box& R, const Interval& comps) const ;
00137 
00139   void regLinearOut(void* buf, const Box& R, const Interval& comps) const ;
00140 
00142   void linearIn(void* buf, const Box& R, const Interval& comps);
00143 
00145   void regLinearIn(void* buf, const Box& R, const Interval& comps);
00146 
00147 
00149   BaseEBCellFAB(const Box& a_region, int a_nVar)
00150   {
00151     MayDay::Error("invalid constructor called for baseebcellfab");
00152   }
00153 
00155   const EBISBox& getEBISBox() const;
00156 
00158   void
00159   setCoveredCellVal(const T& a_val,
00160                     const int& a_comp);
00161 
00162 protected:
00163 
00165   BaseIVFAB<T> m_irrFAB;
00166 
00168   BaseFab<T> m_regFAB;
00169 
00170   EBISBox m_ebisBox;
00171   //number of data values at each VolIndex
00172   int m_nComp;
00173 
00175   Box m_region;
00176 
00178   BaseFab<bool> m_isMultiValued;
00179 
00181   bool m_isDefined;
00182 
00183 protected:
00184   void
00185   setDefaultValues();
00186 
00187 private:
00188   //disallowed for perfomance reasons
00189   void operator= (const BaseEBCellFAB<T>& ebcin)
00190   {
00191     MayDay::Error("operator= for baseebcellfab undefined");
00192   }
00193   BaseEBCellFAB (const BaseEBCellFAB<T>& ebcin)
00194   {
00195     MayDay::Error("copy constructor for baseebcellfab undefined");
00196   }
00197 };
00198 
00199 #include "BaseEBCellFABI.H"
00200 
00201 #endif

Generated on Wed Apr 16 14:31:03 2003 for EBChombo by doxygen1.2.16