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

EBQuadCFInterp.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 // dtgraves fri, sept 14, 2001
00028 
00029 #ifndef _EB_QUAD_CF_INTERP_H_
00030 #define _EB_QUAD_CF_INTERP_H_
00031 
00032 #include "REAL.H"
00033 #include "FArrayBox.H"
00034 #include "LevelData.H"
00035 #include "DisjointBoxLayout.H"
00036 #include "EBISLayout.H"
00037 #include "EBCellFAB.H"
00038 #include "Interval.H"
00039 #include "Stencils.H"
00040 #include "QuadCFStencil.H"
00041 #include "BaseIVFAB.H"
00042 
00044 
00049 class EBQuadCFInterp
00050 {
00051 public:
00053 
00056   EBQuadCFInterp();
00057 
00059   ~EBQuadCFInterp();
00060 
00062 
00075   EBQuadCFInterp(const DisjointBoxLayout& a_dblFine,
00076                  const DisjointBoxLayout& a_dblCoar,
00077                  const EBISLayout& a_ebislFine,
00078                  const EBISLayout& a_ebislCoar,
00079                  const Box& a_domainCoar,
00080                  const int& a_nref,
00081                  const int& a_nvar);
00082 
00084 
00096   void define(const DisjointBoxLayout& a_dblFine,
00097               const DisjointBoxLayout& a_dblCoar,
00098               const EBISLayout& a_ebislFine,
00099               const EBISLayout& a_ebislCoar,
00100               const Box& a_domainCoar,
00101               const int& a_nref,
00102               const int& a_nvar);
00103 
00105 
00118   void
00119   interpolate(LevelData<EBCellFAB>& a_fineData,
00120               const LevelData<EBCellFAB>& a_coarData,
00121               const Interval& a_variables);          
00122 
00123   bool isDefined() const;
00124 protected:
00125 
00126   /* Coarse / Fine interpolation operator.
00127      using one sided differencing
00128      only at a particular face
00129   */
00130   void regCFInterp(BaseFab<Real> & a_phif,
00131                    const BaseFab<Real> & a_phic,
00132                    const QuadCFStencil& a_qcfs,
00133                    const Side::LoHiSide a_hiorlo,
00134                    const int& a_idir,
00135                    const Interval& a_variables) const;
00136 
00137   void irrCFInterp(EBCellFAB& a_phif,
00138                    const EBCellFAB& a_phic,
00139                    const DataIndex& a_datInd,
00140                    const Interval& a_variables) const;
00141 
00142   //get extended phi (lives next to interpivs)
00143   void getPhiStar(BaseFab<Real> & a_phistar, 
00144                   const BaseFab<Real> & a_phic,
00145                   const QuadCFStencil& a_qcfs,
00146                   const Side::LoHiSide a_hiorlo,
00147                   const int& a_idir,
00148                   const Interval& a_variables) const;
00149 
00150   //interpolate over correct intvectset
00151   void interpOnIVS(BaseFab<Real> & a_phif,
00152                    const BaseFab<Real> & a_phiStar, 
00153                    const QuadCFStencil& a_qcfs,
00154                    const Side::LoHiSide a_hiorlo,
00155                    const int& a_idir,
00156                    const Interval& a_variables) const;
00157 
00158   
00159   bool extractFromSten(Real& a_value,
00160                        const VoFStencil& a_vofsten,
00161                        const EBCellFAB& a_coarData,
00162                        const int& ivar) const;
00163 
00164   void  makeStencils();
00165 
00166   //number of components
00167   int m_nComp;
00168 
00169   //refinement ratio between levels
00170   int m_refRat;
00171 
00172   //cfstencils on low-side faces
00173   //lives on fine input grid layout
00174   LayoutData<QuadCFStencil> m_loQCFS[SpaceDim];
00175 
00176   //cfstencils on high-side faces
00177   //lives on fine input grid layout
00178   LayoutData<QuadCFStencil> m_hiQCFS[SpaceDim];
00179 
00180   //buffer for coarse data 
00181   //lives on fine proc layout (coarsened fine grids with ghost)
00182   LevelData<EBCellFAB> m_coarBuffer;
00183 
00184   // big ebisl commentary 
00185   //(not a big commentary. a commentary about a big ebisl):
00186   //this is the ebisl for the buffers.  This could be done
00187   //with a 2*SpaceDim smaller layouts but that would be
00188   //more complicated and (i suspect) more expensive
00189   //in terms of communication ---not obvious since
00190   //this makes a bigger ebisl 
00191   EBISLayout        m_coarsenedFineEBISL;
00192   DisjointBoxLayout m_coarsenedFineGrids;
00193 
00194   //stored inputs
00195   DisjointBoxLayout m_inputFineGrids;
00196   DisjointBoxLayout m_inputCoarGrids;
00197   EBISLayout        m_inputFineEBISL;
00198   EBISLayout        m_inputCoarEBISL;
00199   Box m_domainCoar;
00200   Box m_domainFine;
00201 
00203   bool m_isDefined;
00204 
00205   //these are the stencils for the derivatives
00206   //only on irregular cells inside the coarse-fine interface.
00207   //lives in the coarse index space
00208   LayoutData<BaseIVFAB<VoFStencil> >  m_stencils[SpaceDim];
00209 
00210   //These are the cells on the coarse/fine interface
00211   //that are irregular.
00212   //These are in the fine index space.  
00213   LayoutData<IntVectSet>  m_irregRegions;
00214 
00215 private:  
00216   //disallowed for all the usual reasons
00217   EBQuadCFInterp(const EBQuadCFInterp& ebcin)
00218   {
00219     MayDay::Error("ebqcfi 2 invalid operator");
00220   }
00221   void operator=(const EBQuadCFInterp& fabin)
00222   {
00223     MayDay::Error("ebqcfi 3 invalid operator");
00224   }
00225 };
00226 
00227 #endif

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