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

EBFluxRegister.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 _EBLEVELFLUXREGISTER_H_
00029 #define _EBLEVELFLUXREGISTER_H_
00030 #include "REAL.H"
00031 #include "Vector.H"
00032 #include "EBCellFAB.H"
00033 #include "EBFaceFAB.H"
00034 #include "EBISLayout.H"
00035 #include "EBISBox.H"
00036 #include "IntVectSet.H"
00037 #include "CFStencil.H"
00038 #include "LoHiSide.H"
00039 #include "LevelData.H"
00040 #include "LayoutData.H"
00041 
00042 class EBCoarToFineRedist;
00043 class EBCoarToCoarRedist;
00044 
00046 
00050 class EBFluxRegister
00051 {
00052 public:
00053 
00055 
00058   EBFluxRegister();
00059 
00061 
00065   EBFluxRegister(const DisjointBoxLayout& a_dblFine,
00066                  const DisjointBoxLayout& a_dblCoar,
00067                  const EBISLayout& ebislFine,
00068                  const EBISLayout& ebislCoar,
00069                  const Box& domainCoar,
00070                  const int& nref,
00071                  const int& nvar);
00072 
00074   ~EBFluxRegister();
00075 
00077 
00080   void 
00081   define(const DisjointBoxLayout& a_dblFine,
00082          const DisjointBoxLayout& a_dblCoar,
00083          const EBISLayout& ebislFine,
00084          const EBISLayout& ebislCoar,
00085          const Box& domainCoar,
00086          const int& nref,
00087          const int& nvar);
00088 
00089 
00091 
00094   void 
00095   setToZero(); 
00096 
00098 
00106   void 
00107   incrementCoarseRegular(const EBFaceFAB& a_coarseFlux,
00108                          const Real& a_scale,
00109                          const DataIndex& a_coarseDataIndex,
00110                          const Interval& a_variables,
00111                          const int& a_dir);
00112 
00114 
00122   void 
00123   incrementCoarseIrregular(const BaseIFFAB<Real>& a_coarseFlux,
00124                            const Real& a_scale,
00125                            const DataIndex& a_coarseDataIndex,
00126                            const Interval& a_variables,
00127                            const int& a_dir);
00128 
00130 
00136   void 
00137   incrementFineRegular(const EBFaceFAB& a_fineFlux,
00138                        const Real& a_scale,
00139                        const DataIndex& a_fineDataIndex,
00140                        const Interval& a_variables,
00141                        const int& a_dir,
00142                        const Side::LoHiSide& a_sd);
00143 
00144 
00146 
00152   void 
00153   incrementFineIrregular(const BaseIFFAB<Real>& a_fineFlux,
00154                          const Real& a_scale,
00155                          const DataIndex& a_fineDataIndex,
00156                          const Interval& a_variables,
00157                          const int& a_dir,
00158                          const Side::LoHiSide& a_sd);
00159 
00161 
00166   void reflux(LevelData<EBCellFAB>& a_uCoarse,
00167               const Interval& a_variables,
00168               const Real& a_scale);
00169 
00171 
00175   void incrementRedistRegister(EBCoarToFineRedist& a_register,
00176                                const Interval& a_variables,
00177                                const Real& a_scale);
00178 
00180 
00184   void incrementRedistRegister(EBCoarToCoarRedist& a_register,
00185                                const Interval& a_variables,
00186                                const Real& a_scale);
00187 
00189 
00193   void incrementDensityArray(LevelData<EBCellFAB>& a_coarMass,
00194                              const Interval& a_variables,
00195                              const Real& a_scale);
00196   
00198   bool isDefined() const;
00199 
00201   void dumpCoar(const int& a_idir,
00202                 const Side::LoHiSide& a_sd);
00204   void dumpFine(const int& a_idir,
00205                 const Side::LoHiSide& a_sd);
00206   
00208   void dumpBIVF(const BaseIVFAB<Real>& reg,
00209                 const EBISBox& a_ebisBox);
00210 protected:
00211 
00212   static int index(int a_dir, Side::LoHiSide a_side);
00213 
00214   //internal use only
00215   void setDefaultValues();
00216 
00217   // both fabCoarse and fabFine have fabs that are
00218   // defined in the coarse index space.  fabCoarse 
00219   // can ONLY be indexed into by the DataIndex stored in
00220   // coarToCoarMap.  fabFine is indexed by the same indexing
00221   // used in the fine DisjointBoxLayout.
00222 
00223   //input fine grid
00224   DisjointBoxLayout    m_gridsFine;
00225   //input coarse grid
00226   DisjointBoxLayout    m_gridsCoar;
00227 
00228   //grids for fine buffers
00229   DisjointBoxLayout m_bufGridsFine[SpaceDim*2];
00230   //grids for coarse buffers
00231   DisjointBoxLayout m_bufGridsCoar[SpaceDim*2];
00232 
00233   //fine buffers
00234   LevelData<BaseIVFAB<Real> > m_regsCoar[SpaceDim*2];
00235   //coarse buffers
00236   LevelData<BaseIVFAB<Real> > m_regsFine[SpaceDim*2];
00237 
00238   //scratch space for refluxing
00239   LevelData<BaseIVFAB<Real> > m_scratchc[SpaceDim*2];
00240 
00241   //sets for fine buffers
00242   LayoutData<IntVectSet> m_cfivsFine[SpaceDim*2];
00243   //sets for coarse buffers
00244   LayoutData<IntVectSet> m_cfivsCoar[SpaceDim*2];
00245 
00246   //ebisl of input fine grid
00247   EBISLayout m_ebislFine;
00248   //ebisl of input coar grid
00249   EBISLayout m_ebislCoar;
00250 
00251   //ebisl of coarse buffers 
00252   EBISLayout m_ebislBufCoar[2*SpaceDim];
00253   //ebisl of fine buffers 
00254   EBISLayout m_ebislBufFine[2*SpaceDim];
00255 
00256   //map from input coarse grid to coarse buffers
00257   LayoutData<Vector<DataIndex>  > m_coarIndexMap[SpaceDim*2];
00258 
00259   bool m_isDefined;
00260   int m_nComp;
00261   int m_refRat;
00262   Box m_domainCoar;
00263 
00264 private:
00265   //for all the usual reasons,
00266   //there is no copy constructor for this class
00267   //and there is no operator= for this class
00268   //(there is no rule six).
00269   void operator= (const EBFluxRegister&)
00270   {
00271     MayDay::Error("invalid operator");
00272   }
00273   EBFluxRegister(const EBFluxRegister&)
00274   {
00275     MayDay::Error("invalid operator");
00276   }
00277 };
00278 #endif

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