Main Page | Modules | Namespace List | 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 
00069 
00071 
00073   AMRNodeLevelMG();
00074 
00076 
00079   AMRNodeLevelMG(const AMRNodeSolver* const a_parent, 
00080                  int a_level, 
00081                  const NodeLevelOp* const a_opin);
00082 
00084 
00086   ~AMRNodeLevelMG();
00087 
00089 
00094   void define(
00095               const AMRNodeSolver* const a_parent,
00097               int a_level,
00099               const NodeLevelOp* const a_opin);
00100 
00107               
00109 
00112   bool isDefined() const;
00113 
00115 
00117   Real computeResidualNorm(
00118                            int a_normType) const;
00119   
00126 
00128 
00131   void setnumSmoothUp(int a_numSmoothUp);
00132 
00134 
00137   void setnumSmoothDown(int a_numSmoothDown);
00138 
00140 
00143   void setVerbose(bool a_verbose);
00144 
00151 
00153 
00165   void applyAMROperator(
00166                         LevelData<NodeFArrayBox>& a_Lofphi,
00168                         Vector<LevelData<NodeFArrayBox> *>& a_phiLevel);
00169   
00171 
00183   void applyAMRGradient(
00184                         LevelData<NodeFArrayBox>& a_gradPhi,
00186                         Vector<LevelData<NodeFArrayBox> *>& a_phiLevel);
00187   
00189 
00195   void computeAMRResidual(
00196                           Vector<LevelData<NodeFArrayBox> *>& a_phiLevel,
00198                           const Vector<LevelData<NodeFArrayBox> *>& a_rhsLevel);
00199 
00201 
00213   void upSweep(
00214                Vector<LevelData<NodeFArrayBox> *>& a_phiLevel,
00216                const Vector<LevelData<NodeFArrayBox> *>& a_rhsLevel);
00217 
00219 
00243   void downSweep(
00244                  Vector<LevelData<NodeFArrayBox> *>& a_phiLevel,
00246                  const Vector<LevelData<NodeFArrayBox> *>& a_rhsLevel);
00247 
00250 protected:
00251 
00254   Real computeNorm(
00255                    const LevelData<NodeFArrayBox>& a_mfinput,
00257                    int a_normType) const;
00258 
00261   void smooth(
00262               LevelData<NodeFArrayBox>& a_phi,
00264               const LevelData<NodeFArrayBox>& a_rhs);
00265 
00268   void projectFineInterior(LevelData<NodeFArrayBox>& a_phi,
00269                            const LevelData<NodeFArrayBox>& a_phiFine);
00270 
00273   void clearMemory();
00274 
00277   void setDefaultValues();
00278 
00281   const AMRNodeSolver* m_parent;
00282 
00285   NodeLevelMG m_levelMG;
00286 
00289   NodeMGInterp m_mginterp;
00290 
00293   bool m_isDefined;
00294 
00297   bool m_verbose;
00298 
00301   DisjointBoxLayout m_coarsenedGrids;
00302 
00305   LevelData<NodeFArrayBox> m_resid;
00306 
00307   // LevelData<NodeFArrayBox> m_residInterior;
00308 
00311   LevelData<NodeFArrayBox> m_corr;
00312 
00315   LevelData<NodeFArrayBox> m_dcorr;
00316 
00319   LevelData<NodeFArrayBox> m_LofPhi;
00320 
00323   LevelData<NodeFArrayBox> m_phiSave;
00324 
00327   LevelData<NodeFArrayBox> m_residCoarsened;
00328 
00331   int m_level;
00332 
00335   Real m_dx;
00336 
00339   NodeLevelOp* m_levelOpPtr;
00340 
00343   NodeCoarseAverage m_averageOp;
00344 
00347   ProblemDomain m_domain;
00348 
00351   DisjointBoxLayout m_finerGrids;
00352 
00355   DisjointBoxLayout m_coarsenedFineGrids;
00356 
00359   LayoutData< Vector<IntVectSet> > m_IVSV;
00360 
00363   LayoutData< Vector<IntVectSet> > m_IVSVext;
00364 
00367   LayoutData< Vector<IntVectSet> > m_IVSVcoarsened;
00368 
00371   LayoutData< Vector<IntVectSet> > m_IVSVcoarsenedFine;
00372 
00373 private:
00374 
00375   AMRNodeLevelMG& operator = (const AMRNodeLevelMG&);
00376   AMRNodeLevelMG(const AMRNodeLevelMG&);
00377 
00378 };
00379 
00380 #endif

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