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

NodeQuadCFInterp.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 // NodeQuadCFInterp.H
00029 // petermc, Mon, Apr 23, 2001
00030 // petermc, 1 Nov 2001, redid this so that it uses NodeQuadCFInterp2
00031 #ifndef NODEQUADCFINTERP_H
00032 #define NODEQUADCFINTERP_H
00033 
00034 #include <cmath>
00035 #include <cstdlib>
00036 #include "BaseFab.H"
00037 #include "NodeFArrayBox.H"
00038 #include "NodeCFIVS.H"
00039 #include "NodeBC.H"
00040 #include "NodeQuadCFInterp2.H"
00041 
00043 class NodeQuadCFInterp
00047 {
00048 public:
00049 
00051 
00053 
00055   NodeQuadCFInterp();
00056 
00058 
00061   NodeQuadCFInterp(const DisjointBoxLayout& a_grids,
00062                    Real a_dx,
00063                    const ProblemDomain& a_domain,
00064                    const LayoutData<NodeCFIVS>* const a_loCFIVS,
00065                    const LayoutData<NodeCFIVS>* const a_hiCFIVS,
00066                    int a_refToCoarse,
00067                    int a_interpolationDegree = 2,
00068                    int a_ncomp = 1);
00069 
00070   NodeQuadCFInterp(const DisjointBoxLayout& a_grids,
00071                    Real a_dx,
00072                    const Box& a_domain,
00073                    const LayoutData<NodeCFIVS>* const a_loCFIVS,
00074                    const LayoutData<NodeCFIVS>* const a_hiCFIVS,
00075                    int a_refToCoarse,
00076                    int a_interpolationDegree = 2,
00077                    int a_ncomp = 1);
00079 
00081   ~NodeQuadCFInterp();
00082 
00084 
00098   void define(const DisjointBoxLayout& a_grids,
00099               Real a_dx,
00100               const ProblemDomain& a_domain,
00101               const LayoutData<NodeCFIVS>* const a_loCFIVS,
00102               const LayoutData<NodeCFIVS>* const a_hiCFIVS,
00103               int a_refToCoarse,
00104               int a_interpolationDegree = 2,
00105               int a_ncomp = 1);
00106 
00107   void define(const DisjointBoxLayout& a_grids,
00108               Real a_dx,
00109               const Box& a_domain,
00110               const LayoutData<NodeCFIVS>* const a_loCFIVS,
00111               const LayoutData<NodeCFIVS>* const a_hiCFIVS,
00112               int a_refToCoarse,
00113               int a_interpolationDegree = 2,
00114               int a_ncomp = 1);
00115 
00117 
00121   void setDomainNodeBC(const DomainNodeBC& a_dombcIn);
00122 
00123 
00125               
00127 
00130   bool isDefined() const;
00131 
00132 
00134 
00136 
00145   void coarseFineInterp(LevelData<NodeFArrayBox>& a_phiFine,
00146                         const LevelData<NodeFArrayBox>& a_phiCoarse,
00147                         bool a_inhomogeneous);
00148 
00149 
00150 protected:
00151 
00152   // the grids at the current level (the finest level)
00153   DisjointBoxLayout m_grids;
00154 
00155   // number of components
00156   int m_ncomp;
00157 
00158   // refinement ratio between this and the next coarser level
00159   int m_refToCoarse;
00160     
00161   // the number of coarsenings to be done:  this is log2(m_refToCoarse).
00162   int m_coarsenings;
00163 
00164   //has full define function been called?
00165   bool m_isDefined;
00166 
00167   // has boundary condition been defined?
00168   bool m_isBCDefined;
00169 
00170   // mesh spacing at this (fine) level
00171   Real m_dx;
00172 
00173   // mesh spacing at coarsest level refined by 2
00174   Real m_dxPenultimate;
00175 
00176   // domain of coarsest level refined by 2
00177   ProblemDomain m_domainPenultimate;
00178 
00179   // boundary conditions
00180   DomainNodeBC m_dombc;
00181 
00182   // data at intermediate coarsening levels.  length m_coarsenings-1.
00183   Vector< LevelData<NodeFArrayBox>* > m_inter;
00184 
00185   // vector of interpolating objects.  length m_coarsenings.
00186   // m_qcfi2[i] averages refined versions of the SAME grids if i > 1,
00187   // and in general DIFFERENT grids if i == 0.
00188   Vector< NodeQuadCFInterp2* > m_qcfi2;
00189 
00190   // at intermediate levels, when refinement ratio > 2,
00191   // these are used for figuring out which nodes lie on interface with 
00192   // next coarser level.
00193   Vector< LayoutData<NodeCFIVS>* > m_loCFIVScoarser;
00194   Vector< LayoutData<NodeCFIVS>* > m_hiCFIVScoarser;
00195 
00196 private:
00197   //internally useful functions
00198 
00199   void clearMemory();
00200 
00201   void setDefaultValues();
00202 };
00203 
00204 #endif

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