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 // no-geometry version by petermc, 26 Jan 2001
00031 // petermc, 17 Oct 2001
00032 
00033 #ifndef LEVELNODESOLVER_H
00034 #define LEVELNODESOLVER_H
00035 
00036 #include <cstdlib>
00037 #include <iostream>
00038 #include <assert.h>
00039 #include <cmath>
00040 #include "REAL.H"
00041 #include "IntVectSet.H"
00042 #include "ProblemDomain.H"
00043 #include "NodeFArrayBox.H"
00044 #include "DisjointBoxLayout.H"
00045 #include "LevelData.H"
00046 #include "NodeLevelMG.H"
00047 #include "NodeMaskLevelOp.H"
00048 
00049 
00051 class LevelNodeSolver
00054 {
00055 
00056 public:
00057 
00059 
00061 
00063   LevelNodeSolver();
00064 
00066 
00070   LevelNodeSolver(const DisjointBoxLayout&     a_grids, 
00071                   const DisjointBoxLayout*     a_gridsCoarsePtr,
00072                   const ProblemDomain&         a_domain, 
00073                   Real                         a_dx,
00074                   int                          a_refToCoarse,
00075                   const NodeMaskLevelOp* const a_opin,
00076                   int                          a_minLength = 1);
00077 
00078   LevelNodeSolver(const DisjointBoxLayout&     a_grids, 
00079                   const DisjointBoxLayout*     a_gridsCoarsePtr,
00080                   const Box&                   a_domain, 
00081                   Real                         a_dx,
00082                   int                          a_refToCoarse,
00083                   const NodeMaskLevelOp* const a_opin,
00084                   int                          a_minLength = 1);
00085 
00087 
00089   virtual ~LevelNodeSolver();
00090 
00091 
00093 
00108   virtual void define(const DisjointBoxLayout&     a_grids, 
00109                       const DisjointBoxLayout*     a_gridsCoarsePtr,
00110                       const ProblemDomain&         a_domain, 
00111                       Real                         a_dx,
00112                       int                          a_refToCoarse,
00113                       const NodeMaskLevelOp* const a_opin,
00114                       int                          a_minLength = 1);
00115 
00116   virtual void define(const DisjointBoxLayout&     a_grids, 
00117                       const DisjointBoxLayout*     a_gridsCoarsePtr,
00118                       const Box&                   a_domain, 
00119                       Real                         a_dx,
00120                       int                          a_refToCoarse,
00121                       const NodeMaskLevelOp* const a_opin,
00122                       int                          a_minLength = 1);
00123 
00125 
00127 
00130   bool isDefined() const;
00131 
00132 
00134 
00136 
00139   void setnumBottomGSRB(int a_numBottomGSRB);
00140 
00142 
00145   void setnumSmoothUp(int a_numSmoothUp);
00146 
00148 
00151   void setnumSmoothDown(int a_numSmoothDown);
00152 
00154 
00156   void setBottomSmoothing(bool a_bottomSolveFlag);
00157 
00159 
00161   void setTolerance(Real a_tolerance);
00162 
00164 
00170   void setOperatorTolerance(Real a_operatorTolerance);
00171 
00173 
00175   void setVerbose(bool a_verbose);
00176 
00178 
00181   void setMaxIter(int a_maxIter);
00182 
00184 
00189   void setMinIter(int a_minIter);
00190 
00192 
00194   void clearMemory();
00195 
00197   void setDefaultValues();
00198 
00200 
00208   void levelSolveH(LevelData<NodeFArrayBox>&       a_phi,
00209                    const LevelData<NodeFArrayBox>& a_rhs,
00210                    bool                            a_initializePhiToZero = true);
00211 
00213 
00223   void levelSolve(LevelData<NodeFArrayBox>&       a_phi,
00224                   const LevelData<NodeFArrayBox>* a_phiCoarse, 
00225                   const LevelData<NodeFArrayBox>& a_rhs,
00226                   bool                            a_initializePhiToZero = true);
00227   
00228 protected:
00229 
00230   // LevelMG level solver object to relax on this level
00231   NodeLevelMG m_levelMG;
00232 
00233   // pointer to operator
00234   NodeMaskLevelOp* m_levelOpPtr;
00235   
00236   // has this LevelNodeSolver been defined yet?
00237   bool m_isDefined;
00238 
00239   // grids at this level
00240   DisjointBoxLayout m_grids;
00241 
00242   // problem domain at this level
00243   ProblemDomain m_domain;
00244 
00245   // residual
00246   LevelData<NodeFArrayBox> m_resid;
00247 
00248   // useful scratch space
00249   LevelData<NodeFArrayBox> m_scratch;
00250 
00251   // correction
00252   LevelData<NodeFArrayBox> m_corr;
00253 
00254   // refinement ratio to next coarser level
00255   int m_refToCoarse;
00256 
00257   // mesh spacing at this level
00258   Real m_dx;
00259 
00260   // maximum number of iterations
00261   int m_maxIter;
00262 
00263   //
00264   int m_minIter;
00265 
00266   //
00267   Real m_tolerance;
00268 
00269   //
00270   Real m_operatorTolerance;
00271 
00272   //
00273   bool m_bottomSolveFlag;
00274 
00275   //
00276   bool m_verbose;
00277 
00278   // interior boundary nodes
00279   LayoutData< Vector<IntVectSet> > m_IVSV;
00280 
00281   // exterior boundary nodes
00282   LayoutData< Vector<IntVectSet> > m_IVSVext;
00283 
00284 private:
00285 
00286   int countCoarserLevels(int a_minLength);
00287 
00288   void operator = (const LevelNodeSolver&){;}
00289   LevelNodeSolver(const LevelNodeSolver&){;}
00290 
00291 };
00292 
00293 #endif

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