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

NodePoissonOp.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 
00028 // NodePoissonOp.H
00029 // adapted from PoissonOp by DTGraves, Weds, July 21, 1999
00030 // petermc, Tue, Dec 12, 2000
00031 #ifndef NODEPOISSONOP_H
00032 #define NODEPOISSONOP_H
00033 
00034 #include "NodeLevelOp.H"
00035 #include <cmath>
00036 #include <cstdlib>
00037 #include "BaseFab.H"
00038 #include "NodeCFIVS.H"
00039 #include "NodeBC.H"
00040 #include "NodeQuadCFInterp.H"
00041 #include "NodeBaseBottomSmoother.H"
00042 #include "LoHiSide.H"
00043 
00045 class NodePoissonOp: public NodeLevelOp
00048 {
00049 public:
00050 
00055 
00057 
00059   NodePoissonOp();
00060 
00062 
00068   virtual NodeLevelOp* new_levelop() const;
00069 
00071 
00073   ~NodePoissonOp();
00074 
00076 
00080   void define(
00081               const DisjointBoxLayout& a_grids,
00083               const DisjointBoxLayout* a_gridsCoarsePtr,
00085               Real                     a_dx,
00087               int                      a_refToCoarse,
00089               const ProblemDomain&     a_domain,
00091               bool                     a_homogeneousOnly = false,
00093               int                      a_ncomp = 1,
00095               bool                     a_verbose = false);
00096 
00097 
00099 
00103   void define(
00104               const DisjointBoxLayout& a_grids,
00106               const DisjointBoxLayout* a_gridsCoarsePtr,
00108               Real                     a_dx,
00110               int                      a_refToCoarse,
00112               const Box&               a_domain,
00114               bool                     a_homogeneousOnly = false,
00116               int                      a_ncomp = 1,
00118               bool                     a_verbose = false);
00119 
00121 
00125   void define(
00126               const NodeLevelOp* a_opfine,
00128               int                a_refToFine);
00129 
00136               
00138 
00141   virtual bool isDefined() const;
00142 
00149 
00150   // /** set max number of bottomSmoother iterations
00151   // */
00152   // void setMaxIter(int a_maxIter);
00153 
00155 
00157   virtual void setVerbose( bool a_verbose );
00158 
00160 
00162   void setBottomSmoother(const NodeBaseBottomSmoother& a_bottomSmoother);
00163 
00165 
00167   void setDomainNodeBC(const DomainNodeBC& a_dombcin);
00168 
00170 
00177   void setInterpolationDegree(int a_interpolationDegree);
00178 
00185 
00187 
00191   void CFInterp(
00192                 LevelData<NodeFArrayBox>&       a_phi,
00194                 const LevelData<NodeFArrayBox>& a_phiCoarse,
00196                 bool                            a_inhomogeneous);
00197 
00199 
00202   void homogeneousCFInterp(
00203                            LevelData<NodeFArrayBox>& a_phi);
00204 
00211 
00213 
00222   void residualI(
00223                  LevelData<NodeFArrayBox>&       a_resid,
00225                  LevelData<NodeFArrayBox>&       a_phi,
00227                  const LevelData<NodeFArrayBox>* a_phiCoarsePtr,
00229                  const LevelData<NodeFArrayBox>& a_rhs);
00230 
00232 
00241   void residualH(
00242                  LevelData<NodeFArrayBox>&       a_resid,
00244                  LevelData<NodeFArrayBox>&       a_phi,
00246                  const LevelData<NodeFArrayBox>& a_rhs);
00247 
00249 
00258   void residualIcfHphys(
00259                         LevelData<NodeFArrayBox>&       a_resid,
00261                         LevelData<NodeFArrayBox>&       a_phi,
00263                         const LevelData<NodeFArrayBox>* a_phiCoarsePtr,
00265                         const LevelData<NodeFArrayBox>& a_rhs);
00266 
00268 
00277   void residualHcfIphys(
00278                         LevelData<NodeFArrayBox>&       a_resid,
00280                         LevelData<NodeFArrayBox>&       a_phi,
00282                         const LevelData<NodeFArrayBox>& a_rhs);
00283 
00290 
00292 
00300   void applyOpI(
00301                 LevelData<NodeFArrayBox>&       a_LofPhi,
00303                 LevelData<NodeFArrayBox>&       a_phi,
00305                 const LevelData<NodeFArrayBox>* a_phiCoarsePtr);
00306 
00308 
00316   void applyOpH(
00317                 LevelData<NodeFArrayBox>&       a_LofPhi,
00319                 LevelData<NodeFArrayBox>&       a_phi);
00320 
00322 
00330   void applyOpIcfHphys(
00331                        LevelData<NodeFArrayBox>&       a_LofPhi,
00333                        LevelData<NodeFArrayBox>&       a_phi,
00335                        const LevelData<NodeFArrayBox>* a_phiCoarsePtr);
00336 
00338 
00346   void applyOpHcfIphys(
00347                        LevelData<NodeFArrayBox>&       a_LofPhi,
00349                        LevelData<NodeFArrayBox>&       a_phi);
00350 
00357 
00359 
00367   void gradient(
00368                 LevelData<NodeFArrayBox>&       a_gradPhi,
00370                 LevelData<NodeFArrayBox>&       a_phi,
00372                 const LevelData<NodeFArrayBox>* a_phiCoarsePtr);
00373 
00380 
00382 
00387   void smooth(
00388               LevelData<NodeFArrayBox>&       a_phi,
00390               const LevelData<NodeFArrayBox>& a_rhs);
00391 
00393 
00397   void levelPreconditioner(
00398                            LevelData<NodeFArrayBox>&       a_phihat,
00400                            const LevelData<NodeFArrayBox>& a_rhshat);
00401 
00403 
00405   void bottomSmoother(
00406                       LevelData<NodeFArrayBox>&       a_phi,
00408                       const LevelData<NodeFArrayBox>& a_rhs);
00409 
00412 protected:
00413 
00416   DomainNodeBC m_dombc;
00417 
00420   int m_interpolationDegree;
00421 
00422   // moved to NodeLevelOp
00423   // physical domain of current level
00424   // ProblemDomain m_domain;
00425 
00428   ProblemDomain m_domainInteriorNodes;
00429 
00432   DisjointBoxLayout m_grids;
00433 
00436   Copier m_exchangeCopier;
00437 
00440   DisjointBoxLayout m_gridsCoarse;
00441 
00444   int m_ncomp;
00445 
00448   int m_refToCoarse;
00449     
00452   Real m_dx;
00453 
00456   Real m_dxCoarse;
00457 
00460   bool m_isDefined;
00461 
00464   bool m_isBCDefined;
00465 
00468   bool m_ihcfiEnabled;
00469 
00472   LayoutData<NodeCFIVS> m_loCFIVS[SpaceDim];
00473 
00476   LayoutData<NodeCFIVS> m_hiCFIVS[SpaceDim];
00477 
00478   // weights for coarse/fine interpolation
00479   // Tuple<FArrayBox*, SpaceDim> m_wtLo, m_wtHi, m_wtC;
00480 
00483   NodeQuadCFInterp m_qcfi;
00484 
00487   NodeBaseBottomSmoother* m_bottomSmootherPtr;
00488 
00491   LayoutData< Vector<IntVectSet> > m_IVSV;
00492 
00495   LayoutData< BitSet > m_IVSVfull;
00496 
00497   // moved to NodeLevelOp
00498   // exterior boundary nodes
00499   // LayoutData< Vector<IntVectSet> > m_IVSVext;
00500 
00501 private:
00502   //internally useful functions
00503 
00507   void setCFIVS();
00508 
00512   void levelGSRB(LevelData<NodeFArrayBox>& a_phi, 
00513                  const LevelData<NodeFArrayBox>& a_rhs);
00514 
00519   void applyOpOnly(LevelData<NodeFArrayBox>& a_LofPhi,
00520                    const LevelData<NodeFArrayBox>& a_phi);
00521 
00526   void gradientOnly(LevelData<NodeFArrayBox>& a_gradPhi,
00527                     const LevelData<NodeFArrayBox>& a_phi);
00528 
00532   void homogeneousCFInterp(FArrayBox& a_phiFab,
00533                            const DataIndex& a_datInd, 
00534                            const int a_idir, 
00535                            const Side::LoHiSide a_hiorlo);
00536 
00537   void clearMemory();
00538 
00539   void setDefaultValues();
00540 
00541   void residualDiff(LevelData<NodeFArrayBox>& a_resid,
00542                     const LevelData<NodeFArrayBox>& a_rhs);
00543   
00544 };
00545 
00546 #endif

Generated on Fri Jul 2 17:53:42 2004 for Chombo by doxygen 1.3.2