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

GhostBC.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, Mon, July 19, 1999
00028 
00029 #ifndef _GHOST_BC_H_
00030 #define _GHOST_BC_H_
00031 
00032 #include "Box.H"
00033 #include "FArrayBox.H"
00034 #include "REAL.H"
00035 #include "SPACE.H"
00036 #include "Tuple.H"
00037 
00038 #include "Interval.H"
00039 #include "Vector.H"
00040 #include "LoHiSide.H"
00041 #include "ProblemDomain.H"
00042 
00044 
00055 class BoxGhostBC
00056 {
00057 public:
00058   friend class DomainGhostBC;
00059 
00061   virtual ~BoxGhostBC(){;}
00062 
00064   BoxGhostBC():m_components(-1,-1){};
00065 
00067   BoxGhostBC(int a_dir, Side::LoHiSide a_sd);
00068 
00069 
00071   BoxGhostBC(int a_dir, Side::LoHiSide a_sd, const Interval& a_comps);
00072 
00073 
00074 protected:
00075 
00077   virtual BoxGhostBC* new_boxghostbc() const = 0;
00078 
00080   void
00081   define(int a_dir, Side::LoHiSide a_sd);
00082 
00083 
00085   void
00086   define(int a_dir, Side::LoHiSide a_sd, const Interval& a_comps);
00087 
00089   virtual void
00090   applyInhomogeneousBCs(FArrayBox& a_state, 
00091                         const Box& a_domain, 
00092                         Real a_dx) const; 
00093 
00095   virtual void
00096   applyHomogeneousBCs( FArrayBox& a_state, 
00097                        const Box& domain, 
00098                        Real a_dx) const;
00099 
00100 
00102   virtual void
00103   applyInhomogeneousBCs(FArrayBox& a_state, 
00104                         const ProblemDomain& a_domain, 
00105                         Real a_dx) const; 
00106 
00108   virtual void
00109   applyHomogeneousBCs( FArrayBox& a_state, 
00110                        const ProblemDomain& a_domain, 
00111                        Real a_dx) const;
00112 
00114   virtual void
00115   fillBCValues(FArrayBox& a_neumfac,
00116                FArrayBox& a_dircfac,
00117                FArrayBox& a_inhmval,
00118                Real a_dx,
00119                const Box& domain) const = 0;
00120 
00121   virtual void
00122   applyBCs(const Box& a_bcbox, 
00123            FArrayBox& a_state,
00124            const FArrayBox& a_neumfac,
00125            const FArrayBox& a_dircfac,
00126            const FArrayBox& a_inhmval,
00127            Real a_dx) const;
00128 
00130   virtual void
00131   fillBCValues(FArrayBox& a_neumfac,
00132                FArrayBox& a_dircfac,
00133                FArrayBox& a_inhmval,
00134                Real a_dx,
00135                const ProblemDomain& domain) const = 0;
00136 
00137 
00138   Side::LoHiSide m_side;
00139   int m_direction;
00140   Interval m_components;
00141 
00142 private:
00143   BoxGhostBC(const BoxGhostBC&):m_components(-1,-1) {;}
00144   virtual void operator=(const BoxGhostBC&){;}
00145 };
00146 
00147 
00149 
00160 class DomainGhostBC
00161 {
00162 public:
00164   DomainGhostBC();
00165 
00167   ~DomainGhostBC();
00168 
00170 
00174   void
00175   setBoxGhostBC(const BoxGhostBC& ghost_bc);
00176 
00178   const BoxGhostBC&
00179   operator() (int direction, Side::LoHiSide side) const;
00180 
00182 
00186   void
00187   applyHomogeneousBCs(FArrayBox& state,
00188                       const Box& Domain, 
00189                       Real dx) const;
00190 
00192 
00196   void
00197   applyHomogeneousBCs(FArrayBox& state,
00198                       const ProblemDomain& Domain, 
00199                       Real dx) const;
00200 
00202 
00206   void
00207   applyInhomogeneousBCs(FArrayBox& state,
00208                         const Box& Domain, 
00209                         Real dx) const;
00210 
00211 
00213 
00217   void
00218   applyInhomogeneousBCs(FArrayBox& state,
00219                         const ProblemDomain& Domain, 
00220                         Real dx) const;
00221 
00223   DomainGhostBC& operator=(const DomainGhostBC&);
00224 
00226   DomainGhostBC(const DomainGhostBC&);
00227 protected:
00228 
00230   bool isBCDefined(const int a_dir, const Side::LoHiSide a_side) const;
00231   void resetBoxGhostBC(const int a_dir, const Side::LoHiSide a_side);
00232 
00233   Tuple<BoxGhostBC*, SpaceDim> m_loGhostBC;
00234   Tuple<BoxGhostBC*, SpaceDim> m_hiGhostBC;
00235 private:
00236 };
00237 
00238 #endif

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