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

AMRNodeLevelMG.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 // AMRNodeLevelMG.H
00029 // adapted from AMRLevelMG by DTGraves, Tues, July 6, 1999
00030 // petermc, Tues, Nov 28, 2000
00031 
00032 #ifndef AMRNODELEVELMG_H
00033 #define AMRNODELEVELMG_H
00034 
00035 #include <stdlib.h>
00036 #include <iostream>
00037 #include <assert.h>
00038 #include <math.h>
00039 #include "REAL.H"
00040 #include "IntVect.H"
00041 #include "ProblemDomain.H"
00042 #include "NodeFArrayBox.H"
00043 #include "DisjointBoxLayout.H"
00044 #include "LevelData.H"
00045 #include "BaseFab.H"
00046 #include "NodeLevelMG.H"
00047 #include "NodeMGInterp.H"
00048 
00049 // forward declaration of AMRNodeSolver
00050 // C++ism:  don't need to #include AMRNodeSolver.H unless you have
00051 // a data field that's an AMRNodeSolver
00052 class AMRNodeSolver;
00053 
00055 class AMRNodeLevelMG
00061 {
00062 public:    
00063   friend class AMRNodeSolver;
00064 
00066 
00068 
00070   AMRNodeLevelMG();
00071 
00073 
00076   AMRNodeLevelMG(const AMRNodeSolver* const a_parent, 
00077                  int a_level, 
00078                  const NodeMaskLevelOp* const a_opin);
00079 
00081 
00083   ~AMRNodeLevelMG();
00084 
00086 
00095   void define(const AMRNodeSolver* const a_parent, 
00096               int a_level, 
00097               const NodeMaskLevelOp* const a_opin);
00098 
00100               
00102 
00105   bool isDefined() const;
00106 
00108 
00113   Real computeResidualNorm(int a_normType) const;
00114   
00116 
00118 
00121   void setnumSmoothUp(int a_numSmoothUp);
00122 
00124 
00127   void setnumSmoothDown(int a_numSmoothDown);
00128 
00130 
00133   void setnumBottomGSRB(int a_numBottomGSRB);
00134 
00136 
00138   void setVerbose(bool a_verbose);
00139 
00141 
00143 
00160   void applyAMROperator(LevelData<NodeFArrayBox>& a_Lofphi,
00161                         Vector<LevelData<NodeFArrayBox> *>& a_phiLevel);
00162                         
00163   
00165 
00183   void computeAMRResidual(Vector<LevelData<NodeFArrayBox> *>& a_phiLevel,
00184                           const Vector<LevelData<NodeFArrayBox> *>& a_rhsLevel);
00185 
00187 
00204   void upSweep(Vector<LevelData<NodeFArrayBox> *>& a_phiLevel,
00205                const Vector<LevelData<NodeFArrayBox> *>& a_rhsLevel);
00206 
00208 
00230   void downSweep(Vector<LevelData<NodeFArrayBox> *>& a_phiLevel,
00231                  const Vector<LevelData<NodeFArrayBox> *>& a_rhsLevel);
00232 
00233 protected:
00234 
00235   // returns normType norm of mfab 
00236   Real computeNorm(const LevelData<NodeFArrayBox>& a_mfinput, 
00237                    int a_normType) const;
00238 
00239   //use short V-cycle or NodeLevelMG's smoother to reduce
00240   //high wave numbers of residual
00241   void smooth(LevelData<NodeFArrayBox>& a_phi,
00242               const LevelData<NodeFArrayBox>& a_rhs);
00243 
00244   // project phiFine at coarse interior nodes to phi.
00245   void projectFineInterior(LevelData<NodeFArrayBox>& a_phi,
00246                            const LevelData<NodeFArrayBox>& a_phiFine);
00247 
00248   //delete internal memory and set pointers to null
00249   void clearMemory();
00250 
00251   //set default values.  does not deal with memory
00252   void setDefaultValues();
00253 
00254   // da boss
00255   const AMRNodeSolver* m_parent;
00256 
00257   // NodeLevelMG level solver object to relax on this level
00258   NodeLevelMG m_levelMG;
00259 
00260   // for interpolation
00261   NodeMGInterp m_mginterp;
00262 
00263   // has this AMRNodeLevelMG been defined yet?
00264   bool m_isDefined;
00265 
00266   bool m_verbose;
00267 
00268   // the grids at this level, coarsened
00269   DisjointBoxLayout m_coarsenedGrids;
00270 
00271   // residual
00272   LevelData<NodeFArrayBox> m_resid;
00273 
00274   // residual
00275   LevelData<NodeFArrayBox> m_residInterior;
00276 
00277   // correction
00278   LevelData<NodeFArrayBox> m_corr;
00279 
00280   // the infamous correction to the correction
00281   LevelData<NodeFArrayBox> m_dcorr;
00282 
00283   // L(phi)
00284   LevelData<NodeFArrayBox> m_LofPhi;
00285 
00286   // extra copy of solution
00287   LevelData<NodeFArrayBox> m_phiSave;
00288 
00289   // coarsened residual, on m_coarsenedGrids
00290   LevelData<NodeFArrayBox> m_residCoarsened;
00291 
00292   //
00293   int m_level;
00294 
00295   // mesh spacing
00296   Real m_dx;
00297 
00298   //
00299   NodeMaskLevelOp* m_levelOpPtr;
00300 
00301   //
00302   NodeMaskAverage m_averageOp;
00303 
00304   // physical domain at this level
00305   ProblemDomain m_domain;
00306 
00307   // the grids at the next finer level
00308   DisjointBoxLayout m_finerGrids;
00309 
00310   // the grids at the next finer level, coarsened
00311   DisjointBoxLayout m_coarsenedFineGrids;
00312 
00313   // zero on m_coarsenedFineGrids
00314   LevelData<NodeFArrayBox> m_zeroCoarsenedFiner;
00315 
00316 
00317   // interior boundary nodes of grids at this level
00318   LayoutData< Vector<IntVectSet> > m_IVSV;
00319 
00320   LayoutData< Vector<IntVectSet> > m_IVSVext;
00321 
00322   // interior boundary nodes of the coarsened grids at this level
00323   LayoutData< Vector<IntVectSet> > m_IVSVcoarsened;
00324 
00325   // interior boundary nodes of the coarsened grids at next finer level
00326   LayoutData< Vector<IntVectSet> > m_IVSVcoarsenedFine;
00327 
00328 private:
00329 
00330   AMRNodeLevelMG& operator = (const AMRNodeLevelMG&);
00331   AMRNodeLevelMG(const AMRNodeLevelMG&);
00332 
00333 };
00334 
00335 #endif

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