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 <cassert>
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 "GhostBC.H"
00048 #include "LevelOp.H"
00049 #include "CFIVS.H"
00050 #include "BaseBottomSmoother.H"
00051 
00053 
00055 class PoissonOp: public LevelOp
00056 {
00057 public:
00059   PoissonOp();
00060 
00062   ~PoissonOp();
00063 
00065 
00067   virtual LevelOp* new_levelop() const;
00068 
00070   virtual bool isDefined() const;
00071 
00073 
00076   void define(const DisjointBoxLayout& a_grids,
00077               const DisjointBoxLayout* a_baseBAPtr,
00078               Real                     a_dxLevel,
00079               int                      a_refRatio,
00080               const ProblemDomain&     a_domain,
00081               bool                     a_homogeneousOnly=false,
00082               int                      a_ncomp = 1);
00083 
00085 
00087   void define(const LevelOp* a_opfine,
00088               int            a_reftoFine);
00089 
00091 
00095   void define(const DisjointBoxLayout& a_grids,
00096               const DisjointBoxLayout* a_baseBAPtr,
00097               Real                     a_dxLevel,
00098               int                      a_refRatio,
00099               const Box&               a_domain,
00100               bool                     a_homogeneousOnly=false,
00101               int                      a_ncomp = 1);
00102 
00104 
00108   void smooth(LevelData<FArrayBox>&       a_phi,
00109               const LevelData<FArrayBox>& a_rhs);
00110 
00112 
00115   virtual void levelPreconditioner(LevelData<FArrayBox>&       a_phihat,
00116                                    const LevelData<FArrayBox>& a_rhshat);
00117 
00119 
00123   void applyOpI(LevelData<FArrayBox>&       a_phi,
00124                 const LevelData<FArrayBox>* a_phicPtr,
00125                 LevelData<FArrayBox>&       a_lofPhi);
00126 
00128 
00132   void applyOpIcfHphys(LevelData<FArrayBox>&       a_phi,
00133                        const LevelData<FArrayBox>* a_phicPtr,
00134                        LevelData<FArrayBox>&       a_lofPhi);
00135 
00137 
00141   void applyOpH(LevelData<FArrayBox>& a_phi,
00142                 LevelData<FArrayBox>& a_lofPhi);
00143 
00145 
00147   void CFInterp(LevelData<FArrayBox>&       a_phif,
00148                 const LevelData<FArrayBox>& a_phic);
00149 
00151 
00155   void applyOpHcfIphys(LevelData<FArrayBox>& a_phi,
00156                        LevelData<FArrayBox>& a_lOfPhi);
00157 
00159 
00161   void homogeneousCFInterp(LevelData<FArrayBox>& a_phif);
00162 
00164   void setDomainGhostBC(const DomainGhostBC& a_dombcin);
00165 
00167   void setBottomSmoother(const BaseBottomSmoother& a_bottomSmoother);
00168 
00170 
00172   void
00173   homogeneousCFInterp(LevelData<FArrayBox>& a_phif,
00174                       const DataIndex&      a_datInd,
00175                       int                   a_idir,
00176                       Side::LoHiSide        a_hiorlo);
00177 
00179 
00181   void bottomSmoother(LevelData<FArrayBox>&       a_phi,
00182                       const LevelData<FArrayBox>& a_rhs);
00183 
00185 
00190   void getFlux(FArrayBox&       a_fineFlux,
00191                const FArrayBox& a_data,
00192                const DataIndex& a_datInd,
00193                int              a_dir);
00194 
00196   virtual void setConvergenceMetric(Real a_metric, int a_comp);
00197 
00198 protected:
00202   DomainGhostBC m_domghostbc;
00203 
00207   ProblemDomain m_domain;
00208 
00212   DisjointBoxLayout m_grids;
00213 
00218   Copier m_exchangeCopier;
00219 
00224   DisjointBoxLayout m_baseBA;
00225 
00229   int m_ncomp;
00230 
00234   int m_refRatio;
00235 
00239   Real m_dxLevel;
00240 
00244   Real m_dxCrse;
00245 
00246   /*
00247     Object which performs Coarse-fine interpolation between this level
00248     and the next coarser level
00249   */
00250   QuadCFInterp m_quadCFI;
00251 
00255   BaseBottomSmoother* m_bottomSmootherPtr;
00256 
00260   bool m_isDefined;
00261 
00265   bool m_isBCDefined;
00266 
00270   bool m_ihcfiEnabled;
00271 
00275   LayoutData<CFIVS> m_loCFIVS[SpaceDim];
00279   LayoutData<CFIVS> m_hiCFIVS[SpaceDim];
00280 
00281 private:
00282   // Internally useful functions
00283   void levelGSRB(LevelData<FArrayBox>&       a_phi,
00284                  const LevelData<FArrayBox>& a_rhs);
00285 
00286 //   void interpOnIVS(LevelData<FArrayBox>& a_phif,
00287 //                    const FArrayBox&      a_phistar,
00288 //                    const DataIndex&      a_datInd,
00289 //                    const int             a_idir,
00290 //                    const Side::LoHiSide  a_hiorlo,
00291 //                    const IntVectSet&     a_interpIVS);
00292 
00293   void interpOnIVSHomo(LevelData<FArrayBox>& a_phif,
00294                        const DataIndex&      a_datInd,
00295                        const int             a_idir,
00296                        const Side::LoHiSide  a_hiorlo,
00297                        const IntVectSet&     a_interpIVS);
00298 
00299   void clearMemory();
00300 
00301   void setDefaultValues();
00302 };
00303 
00304 #endif

Generated on Wed Jun 2 13:53:35 2004 for Chombo&INSwithParticles by doxygen 1.3.2