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

GenLevelMG.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 _GENLEVELMG_H_
00030 #define _GENLEVELMG_H_  
00031 
00032 #include <iostream>
00033 #include <cmath>
00034 #include <assert.h>
00035 #include <cstdlib>
00036 
00037 #include "REAL.H"
00038 #include "IntVect.H"
00039 #include "Box.H"
00040 #include "DisjointBoxLayout.H"
00041 #include "CoarseAverage.H"
00042 #include "ProblemDomain.H"
00043 
00044 #include "GenLevelMGOp.H"
00045 
00047 
00052 template <class T> class GenLevelMG 
00053 {
00054 public:
00056   GenLevelMG();
00057 
00059   GenLevelMG(const DisjointBoxLayout&     a_ba,
00060              const DisjointBoxLayout*     a_baseBaPtr, 
00061              Real                         a_dxLevel, 
00062              int                          a_refRatio,
00063              const  Box&                  a_domain,
00064              int                          a_nCoarserLevels, 
00065              const GenLevelMGOp<T>* const a_opin,
00066              int                          a_ncomp = 1);
00067 
00069   GenLevelMG(const DisjointBoxLayout&     a_ba,
00070              const DisjointBoxLayout*     a_baseBaPtr, 
00071              Real                         a_dxLevel, 
00072              int                          a_refRatio,
00073              const  ProblemDomain&        a_domain,
00074              int                          a_nCoarserLevels, 
00075              const GenLevelMGOp<T>* const a_opin,
00076              int                          a_ncomp = 1);
00077 
00079   GenLevelMG(const GenLevelMG&      a_L,
00080              int                    a_refCoarse,
00081              const GenLevelMGOp<T>* a_opin);
00082 
00084   ~GenLevelMG();
00085 
00087   bool isDefined() const;
00088 
00090   void define(const DisjointBoxLayout&     a_ba,
00091               const DisjointBoxLayout*     a_baseBaPtr, 
00092               Real                         a_dxLevel,
00093               int                          a_refRatio,
00094               const Box&                   a_domain,
00095               int                          a_nCoarserLevels, 
00096               const GenLevelMGOp<T>* const a_opin,
00097               int                          a_ncomp = 1);
00098 
00100   void define(const DisjointBoxLayout&     a_ba,
00101               const DisjointBoxLayout*     a_baseBaPtr, 
00102               Real                         a_dxLevel,
00103               int                          a_refRatio,
00104               const ProblemDomain&         a_domain,
00105               int                          a_nCoarserLevels, 
00106               const GenLevelMGOp<T>* const a_opin,
00107               int                          a_ncomp);
00108 
00110   void define(const GenLevelMG&            a_L,
00111               int                          a_refCoarse,
00112               const GenLevelMGOp<T>* const a_opin);
00113 
00115 
00122   void mgRelax(T&       a_soln,
00123                const T& a_rhs,
00124                bool     a_bottomsolveflag);
00125 
00127   void setnumBottomGSRB(int a_numBottomGSRB);
00128 
00130   void setnumSmoothUp(int a_numSmoothUp);
00131 
00133   void setnumSmoothDown(int a_numSmoothDown);
00134 
00135   // this is a dangerous access function that should not generally be used.
00136   GenLevelMGOp<T>* levelOpPtr();
00137 
00138   // this is another access function that is kinda bad
00139   GenLevelMG* lCoarsePtr();
00140 
00141 protected:
00142   void setDefaultValues();
00143 
00144   void clearMemory();
00145 
00146   bool m_isDefined;
00147 
00148   // these are owned by levelmg
00149   //
00150   T m_resid;
00151 
00152   //
00153   T m_crseResid;
00154 
00155   //
00156   T m_crseCorr;
00157 
00158   //
00159   DisjointBoxLayout m_ba;
00160 
00161   //
00162   DisjointBoxLayout m_baCoarsened;
00163 
00164   //
00165   const DisjointBoxLayout* m_baseBaPtr;
00166 
00167   //
00168   Real m_dxLevel;
00169 
00170   //
00171   ProblemDomain m_domain;
00172 
00173   //
00174   int m_nCoarserLevels;
00175 
00176   // coarser level
00177   GenLevelMG* m_lCoarsePtr;
00178 
00179   // das operator
00180   GenLevelMGOp<T>* m_levelopPtr;
00181 
00182   //
00183   int m_numBottomGSRB;
00184 
00185   //
00186   int m_numSmoothUp;
00187 
00188   //
00189   int m_numSmoothDown;
00190 
00191   //
00192   int m_refToCoar;
00193 
00194   //
00195   CoarseAverage m_averageOp;
00196 
00197 private:
00198   // correct fine on intersection with crse
00199   // should only be called internally because this
00200   // is not written for  general LDF's
00201   void crseCorrect(T&       a_fine,
00202                    const T& a_crse,
00203                    int      a_refRat);
00204 
00205   GenLevelMG<T>(const GenLevelMG<T>&) {};
00206   void operator= (const GenLevelMG<T>&) {};
00207 };
00208 
00209 #include "GenLevelMGImplem.H"
00210 
00211 #endif

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