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

NodeLevelMG.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 
00028 // NodeLevelMG.H
00029 // adapted from LevelMG by DTGraves, Fri, July 16, 1999
00030 // petermc, 30 May 2001
00031 
00032 #ifndef NODELEVELMG_H
00033 #define NODELEVELMG_H
00034 
00035 #include <iostream>
00036 #include <cmath>
00037 #include <assert.h>
00038 #include <cstdlib>
00039 #include "REAL.H"
00040 #include "ProblemDomain.H"
00041 #include "DisjointBoxLayout.H"
00042 #include "NodeFArrayBox.H"
00043 #include "LevelData.H"
00044 #include "NodeMaskAverage.H"
00045 #include "NodeMaskLevelOp.H"
00046 #include "NodeMGInterp.H"
00047 
00049 
00054 class NodeLevelMG 
00055 {
00056 public:
00057 
00059 
00061 
00063   NodeLevelMG();
00064 
00066 
00069   NodeLevelMG(const DisjointBoxLayout&     a_grids,
00070               const DisjointBoxLayout*     a_gridsCoarsePtr,
00071               const ProblemDomain&         a_domain,
00072               Real                         a_dx,
00073               int                          a_refToCoarse,
00074               const NodeMaskLevelOp* const a_opin,
00075               int                          a_nCoarserLevels);
00076 
00077   NodeLevelMG(const DisjointBoxLayout&     a_grids,
00078               const DisjointBoxLayout*     a_gridsCoarsePtr,
00079               const Box&                   a_domain,
00080               Real                         a_dx,
00081               int                          a_refToCoarse,
00082               const NodeMaskLevelOp* const a_opin,
00083               int                          a_nCoarserLevels);
00085 
00087   ~NodeLevelMG();
00088 
00090 
00093   NodeLevelMG(NodeLevelMG&           a_L,
00094               int                    a_refToCoarse,
00095               const NodeMaskLevelOp* a_opin);
00096 
00098 
00111   void define(const DisjointBoxLayout&     a_grids,
00112               const DisjointBoxLayout*     a_gridsCoarsePtr,
00113               const ProblemDomain&         a_domain,
00114               Real                         a_dx,
00115               int                          a_refToCoarse,
00116               const NodeMaskLevelOp* const a_opin,
00117               int                          a_nCoarserLevels);
00118 
00119   void define(const DisjointBoxLayout&     a_grids,
00120               const DisjointBoxLayout*     a_gridsCoarsePtr,
00121               const Box&                   a_domain,
00122               Real                         a_dx,
00123               int                          a_refToCoarse,
00124               const NodeMaskLevelOp* const a_opin,
00125               int                          a_nCoarserLevels);
00126 
00128 
00135   void define(const NodeLevelMG&     a_L,
00136               int                    a_refToCoarse,
00137               const NodeMaskLevelOp* a_opin);
00138 
00140   void clear();
00141 
00143 
00145 
00148   bool isDefined() const;
00149 
00151 
00153 
00155   void setnumBottomGSRB(int a_numBottomGSRB);
00156 
00158 
00160   void setnumSmoothUp(int a_numSmoothUp);
00161 
00163 
00165   void setnumSmoothDown(int a_numSmoothDown);
00166 
00168 
00170   void setVerbose(bool a_verbose)
00171   {m_verbose = a_verbose;}
00172 
00174 
00176 
00191   void mgRelax(LevelData<NodeFArrayBox>&       a_phi,
00192                const LevelData<NodeFArrayBox>& a_rhs,
00193                bool                            a_bottomsolveflag);
00194 
00195   // this is a dangerous access function that should not generally be used.
00196   NodeMaskLevelOp* levelOpPtr();
00197 
00198   // this is another access function that is kinda bad
00199   NodeLevelMG* lCoarsePtr();
00200 
00201 protected:
00202   
00203   void setDefaultValues();
00204   void clearMemory();
00205   bool m_isDefined;
00206 
00207   bool m_verbose;
00208 
00209   //these are owned by NodeLevelMG
00210   // residual at this level
00211   LevelData<NodeFArrayBox> m_resid;
00212 
00213   // residual at next coarser level
00214   LevelData<NodeFArrayBox> m_crseResid;
00215 
00216   // correction at next coarser level
00217   LevelData<NodeFArrayBox> m_crseCorr;
00218   
00219   // grids at this level
00220   DisjointBoxLayout m_grids;
00221 
00222   // grids at next coarser level
00223   DisjointBoxLayout m_coarsenedGrids;
00224 
00225   // pointer to grids at next coarser level, or NULL if no coarser level
00226   const DisjointBoxLayout* m_gridsCoarsePtr;
00227     
00228   // mesh spacing at this level
00229   Real m_dx;
00230     
00231   // physical domain at this level
00232   ProblemDomain m_domain;
00233 
00234   // number of coarser levels
00235   int m_nCoarserLevels;
00236 
00237   // coarser level
00238   NodeLevelMG* m_lCoarsePtr;
00239 
00240   // das operator
00241   NodeMaskLevelOp* m_levelopPtr;
00242     
00243   //
00244   int m_numBottomGSRB;
00245 
00246   //
00247   int m_numSmoothUp;
00248 
00249   //
00250   int m_numSmoothDown;
00251 
00252   // refinement ratio to next coarser level
00253   int m_refToCoarsened;
00254 
00255   //
00256   NodeMaskAverage m_averageOp;
00257 
00258   //
00259   NodeMGInterp m_mginterp;
00260 
00261 private:
00262   // correct a_phi on intersection with m_crseCorr
00263   //should only be called internally because this
00264   //is not written for general LevelData<NodeFArrayBox>es
00265   void crseCorrect(LevelData<NodeFArrayBox>& a_phi);
00266 
00267   void operator=(const NodeLevelMG& a_levmgin){};
00268 
00269   NodeLevelMG(const NodeLevelMG& a_levmgin) {};
00270 };
00271 
00272 #endif

Generated on Tue Apr 15 18:31:55 2003 for AMRNodeElliptic by doxygen1.2.16