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

RegPoissonOp.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, Weds, July 21, 1999
00028 
00029 #ifndef _REGPOISSONOP_H_
00030 #define _REGPOISSONOP_H_
00031 
00032 #include <iostream>
00033 #include <cmath>
00034 #include <assert.h>
00035 #include <cstdlib>
00036 
00037 #include "REAL.H"
00038 #include "IntVect.H"
00039 #include "Box.H"
00040 #include "DisjointBoxLayout.H"
00041 #include "LevelData.H"
00042 #include "BaseFab.H"
00043 #include "FArrayBox.H"
00044 #include "QuadCFInterp.H"
00045 #include "Copier.H"
00046 
00047 #include "RegCFIVS.H"
00048 #include "RegGhostBC.H"
00049 
00050 #include "RegLevelOp.H"
00051 #include "GenBaseBottomSmoother.H"
00052 
00054 
00056 class RegPoissonOp: public RegLevelOp
00057 {
00058 public:
00060   RegPoissonOp();
00061 
00063   ~RegPoissonOp();
00064 
00066 
00069   virtual RegPoissonOp* newOp() const;
00070 
00072   virtual bool isDefined() const;
00073 
00075 
00079   void define(const DisjointBoxLayout& a_grids,
00080               const DisjointBoxLayout* a_baseBAPtr,
00081               Real                     a_dxLevel, 
00082               int                      a_refRatio,
00083               const Box&               a_domain, 
00084               bool                     a_homogeneousOnly = false,
00085               int                      a_ncomp = 1);
00086 
00088 
00092   void define(const DisjointBoxLayout& a_grids,
00093               const DisjointBoxLayout* a_baseBAPtr,
00094               Real                     a_dxLevel, 
00095               int                      a_refRatio,
00096               const ProblemDomain&     a_domain,
00097               bool                     a_homogeneousOnly = false,
00098               int                      a_ncomp = 1);
00099 
00101 
00105   void define(const RegLevelOp* a_opfinePtr,
00106               int               a_refToFine);
00107 
00109 
00115   void smooth(LevelData<FArrayBox>&       a_phi,
00116               const LevelData<FArrayBox>& a_rhs);
00117 
00119 
00122   virtual void levelPreconditioner(LevelData<FArrayBox>&       a_phihat,
00123                                    const LevelData<FArrayBox>& a_rhshat);
00124 
00126 
00130   void applyOpI(LevelData<FArrayBox>&       a_phi,
00131                 const LevelData<FArrayBox>* a_phicPtr,
00132                 LevelData<FArrayBox>&       a_LOfPhi);
00133 
00135 
00139   void applyOpHcfIphys(LevelData<FArrayBox>& a_phi,
00140                        LevelData<FArrayBox>& a_LOfPhi);
00141 
00143 
00146   void applyOpIcfHphys(LevelData<FArrayBox>&       a_phi,
00147                        const LevelData<FArrayBox>* a_phicPtr,
00148                        LevelData<FArrayBox>&       a_LOfPhi);
00149 
00151 
00155   void applyOpH(LevelData<FArrayBox>& a_phi,
00156                 LevelData<FArrayBox>& a_LOfPhi);
00157 
00159   void setBottomSmoother(const GenBaseBottomSmoother<LevelData<FArrayBox> >& a_bottomSmoother);
00160 
00162 
00166   void bottomSmoother(LevelData<FArrayBox>&       a_phi,
00167                       const LevelData<FArrayBox>& a_rhs);
00168 
00170 
00174   void CFInterp(LevelData<FArrayBox>&       a_phif,
00175                 const LevelData<FArrayBox>& a_phic);
00176 
00178 
00180   void homogeneousCFInterp(LevelData<FArrayBox>& a_phif);
00181 
00183 
00185   void homogeneousCFInterp(LevelData<FArrayBox>& a_phif, 
00186                            const DataIndex&      a_datInd, 
00187                            int                   a_idir, 
00188                            Side::LoHiSide        a_hiorlo);
00189 
00191   void setDomainGhostBC(const RegDomainGhostBC& a_dombcin);
00192 
00194 
00200   void getFlux(FArrayBox&       a_fineFlux, 
00201                const FArrayBox& a_data, 
00202                const DataIndex& a_datInd,
00203                int              a_dir);
00204 
00205 protected:
00206   // boundary conditons
00207   RegDomainGhostBC m_domghostbc;
00208 
00209   // domain of fine grid
00210   ProblemDomain m_domain;
00211 
00212   // the grids at the current level
00213   DisjointBoxLayout m_grids;
00214 
00215   // Copier object that knows how to perform exchange operations on 
00216   // LevelData objects defined on m_grids
00217   Copier m_exchangeCopier;
00218 
00219   /* DisjointBoxLayout for next coarser level
00220      this is == NULL if there is no coarser level */
00221   DisjointBoxLayout m_baseBA;
00222 
00223   // refinement ratio between this and the next coarser level
00224   int m_refRatio;
00225 
00226   // mesh spacing at this level
00227   Real m_dxLevel;
00228 
00229   // mesh spacing at next coarser level
00230   Real m_dxCrse;
00231 
00232   // number of components
00233   int m_ncomp;
00234 
00235   /*
00236     coarse-fine information between this level
00237     and the next coarser level
00238   */
00239   QuadCFInterp m_quadCFI;
00240 
00242   /* bottom smoother object
00243    */
00244   GenBaseBottomSmoother<LevelData<FArrayBox> >* m_bottomSmootherPtr;
00245 
00246   // has full define function been called?
00247   bool m_isDefined;
00248 
00249   // has bc been defined?
00250   bool m_isBCDefined;
00251 
00252   // is inhomogeneous CF interpolation possible?
00253   bool m_ihcfiEnabled;
00254 
00255   LayoutData<RegCFIVS> m_loCFIVS[SpaceDim];
00256   LayoutData<RegCFIVS> m_hiCFIVS[SpaceDim];
00257 
00258 private:
00259   // internally useful 
00260   void levelGSRB(LevelData<FArrayBox>&       a_phi, 
00261                  const LevelData<FArrayBox>& a_rhs);
00262 
00263   void interpOnIVSHomo(LevelData<FArrayBox>& a_phif, 
00264                        const DataIndex&      a_datInd,
00265                        const int             a_idir,
00266                        const Side::LoHiSide  a_hiorlo,
00267                        const IntVectSet&     a_interpIVS);
00268 
00269 // void interpOnIVS(LevelData<FArrayBox>& a_phif, 
00270 //                  const FArrayBox&      a_phistar, 
00271 //                  const DataIndex&      a_datInd,
00272 //                  const int             a_idir,
00273 //                  const Side::LoHiSide  a_hiorlo,
00274 //                  const IntVectSet&     a_interpIVS);
00275 
00276   void clearMemory();
00277 
00278   void setDefaultValues();
00279 };
00280 
00281 #endif

Generated on Wed Apr 16 14:31:05 2003 for EBChombo by doxygen1.2.16