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 <assert.h>
00035 #include <cstdlib>
00036 #include "REAL.H"
00037 #include "IntVect.H"
00038 #include "Box.H"
00039 #include "DisjointBoxLayout.H"
00040 #include "FArrayBox.H"
00041 #include "LevelData.H"
00042 #include "CoarseAverage.H"
00043 #include "LevelOp.H"
00044 #include "ProblemDomain.H"
00045 
00047 
00052 class LevelMG 
00053 {
00054 public:
00055 
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, int a_refRatio,
00086               const Box& a_domain,
00087               int a_nCoarserLevels, 
00088               const LevelOp* const a_opin,
00089               int a_ncomp=1);
00090 
00091 
00093   void define(const DisjointBoxLayout& a_ba,
00094               const DisjointBoxLayout* a_baseBaPtr, 
00095               Real a_dxLevel, int a_refRatio,
00096               const ProblemDomain& a_domain,
00097               int a_nCoarserLevels, 
00098               const LevelOp* const a_opin,
00099               int a_ncomp);
00100 
00102   void define(
00103               const LevelMG& L,
00104               int refCoarse,
00105               const LevelOp* const opin_a
00106               );
00107 
00109   LevelMG(
00110           const LevelMG& L,
00111           int refCoarse,
00112           const LevelOp* opin_a
00113           );
00114 
00115 
00117   ~LevelMG();
00118 
00120   void clear();
00121 
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   {m_numBottomGSRB = a_numBottomGSRB;}
00138 
00140   void setnumSmoothUp(int a_numSmoothUp)
00141   {m_numSmoothUp = a_numSmoothUp;}
00142 
00144   void setnumSmoothDown(int a_numSmoothDown)
00145   {m_numSmoothDown = a_numSmoothDown;}
00146 
00147 
00148   // this is a dangerous access function that should not generally be used.
00149   LevelOp* levelOpPtr();
00150 
00151   // this is another access function that is kinda bad
00152   LevelMG* lCoarsePtr();
00153 
00154 protected:
00155 
00156   void setDefaultValues();
00157   void clearMemory();
00158   bool m_isDefined;
00159 
00160   //these are owned by levelmg
00161   //
00162   LevelData<FArrayBox>  m_resid;
00163 
00164   //
00165   LevelData<FArrayBox>  m_crseResid;
00166 
00167   //
00168   LevelData<FArrayBox>  m_crseCorr;
00169 
00170   //
00171   DisjointBoxLayout m_ba;
00172 
00173   //
00174   DisjointBoxLayout m_baCoarsened;
00175 
00176   //
00177   const DisjointBoxLayout* m_baseBaPtr;
00178 
00179   //
00180   Real m_dxLevel;
00181 
00182   //
00183   ProblemDomain m_domain;
00184 
00185   //
00186   int m_nCoarserLevels;
00187 
00188   //  coarser level
00189   LevelMG* m_lCoarsePtr;
00190 
00191   //  das operator
00192   LevelOp* m_levelopPtr;
00193 
00194   //
00195   int m_numBottomGSRB;
00196 
00197   //
00198   int m_numSmoothUp;
00199 
00200   //
00201   int m_numSmoothDown;
00202 
00203   //
00204   int m_refToCoar;
00205 
00206   //
00207   CoarseAverage m_averageOp;
00208 
00209 private:
00210   // correct fine on intersection with crse
00211   //should only be called internally because this
00212   //is not written for  general LDF's
00213   void crseCorrect(LevelData<FArrayBox>& a_fine,
00214                    const LevelData<FArrayBox>& a_crse,
00215                    int a_refRat);
00216   void operator=(const LevelMG& levmgin){};
00217   LevelMG(const LevelMG& levmgin) {};
00218 };
00219 
00220 
00221 #endif
00222 
00223 

Generated on Tue Jul 2 10:42:20 2002 for Chombo by doxygen1.2.16