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

LevelNodeSolver.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 // LevelNodeSolver.H
00029 // adapted from LevelSolver by DTGraves, Fri, July 23, 1999
00030 // petermc, 12 Apr 2001
00031 
00032 #ifndef LEVELNODESOLVER_H
00033 #define LEVELNODESOLVER_H
00034 
00035 #include <cstdlib>
00036 #include <iostream>
00037 #include <assert.h>
00038 #include <cmath>
00039 #include "REAL.H"
00040 #include "IntVectSet.H"
00041 #include "ProblemDomain.H"
00042 #include "NodeFArrayBox.H"
00043 #include "DisjointBoxLayout.H"
00044 #include "LevelData.H"
00045 #include "NodeLevelMG.H"
00046 #include "NodeLevelOp.H"
00047 
00049 class LevelNodeSolver
00052 {
00053 
00054 public:
00055 
00057 
00059 
00061   LevelNodeSolver();
00062 
00064 
00068   LevelNodeSolver(const DisjointBoxLayout& a_grids, 
00069                   const DisjointBoxLayout* a_gridsCoarsePtr,
00070                   const ProblemDomain&     a_domain, 
00071                   Real                     a_dx,  
00072                   int                      a_refToCoarse,
00073                   const NodeLevelOp* const a_opin,
00074                   int                      a_minLength = 1);
00075 
00076   LevelNodeSolver(const DisjointBoxLayout& a_grids, 
00077                   const DisjointBoxLayout* a_gridsCoarsePtr,
00078                   const Box&               a_domain, 
00079                   Real                     a_dx,
00080                   int                      a_refToCoarse,
00081                   const NodeLevelOp* const a_opin,
00082                   int                      a_minLength = 1);
00083 
00085 
00087   virtual ~LevelNodeSolver();
00088 
00089 
00091 
00106   virtual void define(const DisjointBoxLayout& a_grids,
00107                       const DisjointBoxLayout* a_gridsCoarsePtr,
00108                       const ProblemDomain&     a_domain,
00109                       Real                     a_dx,
00110                       int                      a_refToCoarse,
00111                       const NodeLevelOp* const a_opin,
00112                       int                      a_minLength = 1);
00113 
00114   virtual void define(const DisjointBoxLayout& a_grids,
00115                       const DisjointBoxLayout* a_gridsCoarsePtr,
00116                       const Box&               a_domain,
00117                       Real                     a_dx,
00118                       int                      a_refToCoarse,
00119                       const NodeLevelOp* const a_opin,
00120                       int                      a_minLength = 1);
00121 
00123 
00125 
00128   bool isDefined() const;
00129 
00130 
00132 
00134 
00137   void setnumBottomGSRB(int a_numBottomGSRB);
00138 
00140 
00143   void setnumSmoothUp(int a_numSmoothUp);
00144 
00146 
00149   void setnumSmoothDown(int a_numSmoothDown);
00150 
00152 
00154   void setBottomSmoothing(bool a_bottomSolveFlag);
00155 
00157 
00159   void setTolerance(Real a_tolerance);
00160 
00162 
00168   void setOperatorTolerance(Real a_operatorTolerance);
00169 
00171 
00173   void setVerbose(bool a_verbose);
00174 
00176 
00179   void setMaxIter(int a_maxIter);
00180 
00182 
00187   void setMinIter(int a_minIter);
00188 
00190 
00192   void clearMemory();
00193 
00195   void setDefaultValues();
00196 
00198 
00206   void levelSolveH(LevelData<NodeFArrayBox>&       a_phi,
00207                    const LevelData<NodeFArrayBox>& a_rhs,
00208                    bool                            a_initializePhiToZero = true);
00209 
00211 
00221   void levelSolve(LevelData<NodeFArrayBox>&       a_phi,
00222                   const LevelData<NodeFArrayBox>* a_phiCoarse, 
00223                   const LevelData<NodeFArrayBox>& a_rhs,
00224                   bool                            a_initializePhiToZero = true);
00225   
00226 protected:
00227 
00228   // LevelMG level solver object to relax on this level
00229   NodeLevelMG m_levelMG;
00230 
00231   // pointer to operator
00232   NodeLevelOp* m_levelOpPtr;
00233   
00234   // has this LevelNodeSolver been defined yet?
00235   bool m_isDefined;
00236 
00237   // grids at this level
00238   DisjointBoxLayout m_grids;
00239 
00240   // problem domain at this level
00241   ProblemDomain m_domain;
00242 
00243   // residual
00244   LevelData<NodeFArrayBox> m_resid;
00245 
00246   // useful scratch space
00247   LevelData<NodeFArrayBox> m_scratch;
00248 
00249   // correction
00250   LevelData<NodeFArrayBox> m_corr;
00251 
00252   // refinement ratio to next coarser level
00253   int m_refToCoarse;
00254 
00255   // mesh spacing at this level
00256   Real m_dx;
00257 
00258   // maximum number of iterations
00259   int m_maxIter;
00260 
00261   //
00262   int m_minIter;
00263 
00264   //
00265   Real m_tolerance;
00266 
00267   //
00268   Real m_operatorTolerance;
00269 
00270   // 
00271   bool m_bottomSolveFlag;
00272 
00273   //
00274   bool m_verbose;
00275 
00276   // interior boundary nodes
00277   LayoutData< Vector<IntVectSet> > m_IVSV;
00278 
00279   // exterior boundary nodes
00280   LayoutData< Vector<IntVectSet> > m_IVSVext;
00281 
00282 private:
00283 
00284   int countCoarserLevels(int a_minLength);
00285 
00286   void operator = (const LevelNodeSolver&){;}
00287   LevelNodeSolver(const LevelNodeSolver&){;}
00288 
00289 };
00290 
00291 #endif

Generated on Tue Apr 15 18:34:51 2003 for AMRNodeElliptic by doxygen1.2.16