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 
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 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 protected:
00185 
00186   /* Coarse / Fine interpolation operator.
00187      using one sided differencing
00188      only at a particular face
00189   */
00190   void coarseFineInterp(BaseFab<Real> & a_phif,
00191                         const BaseFab<Real> & a_phic,
00192                         const QuadCFStencil& a_qcfs,
00193                         const Side::LoHiSide a_hiorlo,
00194                         const int a_idir,
00195                         const Interval& a_variables) const;
00196 
00197   //get extended phi (lives next to interpivs)
00198   void getPhiStar(BaseFab<Real> & a_phistar, 
00199                   const BaseFab<Real> & a_phic,
00200                   const QuadCFStencil& a_qcfs,
00201                   const Side::LoHiSide a_hiorlo,
00202                   const int a_idir,
00203                   const Interval& a_variables) const;
00204 
00205   //interpolate over correct intvectset
00206   void interpOnIVS(BaseFab<Real> & a_phif,
00207                    const BaseFab<Real> & a_phiStar, 
00208                    const QuadCFStencil& a_qcfs,
00209                    const Side::LoHiSide a_hiorlo,
00210                    const int a_idir,
00211                    const Interval& a_variables) const;
00212 };
00213 
00214 #endif

Generated on Wed Apr 16 14:31:05 2003 for EBChombo by doxygen1.2.16