Main Page   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 
00052 
00053 
00055 
00057   NodePoissonOp();
00058 
00060 
00066   virtual NodeLevelOp* new_levelop() const;
00067 
00068 
00070 
00072   ~NodePoissonOp();
00073 
00075 
00088   void define(const DisjointBoxLayout& a_grids,
00089               const DisjointBoxLayout* a_gridsCoarsePtr,
00090               Real  a_dx, 
00091               int a_refToCoarse,
00092               const ProblemDomain& a_domain,
00093               bool a_homogeneousOnly=false,
00094               int a_ncomp = 1);
00095 
00096   void define(const DisjointBoxLayout& a_grids,
00097               const DisjointBoxLayout* a_gridsCoarsePtr,
00098               Real  a_dx, 
00099               int a_refToCoarse,
00100               const Box& a_domain,
00101               bool a_homogeneousOnly=false,
00102               int a_ncomp = 1);
00103 
00105 
00113   void define(const NodeLevelOp* a_opfine,
00114               int a_refToFine);
00115 
00117               
00119 
00122   virtual bool isDefined() const;
00123 
00125 
00126   // /** set max number of bottomSmoother iterations
00127   // */
00128   // void setMaxIter(int a_maxIter);
00129 
00131 
00133   void setBottomSmoother(const NodeBaseBottomSmoother& a_bottomSmoother);
00134 
00136 
00138 
00147   void CFInterp(LevelData<NodeFArrayBox>& a_phi,
00148                 const LevelData<NodeFArrayBox>& a_phiCoarse,
00149                 bool a_inhomogeneous);
00150 
00151 
00153 
00159   void homogeneousCFInterp(LevelData<NodeFArrayBox>& a_phi);
00160 
00162 
00171   void smooth(LevelData<NodeFArrayBox>& a_phi,
00172               const LevelData<NodeFArrayBox>& a_rhs);
00173 
00174 
00176 
00188   void applyOpI(LevelData<NodeFArrayBox>& a_LofPhi,
00189                 LevelData<NodeFArrayBox>& a_phi,
00190                 const LevelData<NodeFArrayBox>* a_phiCoarsePtr);
00191   
00192 
00194 
00204   void applyOpH(LevelData<NodeFArrayBox>& a_LofPhi,
00205                 LevelData<NodeFArrayBox>& a_phi);
00206 
00207 
00209 
00221   void applyOpIcfHphys(LevelData<NodeFArrayBox>& a_LofPhi,
00222                        LevelData<NodeFArrayBox>& a_phi,
00223                        const LevelData<NodeFArrayBox>* a_phiCoarsePtr);
00224   
00226 
00236   void applyOpHcfIphys(LevelData<NodeFArrayBox>& a_LofPhi,
00237                        LevelData<NodeFArrayBox>& a_phi);
00238                        
00240 
00247   void bottomSmoother(LevelData<NodeFArrayBox>& a_phi,
00248                       const LevelData<NodeFArrayBox>& a_rhs);
00249 
00252 
00259   virtual void levelPreconditioner(LevelData<NodeFArrayBox>& a_phihat,
00260                                    const LevelData<NodeFArrayBox>& a_rhshat);
00261 
00263 
00265   void setDomainNodeBC(const DomainNodeBC& a_dombcin);
00266 
00268 
00276   void setInterpolationDegree(int a_interpolationDegree);
00277 
00279 
00293   void residualI(LevelData<NodeFArrayBox>& a_resid,
00294                  LevelData<NodeFArrayBox>& a_phi,
00295                  const LevelData<NodeFArrayBox>* a_phiCoarsePtr,
00296                  const LevelData<NodeFArrayBox>& a_rhs);
00297 
00299 
00311   void residualH(LevelData<NodeFArrayBox>& a_resid,
00312                  LevelData<NodeFArrayBox>& a_phi,
00313                  const LevelData<NodeFArrayBox>& a_rhs);
00314 
00316 
00328   void residualHcfIphys(LevelData<NodeFArrayBox>& a_resid,
00329                         LevelData<NodeFArrayBox>& a_phi,
00330                         const LevelData<NodeFArrayBox>& a_rhs);
00331 
00333 
00347   void residualIcfHphys(LevelData<NodeFArrayBox>& a_resid,
00348                         LevelData<NodeFArrayBox>& a_phi,
00349                         const LevelData<NodeFArrayBox>* a_phiCoarsePtr,
00350                         const LevelData<NodeFArrayBox>& a_rhs);
00351 
00352 protected:
00353 
00354   // boundary conditons
00355   DomainNodeBC m_dombc;
00356 
00357   // degree of interpolation at c/f interfaces:
00358   // 1 for (bi)linear, 2 for (bi)quadratic
00359   int m_interpolationDegree;
00360 
00361   // moved to NodeLevelOp
00362   // physical domain of current level
00363   // ProblemDomain m_domain;
00364 
00365   // nodes inside physical domain of current level
00366   ProblemDomain m_domainInteriorNodes;
00367 
00368   // the grids at the current level
00369   DisjointBoxLayout m_grids;
00370 
00371   // DisjointBoxLayout for next coarser level
00372   // this is not used if there is no coarser level
00373   DisjointBoxLayout m_gridsCoarse;
00374 
00375   // number of components
00376   int m_ncomp;
00377 
00378   // refinement ratio between this and the next coarser level
00379   int m_refToCoarse;
00380     
00381   //mesh spacing at this level
00382   Real m_dx;
00383 
00384   //mesh spacing at next coarser level
00385   Real m_dxCoarse;
00386 
00387   //has full define function been called?
00388   bool m_isDefined;
00389 
00390   //has bc been defined?
00391   bool m_isBCDefined;
00392 
00393   //is inhomogeneous CF interpolation possible?
00394   bool m_ihcfiEnabled;
00395 
00396   // m_loCFIVS, m_hiCFIVS used for figuring out which nodes lie
00397   // on interface with the next coarser level.
00398   LayoutData<NodeCFIVS> m_loCFIVS[SpaceDim];
00399   LayoutData<NodeCFIVS> m_hiCFIVS[SpaceDim];
00400 
00401   // weights for coarse/fine interpolation
00402   // Tuple<FArrayBox*, SpaceDim> m_wtLo, m_wtHi, m_wtC;
00403 
00404   // coarse-fine quadratic interpolation
00405   NodeQuadCFInterp m_qcfi;
00406 
00407   // bottom smoother object
00408   NodeBaseBottomSmoother* m_bottomSmootherPtr;
00409 
00410   // interior boundary nodes
00411   LayoutData< Vector<IntVectSet> > m_IVSV;
00412 
00413   // moved to NodeLevelOp
00414   // exterior boundary nodes
00415   // LayoutData< Vector<IntVectSet> > m_IVSVext;
00416 
00417 private:
00418   //internally useful functions
00419 
00420   void setCFIVS();
00421 
00422   void levelGSRB(LevelData<NodeFArrayBox>& a_phi, 
00423                  const LevelData<NodeFArrayBox>& a_rhs);
00424 
00425   void applyOpOnly(LevelData<NodeFArrayBox>& a_LofPhi,
00426                    const LevelData<NodeFArrayBox>& a_phi);
00427 
00428   // Does homogeneous coarse/fine interpolation.
00429   void homogeneousCFInterp(FArrayBox& a_phiFab,
00430                            const DataIndex& a_datInd, 
00431                            const int a_idir, 
00432                            const Side::LoHiSide a_hiorlo);
00433 
00434   void clearMemory();
00435 
00436   void setDefaultValues();
00437 
00438   void residualDiff(LevelData<NodeFArrayBox>& a_resid,
00439                     const LevelData<NodeFArrayBox>& a_rhs);
00440   
00441 };
00442 
00443 #endif

Generated on Tue Apr 15 18:34:51 2003 for AMRNodeElliptic by doxygen1.2.16