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

QuadCFStencil.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 _QuadCFStencil_H_
00029 #define _QuadCFStencil_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 "DisjointBoxLayout.H"
00039 #include "FArrayBox.H"
00040 #include "IntVectSet.H"
00041 #include "CFStencil.H"
00042 #include "DerivStencil.H"
00043 
00044 
00045 
00047 
00052 class QuadCFStencil
00053 {
00054 
00055 public:
00057 
00059 
00067   Real computeSecondDerivative(
00068                                const BaseFab<Real> & a_phic, 
00069                                int a_derivdir, 
00070                                int a_ivar,
00071                                const IntVect& a_ivin, 
00072                                Real a_dx) const;
00073 
00075 
00083   Real computeFirstDerivative(
00084                               const BaseFab<Real> & a_phic, 
00085                               int a_derivdir, 
00086                               int a_ivar,
00087                               const IntVect& a_ivin, 
00088                               Real a_dx) const;
00089 
00091 
00101   Real computeMixedDerivative(
00102                               const BaseFab<Real> & a_phic, 
00103                               int a_ivar,
00104                               const IntVect& a_ivin, 
00105                               Real a_dx) const;
00106 
00107 
00109   QuadCFStencil();
00110 
00112   ~QuadCFStencil();
00113 
00115   QuadCFStencil(
00116                 const Box& a_fine_domain, 
00117                 const Box& a_grid,
00118                 const DisjointBoxLayout& a_fineBoxes, 
00119                 const DisjointBoxLayout& a_coarBoxes, 
00120                 int a_refRatio, 
00121                 int a_direction, 
00122                 Side::LoHiSide a_hiorlo);
00123 
00125   QuadCFStencil(
00126                 const ProblemDomain& a_fine_domain,
00127                 const Box& a_grid,
00128                 const DisjointBoxLayout& a_fineBoxes, 
00129                 const DisjointBoxLayout& a_coarBoxes, 
00130                 int a_refRatio, 
00131                 int a_direction, 
00132                 Side::LoHiSide a_hiorlo);
00133 
00135   void   define(
00136                 const Box& a_fine_domain, 
00137                 const Box& a_grid,
00138                 const DisjointBoxLayout& a_fineBoxes, 
00139                 const DisjointBoxLayout& a_coarBoxes, 
00140                 int a_refRatio, 
00141                 int a_direction, 
00142                 Side::LoHiSide a_hiorlo);
00143 
00145   void   define(
00146                 const ProblemDomain& a_fine_domain,
00147                 const Box& a_grid,
00148                 const DisjointBoxLayout& a_fineBoxes, 
00149                 const DisjointBoxLayout& a_coarBoxes, 
00150                 int a_refRatio, 
00151                 int a_direction, 
00152                 Side::LoHiSide a_hiorlo);
00153 
00155 
00157 
00160   bool isDefined() const;
00161 
00162 
00164 
00167   bool isEmpty() const
00168   {
00169     assert(m_baseCFS.isDefined());
00170     return m_baseCFS.isEmpty();
00171   }
00172 
00174 
00176   const IntVectSet& getFineIVS() const 
00177   {
00178     assert(m_baseCFS.isDefined());
00179     return m_baseCFS.getFineIVS();
00180   }
00181 
00182 
00184 
00186   const IntVectSet& getCoarIVS() const 
00187   {
00188     assert(m_baseCFS.isDefined());
00189     return m_baseCFS.getCoarIVS();
00190   }
00191 
00192 
00193 protected:
00194 
00195   //has define fcn been called?
00196   bool m_isDefined;
00197 
00198   //direction of face
00199   int m_direction;
00200 
00202 
00208   IntVectSet m_ivsStandard;
00209 
00211 
00215   IntVectSet m_ivsQuadd;
00216 
00223 
00224 
00228   BaseFab<DerivStencil> m_mixedSten;
00229 
00231 
00235   BaseFab<DerivStencil> m_second[SpaceDim];
00236 
00238 
00242   BaseFab<DerivStencil> m_firstD[SpaceDim];
00243 
00245 
00249   BaseFab<bool> m_dropOrd;
00250 
00252   CFStencil m_baseCFS;
00253 
00254 
00255 private:
00256   //internally useful but not for public consumption
00257 
00258   //
00259   void  setDefaultValues();
00260 
00261 
00262   /*
00263     add fab to the stencil.  For internal use only.
00264   */
00265   void addFabToSten(const BaseFab<Real> & fabin_a, 
00266                     DerivStencil&  sten_a);
00267 
00268   //there is no assignment operator for this class
00269   void operator= (const QuadCFStencil& cfs_in){};
00270   //there is no copy constructor for this class
00271   QuadCFStencil(const QuadCFStencil& cfs_in){};
00272 
00273 };
00274 
00275 
00276 
00277 
00278 #endif

Generated on Wed Apr 16 14:26:49 2003 for Chombo by doxygen1.2.16