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

LevelFluxRegister.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 _LEVELFLUXREGISTER_H_
00029 #define _LEVELFLUXREGISTER_H_
00030 #include "REAL.H"
00031 #include "Vector.H"
00032 #include "FArrayBox.H"
00033 #include "IntVectSet.H"
00034 #include "CFStencil.H"
00035 #include "LoHiSide.H"
00036 #include "LevelData.H"
00037 #include "LayoutData.H"
00038 #include "ProblemDomain.H"
00039 
00040 
00042 
00051 class LevelFluxRegister
00052 {
00053 public:
00054 
00056 
00059   LevelFluxRegister();
00060 
00062 
00067   LevelFluxRegister(
00068                     const DisjointBoxLayout& a_dbl,
00069                     const DisjointBoxLayout& a_dblCoarse,
00070                     const Box& a_dProblem,
00071                     int a_nRefine,
00072                     int a_nComp);
00073 
00075 
00080   LevelFluxRegister(
00081                     const DisjointBoxLayout& a_dbl,
00082                     const DisjointBoxLayout& a_dblCoarse,
00083                     const ProblemDomain& a_dProblem,
00084                     int a_nRefine,
00085                     int a_nComp);
00086 
00088   ~LevelFluxRegister();
00089 
00091 
00096   void define(
00097               const DisjointBoxLayout& a_dbl,
00098               const DisjointBoxLayout& a_dblCoarse,
00099               const Box& a_dProblem,
00100               int a_nRefine,
00101               int a_nComp);
00102 
00103 
00105 
00110   void define(
00111               const DisjointBoxLayout& a_dbl,
00112               const DisjointBoxLayout& a_dblCoarse,
00113               const ProblemDomain& a_dProblem,
00114               int a_nRefine,
00115               int a_nComp);
00116 
00118 
00124   void
00125   undefine();
00126 
00128 
00131   void setToZero(); 
00132 
00134 
00142   void incrementCoarse(
00143                        FArrayBox& a_coarseFlux,
00144                        Real a_scale,
00145                        const DataIndex& a_coarseDataIndex,
00146                        const Interval& a_srcInterval,
00147                        const Interval& a_dstInterval,
00148                        int a_dir);
00149 
00151 
00157   void incrementFine(
00158                      FArrayBox& a_fineFlux,
00159                      Real a_scale,
00160                      const DataIndex& a_fineDataIndex,
00161                      const Interval& a_srcInterval,
00162                      const Interval& a_dstInterval,
00163                      int a_dir,
00164                      Side::LoHiSide a_sd);
00165 
00167 
00175   void reflux(
00176               LevelData<FArrayBox>& a_uCoarse,
00177               Real a_scale);
00178 
00180 
00185   void reflux(
00186               LevelData<FArrayBox>& a_uCoarse,
00187               const Interval& a_coarse_interval,
00188               const Interval& a_flux_interval,
00189               Real a_scale);
00190 
00192 
00195   bool isDefined() const;
00196 
00197   //spew the contents of all the registers
00198   void dump();
00199 
00200   //spew the contents of all the low coar registers
00201   void dumpLoCoar(int idir);
00202 
00203   //spew the contents of all the high coar registers
00204   void dumpHiCoar(int idir);
00205 
00206   //spew the contents of all the low fine registers
00207   void dumpLoFine(int idir);
00208 
00209   //spew the contents of all the high fine registers
00210   void dumpHiFine(int idir);
00211 protected:
00212 
00213   static int index(int dir, Side::LoHiSide side);
00214 
00215   //internal use only
00216   void setDefaultValues();
00217 
00218   // both fabCoarse and fabFine have FArrayBoxes that are
00219   // defined in the coarse index space.  fabCoarse 
00220   // can ONLY be indexed into by the DataIndex stored in
00221   // coarToCoarMap.  fabFine is indexed by the same indexing
00222   // used in the fine DisjointBoxLayout.
00223   LevelData<FArrayBox> fabCoarse[SpaceDim*2];
00224   LevelData<FArrayBox> fabFine[SpaceDim*2];
00225   // in an attempt to speed things up in the periodic case especially,
00226   // precompute copiers used to copy from fabFine to coarse-level-indexed
00227   // fabs
00228   Vector<Copier> crseCopiers;
00229 
00230   LayoutData<Vector<IntVectSet> > refluxLocations[SpaceDim*2];
00231   LayoutData<Vector<DataIndex>  > coarToCoarMap[SpaceDim*2];
00232 
00233   bool m_isDefined;
00234 
00236   int m_nComp;
00237 
00239   int m_nRefine;
00240 
00242   ProblemDomain m_domainCoarse;
00243 
00244   DisjointBoxLayout m_gridsFine;
00245   DisjointBoxLayout m_gridsCoar;
00246 private:
00247 
00249   void operator= (const LevelFluxRegister&);
00251   LevelFluxRegister(const LevelFluxRegister&);
00252 };
00253 #endif

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