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

PoissonOp.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 _POISSONOP_H_
00030 #define _POISSONOP_H_
00031 
00032 #include <iostream>
00033 #include <cmath>
00034 #include <assert.h>
00035 #include <cstdlib>
00036 #include <REAL.H>
00037 #include <IntVect.H>
00038 #include <Box.H>
00039 #include <DisjointBoxLayout.H>
00040 #include <LevelData.H>
00041 #include <BaseFab.H>
00042 #include <FArrayBox.H>
00043 #include "GhostBC.H"
00044 #include "LevelOp.H"
00045 #include "QuadCFInterp.H"
00046 #include "CFIVS.H"
00047 #include "Copier.H"
00048 #include "BaseBottomSmoother.H"
00049 
00051 
00053 class PoissonOp: public LevelOp
00054 {
00055 public:
00056 
00058 
00061   virtual LevelOp* new_levelop() const;
00062 
00064   virtual bool isDefined() const;
00065 
00067 
00071   void define(
00072               const DisjointBoxLayout& Ba,
00073               const DisjointBoxLayout* base_ba,
00074               Real  DxLevel, 
00075               int refratio,
00076               const Box& domf,
00077               bool a_homogeneousOnly=false,
00078               int ncomp = 1);
00079 
00081 
00085   void define(
00086               const DisjointBoxLayout& Ba,
00087               const DisjointBoxLayout* base_ba,
00088               Real  DxLevel, 
00089               int refratio,
00090               const ProblemDomain& domf,
00091               bool a_homogeneousOnly=false,
00092               int ncomp = 1);
00093 
00095 
00099   void define(
00100               const LevelOp* opfine,
00101               int refratio);
00102 
00104   PoissonOp();
00105 
00107   ~PoissonOp();
00108 
00110 
00116   void smooth(
00117               LevelData<FArrayBox>& a_phi,
00118               const LevelData<FArrayBox>& a_rhs);
00119 
00120 
00122 
00125   virtual void levelPreconditioner(
00126                                    LevelData<FArrayBox>& a_phihat,
00127                                    const LevelData<FArrayBox>& a_rhshat
00128                                    );
00129 
00130 
00132 
00136   void applyOpI(
00137                 LevelData<FArrayBox>& a_phi,
00138                 const LevelData<FArrayBox>* a_phiCoarse,
00139                 LevelData<FArrayBox>& a_LOfPhi);
00140 
00142 
00146   void applyOpIcfHphys(
00147                        LevelData<FArrayBox>& a_phi,
00148                        const LevelData<FArrayBox>* a_phiCoarse,
00149                        LevelData<FArrayBox>& a_LOfPhi);
00150 
00152 
00156   void applyOpH(
00157                 LevelData<FArrayBox>& a_phi,
00158                 LevelData<FArrayBox>& a_LOfPhi);
00159 
00161 
00164   void CFInterp(LevelData<FArrayBox>& a_phi,
00165                 const LevelData<FArrayBox>& a_phiCoarse
00166                 );
00167 
00169 
00173   void applyOpHcfIphys(
00174                        LevelData<FArrayBox>& a_phi,
00175                        LevelData<FArrayBox>& a_lOfPhi);
00176 
00177 
00179 
00182   void homogeneousCFInterp(LevelData<FArrayBox>& a_phi);
00183 
00185   void setDomainGhostBC(const DomainGhostBC& a_dombcin);
00186 
00188   void setBottomSmoother(const BaseBottomSmoother& a_bottomSmoother);
00189 
00191 
00194   void
00195   homogeneousCFInterp(LevelData<FArrayBox>& a_phif, 
00196                       const DataIndex& a_datInd, 
00197                       int a_idir, 
00198                       Side::LoHiSide a_hiorlo);
00199 
00201 
00205   void bottomSmoother(
00206                       LevelData<FArrayBox>& a_phi,
00207                       const LevelData<FArrayBox>& a_rhs);
00208 
00210 
00216   void getFlux(
00217                FArrayBox& flux, 
00218                const FArrayBox& a_data, 
00219                const DataIndex& a_datInd,
00220                int a_dir);
00221 
00222 protected:
00223 
00224   // boundary conditons
00225   DomainGhostBC m_domghostbc;
00226 
00227   //domain of fine grid
00228   ProblemDomain m_domain;
00229 
00230   //the grids at the current level
00231   DisjointBoxLayout m_grids;
00232 
00233   // Copier object that knows how to perform exchange operations on 
00234   // LevelData objects defined on m_grids
00235   Copier m_exchangeCopier;
00236 
00237   /* DisjointBoxLayout for next coarser level
00238      this is == NULL if there is no coarser level */
00239   DisjointBoxLayout m_baseBA;
00240 
00241   // number of components
00242   int m_ncomp;
00243 
00244   // refinement ratio between this and the next coarser level
00245   int m_refRatio;
00246 
00247   //mesh spacing at this level
00248   Real m_dxLevel;
00249 
00250   //mesh spacing at next coarser level
00251   Real m_dxCrse;
00252 
00253   /*
00254     coarse-fine information between this level
00255     and the next coarser level
00256   */
00257   QuadCFInterp m_quadCFI;
00258 
00260   /* bottom smoother object
00261    */
00262   BaseBottomSmoother* m_bottom_smoother_ptr;
00263 
00264   //has full define function been called?
00265   bool m_isDefined;
00266 
00267   //has bc been defined?
00268   bool m_isBCDefined;
00269 
00270   //is inhomogeneous CF interpolation possible?
00271   bool m_ihcfiEnabled;
00272 
00273   LayoutData<CFIVS> m_loCFIVS[SpaceDim];
00274   LayoutData<CFIVS> m_hiCFIVS[SpaceDim];
00275 
00276 private:
00277   //internally useful functions
00278   void
00279   levelGSRB(
00280             LevelData<FArrayBox>& a_phi, 
00281             const LevelData<FArrayBox>& a_rhs);
00282   void
00283   interpOnIVS(
00284               LevelData<FArrayBox>& a_phif, 
00285               const FArrayBox& a_phistar, 
00286               const DataIndex& dFine,
00287               const int a_idir,
00288               const Side::LoHiSide a_hiorlo,
00289               const IntVectSet& a_interpIVS);
00290 
00291   void clearMemory();
00292 
00293   void setDefaultValues();
00294 
00295 };
00296 
00297 #endif

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