Main Page | Modules | Namespace List | 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 "NodeCoarseAverage.H"
00045 #include "NodeLevelOp.H"
00046 
00048 
00053 class NodeLevelMG 
00054 {
00055 public:
00056 
00061 
00063 
00065   NodeLevelMG();
00066 
00068 
00071   NodeLevelMG(const DisjointBoxLayout& a_grids,
00072               const DisjointBoxLayout* a_gridsCoarsePtr,
00073               const ProblemDomain&     a_domain,
00074               Real                     a_dx,
00075               int                      a_refToCoarse,
00076               const NodeLevelOp* const a_opin,
00077               int                      a_nCoarserLevels);
00078 
00080 
00083   NodeLevelMG(const DisjointBoxLayout& a_grids,
00084               const DisjointBoxLayout* a_gridsCoarsePtr,
00085               const Box&               a_domain,
00086               Real                     a_dx,
00087               int                      a_refToCoarse,
00088               const NodeLevelOp* const a_opin,
00089               int                      a_nCoarserLevels);
00090 
00092 
00094   ~NodeLevelMG();
00095 
00097 
00100   NodeLevelMG(NodeLevelMG&       a_L,
00101               int                a_refToCoarse,
00102               const NodeLevelOp* a_opin);
00103 
00105 
00107   void define(
00108               const DisjointBoxLayout& a_grids,
00110               const DisjointBoxLayout* a_gridsCoarsePtr,
00112               const ProblemDomain&     a_domain,
00114               Real                     a_dx,
00115               // refinement ratio to next coarser level (if any)
00116               int                      a_refToCoarse,
00118               const NodeLevelOp* const a_opin,
00120               int                      a_nCoarserLevels);
00121 
00123 
00125   void define(
00126               const DisjointBoxLayout& a_grids,
00128               const DisjointBoxLayout* a_gridsCoarsePtr,
00130               const Box&               a_domain,
00132               Real                     a_dx,
00133               // refinement ratio to next coarser level (if any)
00134               int                      a_refToCoarse,
00136               const NodeLevelOp* const a_opin,
00138               int                      a_nCoarserLevels);
00139 
00141 
00143   void define(
00144               const NodeLevelMG& a_L,
00146               int                a_refToCoarse,
00148               const NodeLevelOp* a_opin);
00149 
00150   // void clear();
00151 
00158 
00160 
00163   bool isDefined() const;
00164 
00171 
00173 
00175   void setnumSmoothUp(int a_numSmoothUp);
00176 
00178 
00180   void setnumSmoothDown(int a_numSmoothDown);
00181 
00183 
00186   void setVerbose(bool a_verbose);
00187 
00194 
00196 
00205   void mgRelax(
00206                LevelData<NodeFArrayBox>&       a_phi,
00208                const LevelData<NodeFArrayBox>& a_rhs,
00210                bool                            a_bottomsolveflag);
00211 
00216   NodeLevelOp* levelOpPtr();
00217 
00220   NodeLevelMG* lCoarsePtr();
00221 
00222 protected:
00223   
00226   void setDefaultValues();
00227 
00230   void clearMemory();
00231 
00234   bool m_isDefined;
00235 
00238   bool m_verbose;
00239 
00240   //these are owned by NodeLevelMG
00241 
00244   LevelData<NodeFArrayBox> m_resid;
00245 
00248   LevelData<NodeFArrayBox> m_crseResid;
00249 
00252   LevelData<NodeFArrayBox> m_crseCorr;
00253   
00256   DisjointBoxLayout m_grids;
00257 
00260   DisjointBoxLayout m_coarsenedGrids;
00261 
00264   const DisjointBoxLayout* m_gridsCoarsePtr;
00265     
00268   Real m_dx;
00269     
00272   ProblemDomain m_domain;
00273 
00276   int m_nCoarserLevels;
00277 
00280   NodeLevelMG* m_lCoarsePtr;
00281 
00284   NodeLevelOp* m_levelopPtr;
00285     
00288   int m_numBottomPoints;
00289 
00292   int m_numSmoothUp;
00293 
00296   int m_numSmoothDown;
00297 
00300   int m_refToCoarsened;
00301 
00304   NodeCoarseAverage m_averageOp;
00305 
00308   Box m_boxRef;
00309 
00312   FArrayBox m_weights;
00313 
00314 private:
00315   
00319   void crseCorrect(LevelData<NodeFArrayBox>& a_phi);
00320 
00321   void operator=(const NodeLevelMG& a_levmgin){};
00322 
00323   NodeLevelMG(const NodeLevelMG& a_levmgin) {};
00324 };
00325 
00326 #endif

Generated on Fri Jul 2 17:53:42 2004 for Chombo by doxygen 1.3.2