Main Page | Modules | Namespace List | 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 
00060 
00062 
00064   LevelNodeSolver();
00065 
00067 
00071   LevelNodeSolver(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_minLength = 1);
00078 
00080 
00084   LevelNodeSolver(const DisjointBoxLayout& a_grids, 
00085                   const DisjointBoxLayout* a_gridsCoarsePtr,
00086                   const Box&               a_domain, 
00087                   Real                     a_dx,
00088                   int                      a_refToCoarse,
00089                   const NodeLevelOp* const a_opin,
00090                   int                      a_minLength = 1);
00091 
00093 
00095   virtual ~LevelNodeSolver();
00096 
00098 
00101   virtual void define(
00102                       const DisjointBoxLayout& a_grids,
00104                       const DisjointBoxLayout* a_gridsCoarsePtr,
00106                       const ProblemDomain&     a_domain,
00108                       Real                     a_dx,
00110                       int                      a_refToCoarse,
00112                       const NodeLevelOp* const a_opin,
00114                       int                      a_minLength = 1);
00115 
00117 
00120   virtual void define(
00121                       const DisjointBoxLayout& a_grids,
00123                       const DisjointBoxLayout* a_gridsCoarsePtr,
00125                       const Box&               a_domain,
00127                       Real                     a_dx,
00129                       int                      a_refToCoarse,
00131                       const NodeLevelOp* const a_opin,
00133                       int                      a_minLength = 1);
00134 
00141 
00143 
00146   bool isDefined() const;
00147 
00148 
00155 
00157 
00160   void setnumSmoothUp(int a_numSmoothUp);
00161 
00163 
00166   void setnumSmoothDown(int a_numSmoothDown);
00167 
00169 
00172   void setBottomSmoothing(bool a_bottomSolveFlag);
00173 
00175 
00177   void setTolerance(Real a_tolerance);
00178 
00180 
00187   void setOperatorTolerance(Real a_operatorTolerance);
00188 
00190 
00193   void setVerbose(bool a_verbose);
00194 
00196 
00199   void setMaxIter(int a_maxIter);
00200 
00202 
00207   void setMinIter(int a_minIter);
00208 
00215 
00218   void clearMemory();
00219 
00222   void setDefaultValues();
00223 
00225 
00228   void levelSolveH(
00229                    LevelData<NodeFArrayBox>&       a_phi,
00231                    const LevelData<NodeFArrayBox>& a_rhs,
00233                    bool                            a_initializePhiToZero = true);
00234 
00236 
00239   void levelSolve(
00240                   LevelData<NodeFArrayBox>&       a_phi,
00242                   const LevelData<NodeFArrayBox>* a_phiCoarse,
00244                   const LevelData<NodeFArrayBox>& a_rhs,
00246                   bool                            a_initializePhiToZero = true);
00247 
00250 protected:
00251 
00254   NodeLevelMG m_levelMG;
00255 
00258   NodeLevelOp* m_levelOpPtr;
00259   
00262   bool m_isDefined;
00263 
00266   DisjointBoxLayout m_grids;
00267 
00270   ProblemDomain m_domain;
00271 
00274   LevelData<NodeFArrayBox> m_resid;
00275 
00278   LevelData<NodeFArrayBox> m_scratch;
00279 
00282   LevelData<NodeFArrayBox> m_corr;
00283 
00286   int m_refToCoarse;
00287 
00290   Real m_dx;
00291 
00294   int m_maxIter;
00295 
00298   int m_minIter;
00299 
00302   Real m_tolerance;
00303 
00307   Real m_operatorTolerance;
00308 
00311   bool m_bottomSolveFlag;
00312 
00315   bool m_verbose;
00316 
00319   LayoutData< Vector<IntVectSet> > m_IVSV;
00320 
00323   LayoutData< Vector<IntVectSet> > m_IVSVext;
00324 
00325 private:
00326 
00327   int countCoarserLevels(int a_minLength);
00328 
00329   void operator = (const LevelNodeSolver&){;}
00330   LevelNodeSolver(const LevelNodeSolver&){;}
00331 
00332 };
00333 
00334 #endif

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