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

AMRNodeSolver.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 // AMRNodeSolver.H
00029 // adapted from AMRSolver by DTGraves, Tues, July 6, 1999
00030 // petermc, Wed, Nov 28, 2000
00031 
00032 #ifndef AMRNODESOLVER_H
00033 #define AMRNODESOLVER_H
00034 
00035 #include <cstdlib>
00036 #include <cmath>
00037 #include <iostream>
00038 #include <assert.h>
00039 #include "REAL.H"
00040 #include "IntVect.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 "AMRNodeLevelMG.H"
00048 #include "LevelNodeSolver.H"
00049 
00051 
00059 class AMRNodeSolver
00060 {
00061 public:
00062 
00063   friend class AMRNodeLevelMG;
00064 
00069 
00071 
00075   AMRNodeSolver();
00076 
00078 
00081   AMRNodeSolver(const Vector<DisjointBoxLayout>& a_gridsLevel,
00082                 const Vector<ProblemDomain>&     a_domainLevel,
00083                 const Vector<Real>&              a_dxLevel,
00084                 const Vector<int>&               a_refRatio,
00085                 int                              a_numLevels,
00086                 int                              a_lBase,
00087                 const NodeLevelOp* const         a_opin,
00088                 int                              a_minLength = 1);
00089 
00091 
00094   AMRNodeSolver(const Vector<DisjointBoxLayout>& a_gridsLevel,
00095                 const Vector<Box>&               a_domainLevel,
00096                 const Vector<Real>&              a_dxLevel,
00097                 const Vector<int>&               a_refRatio,
00098                 int                              a_numLevels,
00099                 int                              a_lBase,
00100                 const NodeLevelOp* const         a_opin,
00101                 int                              a_minLength = 1);
00102 
00104 
00106   ~AMRNodeSolver();
00107   
00109 
00115   void define(
00116               const Vector<DisjointBoxLayout>& a_gridsLevel,
00118               const Vector<ProblemDomain>&     a_domainLevel,
00120               const Vector<Real>&              a_dxLevel,
00122               const Vector<int>&               a_refRatio,
00124               int                              a_numLevels,
00126               int                              a_lBase,
00128               const NodeLevelOp* const         a_opin,
00130               int                              a_minLength = 1);
00131 
00132 
00134 
00140   void define(
00141               const Vector<DisjointBoxLayout>& a_gridsLevel,
00143               const Vector<Box>&               a_domainLevel,
00145               const Vector<Real>&              a_dxLevel,
00147               const Vector<int>&               a_refRatio,
00149               int                              a_numLevels,
00151               int                              a_lBase,
00153               const NodeLevelOp* const         a_opin,
00155               int                              a_minLength = 1);
00156 
00163 
00165 
00167   bool isDefined() const;
00168 
00175 
00177 
00180   void setNumSmoothUp(int a_numSmoothUp);
00181     
00183 
00186   void setNumSmoothDown(int a_numSmoothDown);
00187 
00189 
00191   void setTolerance(Real a_tolerance);
00192 
00194 
00197   void setBottomSmoothing(bool a_doBottomSmooth);
00198 
00200 
00202   void setBottomTolerance(Real a_tolerance);
00203 
00205 
00210   void setOperatorTolerance(Real a_operatorTolerance);
00211 
00213 
00215   void setMaxIter(int a_maxIter);
00216 
00218 
00222   void setMinIter(int a_minIter);
00223      
00225 
00228   void setBottomMaxIter(int a_maxIter);
00229 
00231 
00234   void setVerbose(bool a_verbose);
00235 
00236 
00243 
00245 
00255   void solveAMR(
00256                 Vector<LevelData<NodeFArrayBox> *>&       a_phiLevel,
00258                 const Vector<LevelData<NodeFArrayBox> *>& a_rhsLevel);
00259 
00261 
00263   void AMRVCycleMG(
00264                    Vector<LevelData<NodeFArrayBox> *>&       a_phiLevel,
00266                    const Vector<LevelData<NodeFArrayBox> *>& a_rhsLevel);
00267 
00269 
00276   Real computeResidualNorm(
00277                            int a_normType);
00278 
00279 
00281 
00294   void computeAMRResidual(
00295                           LevelData<NodeFArrayBox>&                 a_res,
00297                           Vector<LevelData<NodeFArrayBox> *>&       a_phiLevel,
00299                           const Vector<LevelData<NodeFArrayBox> *>& a_rhsLevel,
00301                           int                                       a_ilev);
00302 
00304 
00315   void applyAMROperator(
00316                         LevelData<NodeFArrayBox>&           a_lofPhi,
00318                         Vector<LevelData<NodeFArrayBox> *>& a_phiLevel,
00320                         int                                 a_ilev);
00321 
00323 
00334   void applyAMRGradient(
00335                         LevelData<NodeFArrayBox>&           a_gradPhi,
00337                         Vector<LevelData<NodeFArrayBox> *>& a_phiLevel,
00339                         int                                 a_ilev);
00340 
00343 protected:
00344 
00347   void setDefaultValues();
00348   
00351   void clear();
00352 
00355   Real m_tolerance;
00356 
00360   Real m_operatorTolerance;
00361 
00364   int m_lBase;
00365 
00368   int m_numLevels; 
00369 
00372   int m_finestLevel;
00373 
00376   Vector<int> m_refRatio;
00377 
00380   Vector<Real> m_dxLevel;
00381 
00384   Vector<DisjointBoxLayout> m_gridsLevel;
00385 
00388   Vector<ProblemDomain> m_domainLevel;
00389 
00392   int m_maxIter;
00393 
00396   int m_minIter;
00397 
00400   int m_numSmoothUp;
00401 
00404   int m_numSmoothDown;
00405 
00408   Vector<AMRNodeLevelMG*> m_amrmgLevel;   
00409   
00412   bool m_isDefined;
00413 
00416   LevelNodeSolver m_levelSolver;
00417 
00420   bool m_verbose;
00421   
00422 private:
00423   AMRNodeSolver(const AMRNodeSolver&);
00424   AMRNodeSolver& operator=(const AMRNodeSolver&);
00425 
00426 
00427 };
00428 #endif

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