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 
00127   void mgRelax(LevelData<FArrayBox> & a_soln,
00128                const LevelData<FArrayBox> & a_rhs,
00129                bool bottomsolveflag);
00130 
00132   void setnumBottomGSRB(int a_numBottomGSRB)
00133   {m_numBottomGSRB = a_numBottomGSRB;}
00134 
00136   void setnumSmoothUp(int a_numSmoothUp)
00137   {m_numSmoothUp = a_numSmoothUp;}
00138 
00140   void setnumSmoothDown(int a_numSmoothDown)
00141   {m_numSmoothDown = a_numSmoothDown;}
00142 
00143 
00144   // this is a dangerous access function that should not generally be used.
00145   LevelOp* levelOpPtr();
00146 
00147   // this is another access function that is kinda bad
00148   LevelMG* lCoarsePtr();
00149 
00150 protected:
00151 
00152   void setDefaultValues();
00153   void clearMemory();
00154   bool m_isDefined;
00155 
00156   //these are owned by levelmg
00157   //
00158   LevelData<FArrayBox>  m_resid;
00159 
00160   //
00161   LevelData<FArrayBox>  m_crseResid;
00162 
00163   //
00164   LevelData<FArrayBox>  m_crseCorr;
00165 
00166   //
00167   DisjointBoxLayout m_ba;
00168 
00169   //
00170   DisjointBoxLayout m_baCoarsened;
00171 
00172   //
00173   const DisjointBoxLayout* m_baseBaPtr;
00174 
00175   //
00176   Real m_dxLevel;
00177 
00178   //
00179   ProblemDomain m_domain;
00180 
00181   //
00182   int m_nCoarserLevels;
00183 
00184   //  coarser level
00185   LevelMG* m_lCoarsePtr;
00186 
00187   //  das operator
00188   LevelOp* m_levelopPtr;
00189 
00190   //
00191   int m_numBottomGSRB;
00192 
00193   //
00194   int m_numSmoothUp;
00195 
00196   //
00197   int m_numSmoothDown;
00198 
00199   //
00200   int m_refToCoar;
00201 
00202   //
00203   CoarseAverage m_averageOp;
00204 
00205 private:
00206   // correct fine on intersection with crse
00207   //should only be called internally because this
00208   //is not written for  general LDF's
00209   void crseCorrect(LevelData<FArrayBox>& a_fine,
00210                    const LevelData<FArrayBox>& a_crse,
00211                    int a_refRat);
00212   void operator=(const LevelMG& levmgin){};
00213   LevelMG(const LevelMG& levmgin) {};
00214 };
00215 
00216 
00217 #endif
00218 
00219 

Generated on Wed Apr 16 14:26:49 2003 for Chombo by doxygen1.2.16