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

HelmholtzOp.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 _HELMHOLTZOP_H_
00030 #define _HELMHOLTZOP_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 "FArrayBox.H"
00042 #include "QuadCFInterp.H"
00043 #include "Copier.H"
00044 
00045 #include "GhostBC.H"
00046 #include "LevelOp.H"
00047 #include "CFIVS.H"
00048 #include "BaseBottomSmoother.H"
00049 #include "BaseHelmholtzOp.H"
00050 
00052 
00055 class HelmholtzOp: public BaseHelmholtzOp
00056 {
00057 public:
00059   void setHelmCoeff(Real a_helmcoeff);
00060 
00062 
00066   void scaleHelmCoeff(Real a_scale);
00067 
00069   void setAlpha(Real a_alpha);
00070 
00072 
00075   void scaleAlpha(Real a_scale);
00076 
00078   void scaleBeta(Real a_scale);
00079 
00081 
00084   LevelOp* new_levelop() const;
00085 
00087 
00090   void define(const DisjointBoxLayout& a_grids,
00091               const DisjointBoxLayout* a_baseBAPtr,
00092               Real                     a_dxLevel,
00093               int                      a_refRatio,
00094               const Box&               a_domain, 
00095               bool                     a_homogeneousOnly= false,
00096               int                      a_ncomp = 1);
00097 
00099 
00102   void define(
00103               const DisjointBoxLayout& a_grids,
00105               const DisjointBoxLayout* a_baseBAPtr,
00107               Real                     a_dxLevel,
00109               int                      a_refRatio,
00111               const ProblemDomain&     a_domain, 
00113               bool                     a_homogeneousOnly= false,
00115               int                      a_ncomp = 1);
00116 
00118 
00120   void define(const LevelOp* a_opfine,
00121               int            a_refToFine);
00122 
00124   HelmholtzOp();
00125 
00127   ~HelmholtzOp();
00128 
00130 
00135   void smooth(LevelData<FArrayBox>&       a_phi,
00136               const LevelData<FArrayBox>& a_rhs);
00137 
00139 
00142   virtual void levelPreconditioner(LevelData<FArrayBox>&       a_phihat,
00143                                    const LevelData<FArrayBox>& a_rhshat);
00144 
00146 
00150   void applyOpI(
00151                 LevelData<FArrayBox>& phi,
00152                 const LevelData<FArrayBox>* phiCoarse,
00153                 LevelData<FArrayBox>& LOfPhi
00154                 );
00155 
00157 
00161   void applyOpIcfHphys(
00162                        LevelData<FArrayBox>& phi,
00163                        const LevelData<FArrayBox>* phiCoarse,
00164                        LevelData<FArrayBox>& LOfPhi
00165                        );
00166 
00168 
00172   void applyOpH(
00173                 LevelData<FArrayBox>& phi,
00174                 LevelData<FArrayBox>& LOfPhi
00175                 );
00176 
00178 
00182   void applyOpHcfIphys(
00183                        LevelData<FArrayBox>& phi,
00184                        LevelData<FArrayBox>& LOfPhi
00185                        );
00186 
00188 
00190   void CFInterp(
00191                 LevelData<FArrayBox>& phi,
00192                 const LevelData<FArrayBox>& phiCoarse
00193                 );
00194 
00196 
00198   void homogeneousCFInterp(LevelData<FArrayBox>& phi);
00199 
00201 
00203   void setDomainGhostBC(const DomainGhostBC& a_dombcin);
00204 
00206 
00209   void setBottomSmoother(const BaseBottomSmoother& a_bottomSmoother);
00210 
00212 
00214   void
00215   homogeneousCFInterp(LevelData<FArrayBox>& phif,
00216                       const DataIndex& a_datIndex,
00217                       int idir,
00218                       Side::LoHiSide hiorlo);
00219 
00221 
00223   void bottomSmoother(LevelData<FArrayBox>& phi,
00224                       const LevelData<FArrayBox>& rhs);
00225 
00227   bool isDefined() const;
00228 
00230 
00235   void getFlux(
00236                FArrayBox& flux,
00237                const FArrayBox& data,
00238                const DataIndex& a_datInd,
00239                int dir);
00240 
00242   virtual void setConvergenceMetric(Real a_metric, int a_comp);
00243 
00244 protected:
00248   DomainGhostBC m_domghostbc;
00249 
00253   ProblemDomain m_domain;
00254 
00258   DisjointBoxLayout m_grids;
00259 
00264   Copier m_exchangeCopier;
00265 
00270   DisjointBoxLayout m_baseBA;
00271 
00275   int m_refRatio;
00276 
00280   Real m_dxLevel;
00281 
00285   Real m_dxCrse;
00286 
00290   int m_ncomp;
00291 
00296   QuadCFInterp m_quadCFI;
00297 
00299 
00302   BaseBottomSmoother* m_bottomSmootherPtr;
00303 
00307   bool m_isDefined;
00308 
00312   bool m_isBCDefined;
00313 
00317   bool m_ihcfiEnabled;
00318 
00322   bool m_hcoeffDefined;
00323 
00327   LayoutData<CFIVS> m_loCFIVS[SpaceDim];
00331   LayoutData<CFIVS> m_hiCFIVS[SpaceDim];
00332 
00336   Real m_helmCoeff;
00337 
00341   Real m_alphaCoeff;
00342 
00343 private:
00347   void levelGSRB(LevelData<FArrayBox>&       a_phi,
00348                  const LevelData<FArrayBox>& a_rhs);
00349 
00350 //  void interpOnIVS(LevelData<FArrayBox>& a_phif,
00351 //                   const FArrayBox&      a_phistar,
00352 //                   const DataIndex&      a_datInd,
00353 //                   const int             a_idir,
00354 //                   const Side::LoHiSide  a_hiorlo,
00355 //                   const IntVectSet&     a_interpIVS);
00356 
00360   void interpOnIVSHomo(LevelData<FArrayBox>& a_phif,
00361                        const DataIndex&      a_datInd,
00362                        const int             a_idir,
00363                        const Side::LoHiSide  a_hiorlo,
00364                        const IntVectSet&     a_interpIVS);
00365 
00366   void clearMemory();
00367 
00368   void setDefaultValues();
00369 };
00370 
00371 #endif

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