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    / /__/ _ \/ _ \/  V \/ _ \/ _ \
00004    \___/_//_/\___/_/_/_/_.__/\___/
00005 */
00006 // CHOMBO Copyright (c) 2000-2004, The Regents of the University of
00007 // California, through Lawrence Berkeley National Laboratory (subject to
00008 // receipt of any required approvals from U.S. Dept. of Energy).  All
00009 // rights reserved.
00010 //
00011 // Redistribution and use in source and binary forms, with or without
00012 // modification, are permitted provided that the following conditions are met:
00013 //
00014 // (1) Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 // (2) Redistributions in binary form must reproduce the above copyright
00017 // notice, this list of conditions and the following disclaimer in the
00018 // documentation and/or other materials provided with the distribution.
00019 // (3) Neither the name of Lawrence Berkeley National Laboratory, U.S.
00020 // Dept. of Energy nor the names of its contributors may be used to endorse
00021 // or promote products derived from this software without specific prior
00022 // written permission.
00023 //
00024 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00025 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
00026 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
00027 // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
00028 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00029 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00030 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00031 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00032 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00033 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00034 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035 //
00036 // You are under no obligation whatsoever to provide any bug fixes,
00037 // patches, or upgrades to the features, functionality or performance of
00038 // the source code ("Enhancements") to anyone; however, if you choose to
00039 // make your Enhancements available either publicly, or directly to
00040 // Lawrence Berkeley National Laboratory, without imposing a separate
00041 // written license agreement for such Enhancements, then you hereby grant
00042 // the following license: a non-exclusive, royalty-free perpetual license
00043 // to install, use, modify, prepare derivative works, incorporate into
00044 // other computer software, distribute, and sublicense such Enhancements or
00045 // derivative works thereof, in binary and source code form.
00046 //
00047 // TRADEMARKS. Product and company names mentioned herein may be the
00048 // trademarks of their respective owners.  Any rights not expressly granted
00049 // herein are reserved.
00050 //
00051 
00052 // DTGraves, Weds, July 21, 1999
00053 
00054 #ifndef _HELMHOLTZOP_H_
00055 #define _HELMHOLTZOP_H_
00056 
00057 #include <iostream>
00058 #include <cmath>
00059 #include <cassert>
00060 #include <cstdlib>
00061 
00062 #include "REAL.H"
00063 #include "IntVect.H"
00064 #include "Box.H"
00065 #include "DisjointBoxLayout.H"
00066 #include "FArrayBox.H"
00067 #include "QuadCFInterp.H"
00068 #include "Copier.H"
00069 
00070 #include "GhostBC.H"
00071 #include "LevelOp.H"
00072 #include "CFIVS.H"
00073 #include "BaseBottomSmoother.H"
00074 #include "BaseHelmholtzOp.H"
00075 
00077 
00080 class HelmholtzOp: public BaseHelmholtzOp
00081 {
00082 public:
00084   void setHelmCoeff(Real a_helmcoeff);
00085 
00087 
00091   void scaleHelmCoeff(Real a_scale);
00092 
00094   void setAlpha(Real a_alpha);
00095 
00097 
00100   void scaleAlpha(Real a_scale);
00101 
00103   void scaleBeta(Real a_scale);
00104 
00106 
00109   LevelOp* new_levelop() const;
00110 
00112 
00115   void define(const DisjointBoxLayout& a_grids,
00116               const DisjointBoxLayout* a_baseBAPtr,
00117               Real                     a_dxLevel,
00118               int                      a_refRatio,
00119               const Box&               a_domain,
00120               bool                     a_homogeneousOnly= false,
00121               int                      a_ncomp = 1);
00122 
00124 
00127   void define(
00128               const DisjointBoxLayout& a_grids,
00130               const DisjointBoxLayout* a_baseBAPtr,
00132               Real                     a_dxLevel,
00134               int                      a_refRatio,
00136               const ProblemDomain&     a_domain,
00138               bool                     a_homogeneousOnly= false,
00140               int                      a_ncomp = 1);
00141 
00143 
00145   void define(const LevelOp* a_opfine,
00146               int            a_refToFine);
00147 
00149   HelmholtzOp();
00150 
00152   ~HelmholtzOp();
00153 
00155 
00160   void smooth(LevelData<FArrayBox>&       a_phi,
00161               const LevelData<FArrayBox>& a_rhs);
00162 
00164 
00167   virtual void levelPreconditioner(LevelData<FArrayBox>&       a_phihat,
00168                                    const LevelData<FArrayBox>& a_rhshat);
00169 
00171 
00175   void applyOpI(
00176                 LevelData<FArrayBox>& phi,
00177                 const LevelData<FArrayBox>* phiCoarse,
00178                 LevelData<FArrayBox>& LOfPhi
00179                 );
00180 
00182 
00186   void applyOpIcfHphys(
00187                        LevelData<FArrayBox>& phi,
00188                        const LevelData<FArrayBox>* phiCoarse,
00189                        LevelData<FArrayBox>& LOfPhi
00190                        );
00191 
00193 
00197   void applyOpH(
00198                 LevelData<FArrayBox>& phi,
00199                 LevelData<FArrayBox>& LOfPhi
00200                 );
00201 
00203 
00207   void applyOpHcfIphys(
00208                        LevelData<FArrayBox>& phi,
00209                        LevelData<FArrayBox>& LOfPhi
00210                        );
00211 
00213 
00215   void CFInterp(
00216                 LevelData<FArrayBox>& phi,
00217                 const LevelData<FArrayBox>& phiCoarse
00218                 );
00219 
00221 
00223   void homogeneousCFInterp(LevelData<FArrayBox>& phi);
00224 
00226 
00228   void setDomainGhostBC(const DomainGhostBC& a_dombcin);
00229 
00231 
00234   void setBottomSmoother(const BaseBottomSmoother& a_bottomSmoother);
00235 
00237 
00239   void
00240   homogeneousCFInterp(LevelData<FArrayBox>& phif,
00241                       const DataIndex& a_datIndex,
00242                       int idir,
00243                       Side::LoHiSide hiorlo);
00244 
00246 
00248   void bottomSmoother(LevelData<FArrayBox>& phi,
00249                       const LevelData<FArrayBox>& rhs);
00250 
00252   bool isDefined() const;
00253 
00255 
00260   void getFlux(
00261                FArrayBox& flux,
00262                const FArrayBox& data,
00263                const DataIndex& a_datInd,
00264                int dir);
00265 
00267   virtual void setConvergenceMetric(Real a_metric, int a_comp);
00268 
00269 protected:
00273   DomainGhostBC m_domghostbc;
00274 
00278   ProblemDomain m_domain;
00279 
00283   DisjointBoxLayout m_grids;
00284 
00289   Copier m_exchangeCopier;
00290 
00295   DisjointBoxLayout m_baseBA;
00296 
00300   int m_refRatio;
00301 
00305   Real m_dxLevel;
00306 
00310   Real m_dxCrse;
00311 
00315   int m_ncomp;
00316 
00321   QuadCFInterp m_quadCFI;
00322 
00324 
00327   BaseBottomSmoother* m_bottomSmootherPtr;
00328 
00332   bool m_isDefined;
00333 
00337   bool m_isBCDefined;
00338 
00342   bool m_ihcfiEnabled;
00343 
00347   bool m_hcoeffDefined;
00348 
00352   LayoutData<CFIVS> m_loCFIVS[SpaceDim];
00356   LayoutData<CFIVS> m_hiCFIVS[SpaceDim];
00357 
00361   Real m_helmCoeff;
00362 
00366   Real m_alphaCoeff;
00367 
00368 private:
00372   void levelGSRB(LevelData<FArrayBox>&       a_phi,
00373                  const LevelData<FArrayBox>& a_rhs);
00374 
00375 //  void interpOnIVS(LevelData<FArrayBox>& a_phif,
00376 //                   const FArrayBox&      a_phistar,
00377 //                   const DataIndex&      a_datInd,
00378 //                   const int             a_idir,
00379 //                   const Side::LoHiSide  a_hiorlo,
00380 //                   const IntVectSet&     a_interpIVS);
00381 
00385   void interpOnIVSHomo(LevelData<FArrayBox>& a_phif,
00386                        const DataIndex&      a_datInd,
00387                        const int             a_idir,
00388                        const Side::LoHiSide  a_hiorlo,
00389                        const IntVectSet&     a_interpIVS);
00390 
00391   void clearMemory();
00392 
00393   void setDefaultValues();
00394 };
00395 
00396 #endif

Generated on Wed Jan 19 17:51:25 2005 for Chombo&INSwithParticles by doxygen1.2.16