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

AMRNodeSolverAlt.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 // AMRNodeSolverAlt.H
00029 // adapted from AMRSolver by DTGraves, Tues, July 6, 1999
00030 // AMRNodeSolver by petermc, 28 Nov 2000
00031 // AMRNodeSolverAlt by petermc, 22 May 2002
00032 
00033 #ifndef AMRNODESOLVERALT_H
00034 #define AMRNODESOLVERALT_H
00035 
00036 #include <cstdlib>
00037 #include <cmath>
00038 #include <iostream>
00039 #include <assert.h>
00040 #include "REAL.H"
00041 #include "ProblemDomain.H"
00042 #include "NodeFArrayBox.H"
00043 #include "Vector.H"
00044 #include "IntVectSet.H"
00045 #include "DisjointBoxLayout.H"
00046 #include "LevelData.H"
00047 #include "LevelNodeSolver.H"
00048 
00050 
00057 class AMRNodeSolverAlt
00058 {
00059 public:
00060 
00062 
00064 
00068   AMRNodeSolverAlt();
00069 
00071 
00074   AMRNodeSolverAlt(const Vector<DisjointBoxLayout>& a_gridsLevel,
00075                    const Vector<ProblemDomain>&     a_domainLevel,
00076                    const Vector<Real>&              a_dxLevel,
00077                    const Vector<int>&               a_refRatio,
00078                    int                              a_numLevels,
00079                    int                              a_lBase,
00080                    const NodeMaskLevelOp* const     a_opin,
00081                    int                              a_minLength = 1);
00082 
00083   AMRNodeSolverAlt(const Vector<DisjointBoxLayout>& a_gridsLevel,
00084                    const Vector<Box>&               a_domainLevel,
00085                    const Vector<Real>&              a_dxLevel,
00086                    const Vector<int>&               a_refRatio,
00087                    int                              a_numLevels,
00088                    int                              a_lBase,
00089                    const NodeMaskLevelOp* const     a_opin,
00090                    int                              a_minLength = 1);
00091 
00093 
00095   ~AMRNodeSolverAlt();
00096   
00098 
00119   void define(const Vector<DisjointBoxLayout>& a_gridsLevel,
00120               const Vector<ProblemDomain>&     a_domainLevel,
00121               const Vector<Real>&              a_dxLevel,
00122               const Vector<int>&               a_refRatio,
00123               int                              a_numLevels,
00124               int                              a_lBase,
00125               const NodeMaskLevelOp* const     a_opin,
00126               int                              a_minLength = 1);
00127 
00128   void define(const Vector<DisjointBoxLayout>& a_gridsLevel,
00129               const Vector<Box>&               a_domainLevel,
00130               const Vector<Real>&              a_dxLevel,
00131               const Vector<int>&               a_refRatio,
00132               int                              a_numLevels,
00133               int                              a_lBase,
00134               const NodeMaskLevelOp* const     a_opin,
00135               int                              a_minLength = 1);
00136 
00138 
00140 
00142   bool isDefined() const;
00143 
00145 
00147 
00149   void setTolerance(Real a_tolerance);
00150 
00152 
00155   void setBottomSmoothing(bool a_doBottomSmooth);
00156 
00158 
00161   void setMaxIter(int a_maxIter);
00162 
00164 
00166   void setVerbose(bool a_verbose);
00167 
00168 
00170 
00172 
00186   void solveAMR(Vector<LevelData<NodeFArrayBox> *>&       a_phiLevel, 
00187                 const Vector<LevelData<NodeFArrayBox> *>& a_rhsLevel);
00188 
00189 protected:
00190 
00191   //set data to default values.  not for external use
00192   void setDefaultValues();
00193   
00194   void clear();
00195 
00196   // index of coarsest level on which solution is to be computed.
00197   int m_lBase;
00198 
00199   // number of levels allowed.
00200   int m_numLevels; 
00201 
00202   // index of finest level used.  equal to m_numLevels-1.
00203   int m_finestLevel;
00204 
00205   // refinement ratio between levels.
00206   Vector<int> m_refRatio;
00207 
00208   // grid spacing at each level.
00209   Vector<Real> m_dxLevel;
00210 
00211   // grids, cell-centered (disjoint) at each level.
00212   Vector<DisjointBoxLayout> m_gridsLevel;
00213 
00214   // cell-centered domain at each level.
00215   Vector<ProblemDomain> m_domainLevel;
00216 
00217   bool m_isDefined;
00218 
00219   // multigrid solver for each level
00220   Vector<LevelNodeSolver*> m_levelSolver;
00221 
00222   // default is true:  messages are written.
00223   bool m_verbose;
00224   
00225 private:
00226   AMRNodeSolverAlt(const AMRNodeSolverAlt&);
00227   AMRNodeSolverAlt& operator=(const AMRNodeSolverAlt&);
00228 
00229 
00230 };
00231 #endif

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