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

LevelMG.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, Fri, July 16, 1999
00028 
00029 #ifndef _LEVELMG_H_
00030 #define _LEVELMG_H_  
00031 
00032 #include <iostream>
00033 #include <cmath>
00034 #include <cassert>
00035 #include <cstdlib>
00036 
00037 #include "REAL.H"
00038 #include "IntVect.H"
00039 #include "Box.H"
00040 #include "DisjointBoxLayout.H"
00041 #include "FArrayBox.H"
00042 #include "LevelData.H"
00043 #include "CoarseAverage.H"
00044 #include "LevelOp.H"
00045 #include "ProblemDomain.H"
00046 
00048 
00053 class LevelMG 
00054 {
00055 public:
00057   bool isDefined() const;
00058 
00060   LevelMG();
00061 
00063   LevelMG(const DisjointBoxLayout& a_ba,
00064           const DisjointBoxLayout* a_baseBaPtr, 
00065           Real                     a_dxLevel, 
00066           int                      a_refRatio,
00067           const  Box&              a_domain,
00068           int                      a_nCoarserLevels, 
00069           const LevelOp* const     a_opin,
00070           int                      a_ncomp=1);
00071 
00073   LevelMG(const DisjointBoxLayout& a_ba,
00074           const DisjointBoxLayout* a_baseBaPtr, 
00075           Real                     a_dxLevel, 
00076           int                      a_refRatio,
00077           const ProblemDomain&     a_domain,
00078           int                      a_nCoarserLevels, 
00079           const LevelOp* const     a_opin,
00080           int                      a_ncomp=1);
00081 
00083   void define(const DisjointBoxLayout& a_ba,
00084               const DisjointBoxLayout* a_baseBaPtr, 
00085               Real                     a_dxLevel,
00086               int                      a_refRatio,
00087               const Box&               a_domain,
00088               int                      a_nCoarserLevels, 
00089               const LevelOp* const     a_opin,
00090               int                      a_ncomp=1);
00091 
00093   void define(
00094               const DisjointBoxLayout& a_ba,
00096               const DisjointBoxLayout* a_baseBaPtr, 
00098               Real                     a_dxLevel, 
00100               int                      a_refRatio,
00102               const ProblemDomain&     a_domain,
00104               int                      a_nCoarserLevels, 
00106               const LevelOp* const     a_opin,
00108               int                      a_ncomp);
00109 
00111   void define(const LevelMG&       a_level,
00112               int                  a_refCoarse,
00113               const LevelOp* const a_opin);
00114 
00116   LevelMG(const LevelMG& a_level,
00117           int            a_refCoarse,
00118           const LevelOp* a_opin);
00119 
00121   ~LevelMG();
00122 
00124 
00131   void mgRelax(LevelData<FArrayBox> & a_soln,
00132                const LevelData<FArrayBox> & a_rhs,
00133                bool bottomsolveflag);
00134 
00136   void setNumBottomGSRB(int a_numBottomGSRB)
00137   {
00138     m_numBottomGSRB = a_numBottomGSRB;
00139   }
00140 
00142   void setNumSmoothUp(int a_numSmoothUp);
00143 
00144   
00146   void setNumSmoothDown(int a_numSmoothDown);
00147 
00149   LevelOp* levelOpPtr();
00150 
00152   LevelMG* lCoarsePtr();
00153 
00155   void setConvergenceMetric(Real a_metric, int a_comp);
00156 
00157 protected:
00158   void setDefaultValues();
00159   void clearMemory();
00160 
00161   bool m_isDefined;
00162 
00163   //
00164   LevelData<FArrayBox>  m_resid;
00165 
00166   //
00167   LevelData<FArrayBox>  m_crseResid;
00168 
00169   //
00170   LevelData<FArrayBox>  m_crseCorr;
00171 
00172   //
00173   DisjointBoxLayout m_ba;
00174 
00175   //
00176   DisjointBoxLayout m_baCoarsened;
00177 
00178   //
00179   const DisjointBoxLayout* m_baseBaPtr;
00180 
00181   //
00182   Real m_dxLevel;
00183 
00184   //
00185   ProblemDomain m_domain;
00186 
00187   //
00188   int m_nCoarserLevels;
00189 
00190   //
00191   LevelMG* m_lCoarsePtr;
00192 
00193   //
00194   LevelOp* m_levelopPtr;
00195 
00196   //
00197   int m_numBottomGSRB;
00198 
00199   //
00200   int m_numSmoothUp;
00201 
00202   //
00203   int m_numSmoothDown;
00204 
00205   //
00206   int m_refToCoar;
00207 
00208   //
00209   CoarseAverage m_averageOp;
00210 
00211 private:
00217   void crseCorrect(LevelData<FArrayBox>&       a_fine,
00218                    const LevelData<FArrayBox>& a_crse,
00219                    int                         a_refRat);
00220 
00221   void operator=(const LevelMG& a_levmgin){};
00222   LevelMG(const LevelMG& a_levmgin) {};
00223 };
00224 
00225 #endif

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