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

NodeMaskPoissonOp.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 // NodeMaskPoissonOp.H
00029 // based on PoissonOp by DTGraves, Weds, July 21, 1999
00030 // NodePoissonOp by petermc, Tue, Dec 12, 2000
00031 // petermc, 22 Jun 2001 for mask
00032 // petermc, 17 Dec 2001 added m_IVSVext
00033 
00034 #ifndef NODEMASKPOISSONOP_H
00035 #define NODEMASKPOISSONOP_H
00036 
00037 #include "NodeMaskLevelOp.H"
00038 #include <cmath>
00039 #include <cstdlib>
00040 #include "BaseFab.H"
00041 #include "NodeCFIVS.H"
00042 #include "NodeBC.H"
00043 #include "NodeQuadCFInterp.H"
00044 #include "NodeMaskBaseBottomSmoother.H"
00045 #include "LoHiSide.H"
00046 
00048 class NodeMaskPoissonOp: public NodeMaskLevelOp
00051 {
00052 public:
00053 
00055 
00056 
00058 
00060   NodeMaskPoissonOp();
00061 
00063 
00069   virtual NodeMaskLevelOp* new_levelop() const;
00070 
00071 
00073 
00075   ~NodeMaskPoissonOp();
00076 
00078 
00092   void define(const DisjointBoxLayout& a_grids,
00093               const DisjointBoxLayout* a_gridsCoarsePtr,
00094               Real  a_dx, 
00095               int a_refToCoarse,
00096               const ProblemDomain& a_domain,
00097               bool a_homogeneousOnly=false,
00098               int a_ncomp = 1);
00099 
00100   void define(const DisjointBoxLayout& a_grids,
00101               const DisjointBoxLayout* a_gridsCoarsePtr,
00102               Real  a_dx, 
00103               int a_refToCoarse,
00104               const Box& a_domain,
00105               bool a_homogeneousOnly=false,
00106               int a_ncomp = 1);
00107 
00109 
00117   void define(const NodeMaskLevelOp* a_opfine,
00118               int a_refToFine);
00119 
00121               
00123 
00126   virtual bool isDefined() const;
00127 
00129 
00130   // ///
00131   // /** set max number of bottomSmoother iterations
00132   // */
00133   // void setMaxIter(int a_maxIter);
00134 
00136 
00138   void setBottomSmoother(const NodeMaskBaseBottomSmoother& a_bottomSmoother);
00139 
00141 
00143 
00152   void CFInterp(LevelData<NodeFArrayBox>& a_phi,
00153                 const LevelData<NodeFArrayBox>& a_phiCoarse,
00154                 bool a_inhomogeneous);
00155 
00156 
00158 
00164   void homogeneousCFInterp(LevelData<NodeFArrayBox>& a_phi);
00165 
00167 
00176   void smooth(LevelData<NodeFArrayBox>& a_phi,
00177               const LevelData<NodeFArrayBox>& a_rhs);
00178 
00179 
00181 
00193   void applyOpI(LevelData<NodeFArrayBox>& a_LofPhi,
00194                 LevelData<NodeFArrayBox>& a_phi,
00195                 const LevelData<NodeFArrayBox>* a_phiCoarsePtr);
00196   
00197 
00199 
00209   void applyOpH(LevelData<NodeFArrayBox>& a_LofPhi,
00210                 LevelData<NodeFArrayBox>& a_phi);
00211 
00212 
00214 
00226   void applyOpIcfHphys(LevelData<NodeFArrayBox>& a_LofPhi,
00227                        LevelData<NodeFArrayBox>& a_phi,
00228                        const LevelData<NodeFArrayBox>* a_phiCoarsePtr);
00229   
00231 
00241   void applyOpHcfIphys(LevelData<NodeFArrayBox>& a_LofPhi,
00242                        LevelData<NodeFArrayBox>& a_phi);
00243                        
00245 
00252   void bottomSmoother(LevelData<NodeFArrayBox>& a_phi,
00253                       const LevelData<NodeFArrayBox>& a_rhs);
00254 
00256 
00263   virtual void levelPreconditioner(LevelData<NodeFArrayBox>& a_phihat,
00264                                    const LevelData<NodeFArrayBox>& a_rhshat);
00265 
00267 
00269   void setDomainNodeBC(const DomainNodeBC& a_dombcin);
00270 
00272 
00280   void setInterpolationDegree(int a_interpolationDegree);
00281 
00283 
00297   void residualI(LevelData<NodeFArrayBox>& a_resid,
00298                  LevelData<NodeFArrayBox>& a_phi,
00299                  const LevelData<NodeFArrayBox>* a_phiCoarsePtr,
00300                  const LevelData<NodeFArrayBox>& a_rhs);
00301 
00303 
00315   void residualH(LevelData<NodeFArrayBox>& a_resid,
00316                  LevelData<NodeFArrayBox>& a_phi,
00317                  const LevelData<NodeFArrayBox>& a_rhs);
00318 
00320 
00332   void residualHcfIphys(LevelData<NodeFArrayBox>& a_resid,
00333                         LevelData<NodeFArrayBox>& a_phi,
00334                         const LevelData<NodeFArrayBox>& a_rhs);
00335 
00337 
00351   void residualIcfHphys(LevelData<NodeFArrayBox>& a_resid,
00352                         LevelData<NodeFArrayBox>& a_phi,
00353                         const LevelData<NodeFArrayBox>* a_phiCoarsePtr,
00354                         const LevelData<NodeFArrayBox>& a_rhs);
00355 
00356 protected:
00357 
00358   // physical boundary conditions
00359   DomainNodeBC m_dombc;
00360 
00361   // degree of interpolation at c/f interfaces:
00362   // 1 for (bi)linear, 2 for (bi)quadratic
00363   int m_interpolationDegree;
00364 
00365   // moved to NodeLevelOp
00366   // physical domain of current level
00367   // ProblemDomain m_domain;
00368 
00369   // nodes inside physical domain of current level
00370   ProblemDomain m_domainInteriorNodes;
00371 
00372   // the grids at the current level
00373   DisjointBoxLayout m_grids;
00374 
00375   // surrounding nodes of the grids
00376   BoxLayout m_gridsNodes;
00377 
00378   // DisjointBoxLayout for next coarser level
00379   // this is not used if there is no coarser level
00380   DisjointBoxLayout m_gridsCoarse;
00381   
00382   // number of components
00383   int m_ncomp;
00384 
00385   // refinement ratio between this and the next coarser level
00386   int m_refToCoarse;
00387     
00388   //mesh spacing at this level
00389   Real m_dx;
00390 
00391   //mesh spacing at next coarser level
00392   Real m_dxCoarse;
00393 
00394   //has full define function been called?
00395   bool m_isDefined;
00396 
00397   //has bc been defined?
00398   bool m_isBCDefined;
00399 
00400   //is inhomogeneous CF interpolation possible?
00401   bool m_ihcfiEnabled;
00402 
00403   // m_loCFIVS, m_hiCFIVS used for figuring out which nodes lie
00404   // on interface with the next coarser level.
00405   LayoutData<NodeCFIVS> m_loCFIVS[SpaceDim];
00406   LayoutData<NodeCFIVS> m_hiCFIVS[SpaceDim];
00407 
00408   // weights for coarse/fine interpolation
00409   // Tuple<FArrayBox*, SpaceDim> m_wtLo, m_wtHi, m_wtC;
00410 
00411   // coarse-fine quadratic interpolation
00412   NodeQuadCFInterp m_qcfi;
00413 
00414   // bottom smoother object
00415   NodeMaskBaseBottomSmoother* m_bottomSmootherPtr;
00416 
00417   // interior boundary nodes
00418   LayoutData< Vector<IntVectSet> > m_IVSV;
00419 
00420   // moved to NodeLevelOp
00421   // exterior boundary nodes
00422   // LayoutData< Vector<IntVectSet> > m_IVSVext;
00423 
00424   BoxLayoutData< BaseFab<int> > m_mask;
00425 
00426   BoxLayoutData< BaseFab<Real> > m_coeffs;
00427 
00428 private:
00429   //internally useful functions
00430 
00431   void setCFIVS();
00432 
00433   void getMask();
00434 
00435   void levelGSRB(LevelData<NodeFArrayBox>& a_phi, 
00436                  const LevelData<NodeFArrayBox>& a_rhs);
00437 
00438   void applyOpOnly(LevelData<NodeFArrayBox>& a_LofPhi,
00439                    const LevelData<NodeFArrayBox>& a_phi);
00440 
00441   // Does homogeneous coarse/fine interpolation.
00442   void homogeneousCFInterp(FArrayBox& a_phiFab,
00443                            const DataIndex& a_datInd, 
00444                            const int a_idir, 
00445                            const Side::LoHiSide a_hiorlo);
00446 
00447   void clearMemory();
00448 
00449   void setDefaultValues();
00450 
00451   void residualDiff(LevelData<NodeFArrayBox>& a_resid,
00452                     const LevelData<NodeFArrayBox>& a_rhs);
00453   
00454 };
00455 
00456 #endif

Generated on Tue Apr 15 18:31:55 2003 for AMRNodeElliptic by doxygen1.2.16