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

RegHelmholtzOp.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 _REGHELMHOLTZOP_H_
00030 #define _REGHELMHOLTZOP_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 "FArrayBox.H"
00042 #include "Copier.H"
00043 #include "QuadCFInterp.H"
00044 
00045 #include "RegCFIVS.H"
00046 #include "RegGhostBC.H"
00047 
00048 #include "RegLevelOp.H"
00049 #include "GenBaseBottomSmoother.H"
00050 
00052 
00054 class RegHelmholtzOp: public RegLevelOp
00055 {
00056 public:
00058   RegHelmholtzOp();
00059 
00061   ~RegHelmholtzOp();
00062 
00064 
00067   RegHelmholtzOp* newOp() const;
00068 
00070   bool isDefined() const;
00071 
00073 
00077   void define(const DisjointBoxLayout& a_grids,
00078               const DisjointBoxLayout* a_baseBAPtr,
00079               Real                     a_dxLevel, 
00080               int                      a_refRatio,
00081               const Box&               a_domain, 
00082               bool                     a_homogeneousOnly = false,
00083               int                      a_ncomp = 1);
00084 
00086 
00090   void define(const DisjointBoxLayout& a_grids,
00091               const DisjointBoxLayout* a_baseBAPtr,
00092               Real                     a_dxLevel, 
00093               int                      a_refRatio,
00094               const ProblemDomain&     a_domain,
00095               bool                     a_homogeneousOnly = false,
00096               int                      a_ncomp = 1);
00097 
00099 
00102   void define(const RegLevelOp* a_opfinePtr,
00103               int               a_refToFine);
00104 
00106 
00109   void setHelmCoeff(Real a_helmcoeff);
00110 
00112 
00117   void scaleHelmCoeff(Real a_scale);
00118 
00120 
00123   void setAlpha(Real a_alpha);
00124 
00126 
00129   void scaleAlpha(Real a_scale);
00130 
00132 
00135   void scaleBeta(Real a_scale);
00136 
00138 
00144   void smooth(LevelData<FArrayBox>&       a_phi,
00145               const LevelData<FArrayBox>& a_rhs);
00146 
00148 
00151   virtual void levelPreconditioner(LevelData<FArrayBox>&       a_phihat,
00152                                    const LevelData<FArrayBox>& a_rhshat);
00153 
00155 
00159   void applyOpI(LevelData<FArrayBox>&       a_phi,
00160                 const LevelData<FArrayBox>* a_phicPtr,
00161                 LevelData<FArrayBox>&       a_LOfPhi);
00162 
00164 
00168   void applyOpHcfIphys(LevelData<FArrayBox>& a_phi,
00169                        LevelData<FArrayBox>& a_LOfPhi);
00170 
00172 
00175   void applyOpIcfHphys(LevelData<FArrayBox>&       a_phi,
00176                        const LevelData<FArrayBox>* a_phicPtr,
00177                        LevelData<FArrayBox>&       a_LOfPhi);
00178 
00180 
00184   void applyOpH(LevelData<FArrayBox>& a_phi,
00185                 LevelData<FArrayBox>& a_LOfPhi);
00186 
00188   void setBottomSmoother(const GenBaseBottomSmoother<LevelData<FArrayBox> >& a_bottomSmoother);
00189 
00191 
00195   void bottomSmoother(LevelData<FArrayBox>&       a_phi,
00196                       const LevelData<FArrayBox>& a_rhs);
00197 
00199 
00203   void CFInterp(LevelData<FArrayBox>&       a_phif,
00204                 const LevelData<FArrayBox>& a_phic);
00205 
00207 
00209   void homogeneousCFInterp(LevelData<FArrayBox>& a_phif);
00210 
00212 
00214   void homogeneousCFInterp(LevelData<FArrayBox>& a_phif, 
00215                            const DataIndex&      a_datInd, 
00216                            int                   a_idir, 
00217                            Side::LoHiSide        a_hiorlo);
00218 
00220   void setDomainGhostBC(const RegDomainGhostBC& a_dombcin);
00221 
00223 
00229   void getFlux(FArrayBox&       a_fineFlux, 
00230                const FArrayBox& a_data, 
00231                const DataIndex& a_datInd,
00232                int              a_dir);
00233 
00234 protected:
00235   // boundary conditons
00236   RegDomainGhostBC m_domghostbc;
00237 
00238   // domain of fine grid
00239   ProblemDomain m_domain;
00240 
00241   // the grids at the current level
00242   DisjointBoxLayout m_grids;
00243 
00244   // Copier object that knows how to perform exchange operations on 
00245   // LevelData objects defined on m_grids
00246   Copier m_exchangeCopier;
00247 
00248   /* DisjointBoxLayout for next coarser level
00249      this is == NULL if there is no coarser level */
00250   DisjointBoxLayout m_baseBA;
00251 
00252   // refinement ratio between this and the next coarser level
00253   int m_refRatio;
00254 
00255   // mesh spacing at this level
00256   Real m_dxLevel;
00257 
00258   // mesh spacing at the next coarser level
00259   Real m_dxCrse;
00260 
00261   // number of components
00262   int m_ncomp;
00263 
00264   /*
00265     coarse-fine information between this level
00266     and the next coarser level
00267   */
00268   QuadCFInterp m_quadCFI;
00269 
00271   /* bottom smoother object
00272    */
00273   GenBaseBottomSmoother<LevelData<FArrayBox> >* m_bottomSmootherPtr;
00274 
00275   // has full define function been called?
00276   bool m_isDefined;
00277 
00278   // has full define function been called?
00279   bool m_isBCDefined;
00280 
00281   // is inhomogeneous CF interpolation possible?
00282   bool m_ihcfiEnabled;
00283 
00284   // is the helmholtz coefficient defined?
00285   bool m_hcoeffDefined;
00286 
00287   // the beta in (alpha*I + beta*laplacian)phi = rho
00288   Real m_helmCoeff;
00289 
00290   // the alpha in (alpha*I + beta*laplacian)phi = rho
00291   Real m_alphaCoeff;
00292 
00293   // intvectsets for coarse-fine interpolation
00294   LayoutData<RegCFIVS> m_loCFIVS[SpaceDim];
00295   LayoutData<RegCFIVS> m_hiCFIVS[SpaceDim];
00296 
00297 private:
00298   // internally useful 
00299   void levelGSRB(LevelData<FArrayBox>&       a_phi, 
00300                  const LevelData<FArrayBox>& a_rhs);
00301 
00302   void interpOnIVSHomo(LevelData<FArrayBox>& a_phif, 
00303                        const DataIndex&      a_datInd,
00304                        const int             a_idir,
00305                        const Side::LoHiSide  a_hiorlo,
00306                        const IntVectSet&     a_interpIVS);
00307 
00308 // void interpOnIVS(LevelData<FArrayBox>& a_phif, 
00309 //                  const FArrayBox&      a_phistar, 
00310 //                  const DataIndex&      a_datInd,
00311 //                  const int             a_idir,
00312 //                  const Side::LoHiSide  a_hiorlo,
00313 //                  const IntVectSet&     a_interpIVS);
00314 
00315   void clearMemory();
00316 
00317   void setDefaultValues();
00318 };
00319 
00320 #endif

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