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);
00078 
00080 
00082   ~NodeQuadCFInterp();
00083 
00085 
00099   void define(const DisjointBoxLayout& a_grids,
00100               Real a_dx,
00101               const ProblemDomain& a_domain,
00102               const LayoutData<NodeCFIVS>* const a_loCFIVS,
00103               const LayoutData<NodeCFIVS>* const a_hiCFIVS,
00104               int a_refToCoarse,
00105               int a_interpolationDegree = 2,
00106               int a_ncomp = 1);
00107 
00108   void define(const DisjointBoxLayout& a_grids,
00109               Real a_dx,
00110               const Box& a_domain,
00111               const LayoutData<NodeCFIVS>* const a_loCFIVS,
00112               const LayoutData<NodeCFIVS>* const a_hiCFIVS,
00113               int a_refToCoarse,
00114               int a_interpolationDegree = 2,
00115               int a_ncomp = 1);
00116 
00118 
00122   void setDomainNodeBC(const DomainNodeBC& a_dombcIn);
00123 
00124 
00126               
00128 
00131   bool isDefined() const;
00132 
00133 
00135 
00137 
00146   void coarseFineInterp(LevelData<NodeFArrayBox>& a_phiFine,
00147                         const LevelData<NodeFArrayBox>& a_phiCoarse,
00148                         bool a_inhomogeneous);
00149 
00150 
00151 protected:
00152 
00153   // the grids at the current level (the finest level)
00154   DisjointBoxLayout m_grids;
00155 
00156   // number of components
00157   int m_ncomp;
00158 
00159   // refinement ratio between this and the next coarser level
00160   int m_refToCoarse;
00161     
00162   // the number of coarsenings to be done:  this is log2(m_refToCoarse).
00163   int m_coarsenings;
00164 
00165   //has full define function been called?
00166   bool m_isDefined;
00167 
00168   // has boundary condition been defined?
00169   bool m_isBCDefined;
00170 
00171   // mesh spacing at this (fine) level
00172   Real m_dx;
00173 
00174   // mesh spacing at coarsest level refined by 2
00175   Real m_dxPenultimate;
00176 
00177   // domain of coarsest level refined by 2
00178   ProblemDomain m_domainPenultimate;
00179 
00180   // boundary conditions
00181   DomainNodeBC m_dombc;
00182 
00183   // data at intermediate coarsening levels.  length m_coarsenings-1.
00184   Vector< LevelData<NodeFArrayBox>* > m_inter;
00185 
00186   // vector of interpolating objects.  length m_coarsenings.
00187   // m_qcfi2[i] averages refined versions of the SAME grids if i > 1,
00188   // and in general DIFFERENT grids if i == 0.
00189   Vector< NodeQuadCFInterp2* > m_qcfi2;
00190 
00191   // at intermediate levels, when refinement ratio > 2,
00192   // these are used for figuring out which nodes lie on interface with 
00193   // next coarser level.
00194   Vector< LayoutData<NodeCFIVS>* > m_loCFIVScoarser;
00195   Vector< LayoutData<NodeCFIVS>* > m_hiCFIVScoarser;
00196 
00197 private:
00198   //internally useful functions
00199 
00200   void clearMemory();
00201 
00202   void setDefaultValues();
00203 };
00204 
00205 #endif

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