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

LevelSolver.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 // DTGraves, Fri, July 23, 1999
00028 
00029 #ifndef _LevelSolver_H_
00030 #define _LevelSolver_H_
00031 
00032 #include <cstdlib>
00033 #include <iostream>
00034 #include <assert.h>
00035 #include <cmath>
00036 #include "REAL.H"
00037 #include "IntVect.H"
00038 #include "Box.H"
00039 #include "FArrayBox.H"
00040 #include "DisjointBoxLayout.H"
00041 #include "LevelData.H"
00042 #include "LevelMG.H"
00043 #include "ProblemDomain.H"
00044 
00046 
00050 class LevelSolver
00051 {
00052 
00053 public:
00055 
00058   LevelSolver();
00059 
00061   virtual ~LevelSolver();
00062 
00064 
00081   LevelSolver(const DisjointBoxLayout& a_grids, 
00082               const DisjointBoxLayout* a_baseGrids, 
00083               const Box& a_domain, 
00084               Real a_dxLevel,  
00085               int a_nRefCrse,
00086               const LevelOp* const a_opin,
00087               int a_ncomp = 1);
00088 
00089 
00091 
00108   LevelSolver(const DisjointBoxLayout& a_grids, 
00109               const DisjointBoxLayout* a_baseGrids, 
00110               const ProblemDomain& a_domain, 
00111               Real a_dxLevel,  
00112               int a_nRefCrse,
00113               const LevelOp* const a_opin,
00114               int a_ncomp);
00115 
00116 
00118 
00135   virtual void define(const DisjointBoxLayout& a_grids, 
00136                       const DisjointBoxLayout* a_baseGrids,
00137                       const Box& a_domain, 
00138                       Real a_dxLevel,
00139                       int a_nRefCrse,
00140                       const LevelOp* const a_opin,
00141                       int a_ncomp=1);
00142 
00143 
00145 
00162   virtual void define(const DisjointBoxLayout& a_grids, 
00163                       const DisjointBoxLayout* a_baseGrids,
00164                       const ProblemDomain& a_domain, 
00165                       Real a_dxLevel,
00166                       int a_nRefCrse,
00167                       const LevelOp* const a_opin,
00168                       int a_ncomp = 1);
00169 
00170 
00172   bool isDefined() const;
00173 
00175   void clearMemory();
00176 
00178   void setDefaultValues();
00179 
00181 
00190   void levelSolveH(LevelData<FArrayBox>& phi, 
00191                    const LevelData<FArrayBox>& rhs,
00192                    bool initializePhiToZero=true);
00193 
00195 
00206   void levelSolve(LevelData<FArrayBox>& phi, 
00207                   const LevelData<FArrayBox>* phic, 
00208                   const LevelData<FArrayBox>& rhs,
00209                   bool initializePhiToZero=true);
00210 
00212   void setTolerance(Real a_tolerance);
00213 
00215   void setVerbose(bool a_verbose);
00216 
00218   void setMaxIter(int a_maxIter);
00219 protected:
00220 
00221   // LevelMG level solver object to relax on this level
00222   LevelMG m_levelMG;
00223 
00224   // LevelMG level solver object to relax on this level
00225   LevelOp* m_levelOpPtr;
00226 
00227   // has this LevelSolver been defined yet?
00228   bool m_isDefined;
00229 
00230   // grids at this level
00231   DisjointBoxLayout  m_grids;
00232 
00233   // problem domain at this level
00234   ProblemDomain m_domain;
00235 
00236   // residual
00237   LevelData<FArrayBox> m_resid;
00238 
00239   // useful scratch space.
00240   LevelData<FArrayBox> m_scratch;
00241 
00242   // correction
00243   LevelData<FArrayBox> m_corr;
00244 
00245   //
00246   int m_nRefCrse;
00247 
00248   //
00249   Real m_dxLevel;
00250 
00251   //
00252   int m_maxIter;
00253 
00254   //
00255   Real m_tolerance;
00256 
00257   //
00258   bool m_verbose;
00259 
00260 private:
00261   void operator = (const LevelSolver&){;}
00262   LevelSolver(const LevelSolver&){;}
00263 
00264 };
00265 
00266 #endif
00267 
00268 

Generated on Thu Aug 29 11:05:45 2002 for Chombo&INS by doxygen1.2.16