Main Page | Modules | 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 
00085 
00089   void define(
00090               const DisjointBoxLayout& a_fineBoxes,
00091               const DisjointBoxLayout* a_coarBoxes,
00092               Real  a_dxFine, 
00093               int a_refRatio,
00094               int a_nComp,
00095               const ProblemDomain& a_domf);
00096 
00097 
00099 
00102   QuadCFInterp();
00103 
00105   ~QuadCFInterp();
00106 
00108 
00111   void clear();
00112 
00114 
00117   void coarseFineInterp(
00118                         LevelData<FArrayBox>& a_phif,
00119                         const LevelData<FArrayBox>& a_phic
00120                         );
00121 
00123 
00126   bool isDefined() const;
00127 
00128 
00129 protected:
00130   //boxes for coarse buffers
00131   BoxLayout m_loCoarBoxes[SpaceDim];
00132   BoxLayout m_hiCoarBoxes[SpaceDim];
00133 
00134   //fake level identifier.  
00135   int m_level;
00136 
00137   //number of components
00138   int m_nComp;
00139 
00140   //refinement ratio between levels
00141   int m_refRatio;
00142 
00143   //mesh spacing at fine level
00144   Real m_dxFine;
00145 
00146   //cfstencils on low-side faces
00147   //lives on fine input grid layout
00148   LayoutData<QuadCFStencil> m_loQCFS[SpaceDim];
00149 
00150   //cfstencils on high-side faces
00151   //lives on fine input grid layout
00152   LayoutData<QuadCFStencil> m_hiQCFS[SpaceDim];
00153 
00154   //buffer for coarse data at low edges of fine grids 
00155   BoxLayoutData<FArrayBox> m_hiCoarBuffer[SpaceDim];
00156 
00157   // copiers to copy data from inputCoarLayout to m_hiCoarBuffer
00158   Copier m_hiCoarCopiers[SpaceDim];
00159 
00160   //buffer for coarse data at high edges of fine grids 
00161   BoxLayoutData<FArrayBox> m_loCoarBuffer[SpaceDim];
00162 
00163   // copiers to copy data from inputCoarLayout to m_loCoarBuffer
00164   Copier m_loCoarCopiers[SpaceDim];
00165 
00166   DisjointBoxLayout m_inputFineLayout;
00167   DisjointBoxLayout m_inputCoarLayout;
00169   bool m_isDefined;
00170 
00171   ProblemDomain m_domainFine;
00172 protected:
00173 
00174   /* Coarse / Fine interpolation operator.
00175      using one sided differencing
00176      only at a particular face
00177   */
00178   void coarseFineInterp(BaseFab<Real> & a_phif,
00179                         const BaseFab<Real> & a_phic,
00180                         const QuadCFStencil& a_qcfs,
00181                         const Side::LoHiSide a_hiorlo,
00182                         const int a_idir,
00183                         const Interval& a_variables) const;
00184 
00185   //get extended phi (lives next to interpivs)
00186   void getPhiStar(BaseFab<Real> & a_phistar, 
00187                   const BaseFab<Real> & a_phic,
00188                   const QuadCFStencil& a_qcfs,
00189                   const Side::LoHiSide a_hiorlo,
00190                   const int a_idir,
00191                   const Interval& a_variables) const;
00192 
00193   //interpolate over correct intvectset
00194   void interpOnIVS(BaseFab<Real> & a_phif,
00195                    const BaseFab<Real> & a_phiStar, 
00196                    const QuadCFStencil& a_qcfs,
00197                    const Side::LoHiSide a_hiorlo,
00198                    const int a_idir,
00199                    const Interval& a_variables) const;
00200 };
00201 
00202 #endif

Generated on Fri Jul 2 17:53:43 2004 for Chombo by doxygen 1.3.2