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

AMRLevelMG.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 // DTGraves, Tues, July 6, 1999
00028 
00029 #ifndef _AMRLEVELMG_H_
00030 #define _AMRLEVELMG_H_
00031 
00032 #include "REAL.H"
00033 #include "IntVect.H"
00034 #include "Box.H"
00035 #include "FArrayBox.H"
00036 #include "LevelData.H"
00037 #include "LevelFluxRegister.H"
00038 #include "LevelMG.H"
00039 #include "MGInterp.H"
00040 #include "Copier.H"
00041 
00042 // forward declaration of AMRSolver
00043 class AMRSolver;
00044 
00046 
00052 class AMRLevelMG
00053 {
00054 public:
00055   friend class AMRSolver;
00056 
00058   AMRLevelMG();
00059 
00061   ~AMRLevelMG();
00062 
00064   AMRLevelMG(const AMRSolver* const a_parent,
00065              int                    a_level,
00066              const LevelOp* const   a_opin,
00067              int                    a_ncomp=1);
00068 
00070 
00074   void define(const AMRSolver* const a_parent,
00075               int                    a_level,
00076               const LevelOp* const   a_opin,
00077               int                    a_ncomp=1);
00078 
00080   void setNumSmoothUp(int a_numSmoothUp);
00081 
00083   void setNumSmoothDown(int a_numSmoothDown);
00084 
00086 
00092   void applyAMROperator(Vector<LevelData<FArrayBox> *>& a_phiLevel,
00093                         LevelData<FArrayBox>&           a_Lofphi);
00094 
00096 
00100   void applyAMROperatorHphys(Vector<LevelData<FArrayBox> *>& a_phiLevel,
00101                              LevelData<FArrayBox>&           a_LofPhi);
00102 
00104   void computeAMRResidual(Vector<LevelData<FArrayBox> *>&       a_phiLevel,
00105                           const Vector<LevelData<FArrayBox> *>& a_rhsLevel);
00106 
00108 
00112   void computeAMRResidualHphys(Vector<LevelData<FArrayBox> *>&       a_phiLevel,
00113                                const Vector<LevelData<FArrayBox> *>& a_rhsLevel);
00114 
00116   void computeAMRResidual(LevelData<FArrayBox>&                 a_resid,
00117                           Vector<LevelData<FArrayBox>* >&       a_phiLevel,
00118                           const Vector<LevelData<FArrayBox>* >& a_rhsLevel);
00119 
00121   void upSweep(Vector<LevelData<FArrayBox> *>&       a_phiLevel,
00122                const Vector<LevelData<FArrayBox> *>& a_rhsLevel);
00123 
00125   void downSweep(Vector<LevelData<FArrayBox> *>&       a_phiLevel,
00126                  const Vector<LevelData<FArrayBox> *>& a_rhsLevel);
00127 
00129   Vector<Real> computeResidualNorm(int normType) const;
00130 
00132   LevelOp* levelOpPtr() const;
00133 
00135   bool isDefined() const;
00136 
00138   Vector<Real> computeNorm(const LevelData<FArrayBox>& a_mfinput,
00139                            int                         a_normType) const;
00140 
00142 
00147   void setConvergenceMetric(Real a_metric, int a_comp);
00148 
00149 protected:
00151 
00154   void smooth(LevelData<FArrayBox>&       a_soln,
00155               const LevelData<FArrayBox>& a_rhs);
00156 
00158 
00161   void clearMemory();
00162 
00164 
00167   void setDefaultValues();
00168 
00170 
00177   void reflux(Vector<LevelData<FArrayBox> *>& a_phiLevel,
00178               LevelData<FArrayBox>&           a_Lofphi);
00179 
00181 
00184   void initFRCoarse(Vector<LevelData<FArrayBox> *>& a_phiLevel);
00185 
00187 
00190   void incrementFRFine(Vector<LevelData<FArrayBox> *>& a_phiLevel);
00191 
00193 
00196   const AMRSolver* m_parent;
00197 
00199 
00202   LevelMG m_levelMG;
00203 
00205 
00208   MGInterp m_mginterp;
00209 
00211 
00214   LevelFluxRegister m_levfluxreg;
00215 
00217 
00220   bool m_isDefined;
00221 
00223 
00226   DisjointBoxLayout m_coarsenedGrids;
00227 
00229 
00232   LevelData<FArrayBox> m_resid;
00233 
00235 
00238   LevelData<FArrayBox> m_corr;
00239 
00241 
00244   LevelData<FArrayBox> m_dcorr;
00245 
00247 
00250   LevelData<FArrayBox> m_lofPhi;
00251 
00253 
00256   LevelData<FArrayBox> m_phiSave;
00257 
00259 
00262   LevelData<FArrayBox> m_resC;
00263 
00265 
00269   Copier m_residualCopier;
00270 
00275   Copier m_fineExchangeCopier;
00276 
00278 
00281   int m_level;
00282 
00284 
00288   LevelOp* m_levelopPtr;
00289 
00293   CoarseAverage m_averageOp;
00294 
00298   bool m_arrayViewVerbose;
00299 
00300 private:
00301   void  setArrayViewVerbose(bool a_verbosity);
00302   AMRLevelMG& operator = (const AMRLevelMG&);
00303   AMRLevelMG(const AMRLevelMG&);
00304 };
00305 
00306 #endif

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