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

QuadCFInterp.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 #ifndef _QuadCFInterp_H_
00029 #define _QuadCFInterp_H_
00030 
00031 #include <iostream>
00032 #include <math.h>
00033 #include <assert.h>
00034 #include <stdlib.h>
00035 #include "REAL.H"
00036 #include "IntVect.H"
00037 #include "Box.H"
00038 #include "BaseFab.H"
00039 #include "DisjointBoxLayout.H"
00040 #include "LevelData.H"
00041 #include "FArrayBox.H"
00042 #include "QuadCFStencil.H"
00043 #include "ProblemDomain.H"
00044 
00046 
00050 class QuadCFInterp
00051 {
00052 public:
00053 
00055 
00057 
00062   QuadCFInterp(
00063                const DisjointBoxLayout& a_fineBoxes,
00064                const DisjointBoxLayout* a_coarBoxes,
00065                Real  a_dxFine, 
00066                int a_refRatio,
00067                int a_nComp,
00068                const Box& a_domf);
00069 
00071 
00076   QuadCFInterp(
00077                const DisjointBoxLayout& a_fineBoxes,
00078                const DisjointBoxLayout* a_coarBoxes,
00079                Real  a_dxFine, 
00080                int a_refRatio,
00081                int a_nComp,
00082                const ProblemDomain& a_domf);
00083 
00084 //XXX  ///
00085 //XXX  /**
00086 //XXX     Full define function.  makes all coarse-fine
00087 //XXX     information and sets internal variables 
00088 //XXX  */
00089 //XXX  void define(
00090 //XXX              const DisjointBoxLayout& a_fineBoxes,
00091 //XXX              const DisjointBoxLayout* a_coarBoxes,
00092 //XXX              Real  a_dxFine, 
00093 //XXX              int a_refRatio,
00094 //XXX              int a_nComp,
00095 //XXX              const Box& a_domf);
00096 
00098 
00102   void define(
00103               const DisjointBoxLayout& a_fineBoxes,
00104               const DisjointBoxLayout* a_coarBoxes,
00105               Real  a_dxFine, 
00106               int a_refRatio,
00107               int a_nComp,
00108               const ProblemDomain& a_domf);
00109 
00110 
00112 
00115   QuadCFInterp();
00116 
00118   ~QuadCFInterp();
00119 
00121 
00124   void clear();
00125 
00127 
00130   void coarseFineInterp(
00131                         LevelData<FArrayBox>& a_phif,
00132                         const LevelData<FArrayBox>& a_phic
00133                         );
00134 
00136 
00139   bool isDefined() const;
00140 
00141 
00142 protected:
00143   //boxes for coarse buffers
00144   BoxLayout m_loCoarBoxes[SpaceDim];
00145   BoxLayout m_hiCoarBoxes[SpaceDim];
00146 
00147   //fake level identifier.  
00148   int m_level;
00149 
00150   //number of components
00151   int m_nComp;
00152 
00153   //refinement ratio between levels
00154   int m_refRatio;
00155 
00156   //mesh spacing at fine level
00157   Real m_dxFine;
00158 
00159   //cfstencils on low-side faces
00160   //lives on fine input grid layout
00161   LayoutData<QuadCFStencil> m_loQCFS[SpaceDim];
00162 
00163   //cfstencils on high-side faces
00164   //lives on fine input grid layout
00165   LayoutData<QuadCFStencil> m_hiQCFS[SpaceDim];
00166 
00167   //buffer for coarse data at low edges of fine grids 
00168   BoxLayoutData<FArrayBox> m_hiCoarBuffer[SpaceDim];
00169 
00170   // copiers to copy data from inputCoarLayout to m_hiCoarBuffer
00171   Copier m_hiCoarCopiers[SpaceDim];
00172 
00173   //buffer for coarse data at high edges of fine grids 
00174   BoxLayoutData<FArrayBox> m_loCoarBuffer[SpaceDim];
00175 
00176   // copiers to copy data from inputCoarLayout to m_loCoarBuffer
00177   Copier m_loCoarCopiers[SpaceDim];
00178 
00179   DisjointBoxLayout m_inputFineLayout;
00180   DisjointBoxLayout m_inputCoarLayout;
00182   bool m_isDefined;
00183 
00184   ProblemDomain m_domainFine;
00185 protected:
00186 
00187   /* Coarse / Fine interpolation operator.
00188      using one sided differencing
00189      only at a particular face
00190   */
00191   void coarseFineInterp(BaseFab<Real> & a_phif,
00192                         const BaseFab<Real> & a_phic,
00193                         const QuadCFStencil& a_qcfs,
00194                         const Side::LoHiSide a_hiorlo,
00195                         const int a_idir,
00196                         const Interval& a_variables) const;
00197 
00198   //get extended phi (lives next to interpivs)
00199   void getPhiStar(BaseFab<Real> & a_phistar, 
00200                   const BaseFab<Real> & a_phic,
00201                   const QuadCFStencil& a_qcfs,
00202                   const Side::LoHiSide a_hiorlo,
00203                   const int a_idir,
00204                   const Interval& a_variables) const;
00205 
00206   //interpolate over correct intvectset
00207   void interpOnIVS(BaseFab<Real> & a_phif,
00208                    const BaseFab<Real> & a_phiStar, 
00209                    const QuadCFStencil& a_qcfs,
00210                    const Side::LoHiSide a_hiorlo,
00211                    const int a_idir,
00212                    const Interval& a_variables) const;
00213 };
00214 
00215 #endif

Generated on Wed Jun 2 13:53:35 2004 for Chombo&INSwithParticles by doxygen 1.3.2