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 _GHOSTBC_H_
00030 #define _GHOSTBC_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 
00054 class BoxGhostBC
00055 {
00056 public:
00057   friend class DomainGhostBC;
00058 
00060   BoxGhostBC():m_components(-1,-1){};
00061 
00063   virtual ~BoxGhostBC(){;}
00064 
00066   BoxGhostBC(int            a_dir,
00067              Side::LoHiSide a_sd);
00068 
00070   BoxGhostBC(int             a_dir,
00071              Side::LoHiSide  a_sd,
00072              const Interval& a_comps);
00073 
00074 protected:
00078   virtual BoxGhostBC* new_boxghostbc() const = 0;
00079 
00083   void define(int            a_dir,
00084               Side::LoHiSide a_sd);
00085 
00087 
00090   void define(int             a_dir,
00091               Side::LoHiSide  a_sd,
00092               const Interval& a_comps);
00093 
00095 
00100   virtual void applyInhomogeneousBCs(FArrayBox& a_state, 
00101                                      const Box& a_domain, 
00102                                      Real       a_dx) const; 
00103 
00105 
00110   virtual void applyHomogeneousBCs(FArrayBox& a_state, 
00111                                    const Box& a_domain, 
00112                                    Real       a_dx) const;
00113 
00115 
00119   virtual void applyInhomogeneousBCs(FArrayBox&           a_state, 
00120                                      const ProblemDomain& a_domain, 
00121                                      Real                 a_dx) const; 
00122 
00124 
00128   virtual void applyHomogeneousBCs(FArrayBox&           a_state, 
00129                                    const ProblemDomain& a_domain, 
00130                                    Real                 a_dx) const;
00131 
00133 
00136   virtual void fillBCValues(FArrayBox& a_neumfac,
00137                             FArrayBox& a_dircfac,
00138                             FArrayBox& a_inhmval,
00139                             Real       a_dx,
00140                             const Box& a_domain) const = 0;
00141 
00143 
00148   virtual void applyBCs(const Box&       a_bcbox, 
00149                         FArrayBox&       a_state,
00150                         const FArrayBox& a_neumfac,
00151                         const FArrayBox& a_dircfac,
00152                         const FArrayBox& a_inhmval,
00153                         Real             a_dx) const;
00154 
00156 
00163   virtual void fillBCValues(FArrayBox&           a_neumfac,
00164                             FArrayBox&           a_dircfac,
00165                             FArrayBox&           a_inhmval,
00166                             Real                 a_dx,
00167                             const ProblemDomain& a_domain) const = 0;
00168 
00172   Side::LoHiSide m_side;
00173 
00177   int m_direction;
00178 
00182   Interval m_components;
00183 
00184 private:
00185   BoxGhostBC(const BoxGhostBC&):m_components(-1,-1) {;}
00186   virtual void operator=(const BoxGhostBC&){;}
00187 };
00188 
00190 
00201 class DomainGhostBC
00202 {
00203 public:
00205   DomainGhostBC();
00206 
00208   ~DomainGhostBC();
00209 
00211 
00213   void setBoxGhostBC(const BoxGhostBC& a_ghostBC);
00214 
00216   const BoxGhostBC& operator()(int            a_direction,
00217                                Side::LoHiSide a_side) const;
00218 
00220 
00222   void applyHomogeneousBCs(FArrayBox& a_state,
00223                            const Box& a_domain, 
00224                            Real       a_dx) const;
00225 
00227 
00229   void applyHomogeneousBCs(FArrayBox&           a_state,
00230                            const ProblemDomain& a_domain, 
00231                            Real                 a_dx) const;
00232 
00234 
00236   void applyInhomogeneousBCs(FArrayBox& a_state,
00237                              const Box& a_domain, 
00238                              Real       a_dx) const;
00239 
00241 
00243   void applyInhomogeneousBCs(FArrayBox&           a_state,
00244                              const ProblemDomain& a_domain, 
00245                              Real                 a_dx) const;
00246 
00248   DomainGhostBC& operator=(const DomainGhostBC& a_dgbcin);
00249 
00251   DomainGhostBC(const DomainGhostBC& a_dgbcin);
00252 
00253 protected:
00257   bool isBCDefined(const int            a_dir,
00258                    const Side::LoHiSide a_side) const;
00259 
00263   void resetBoxGhostBC(const int            a_dir,
00264                        const Side::LoHiSide a_side);
00265 
00269   Tuple<BoxGhostBC*, SpaceDim> m_loGhostBC;
00273   Tuple<BoxGhostBC*, SpaceDim> m_hiGhostBC;
00274 
00275 private:
00276 };
00277 
00278 #endif

Generated on Wed Jun 2 13:53:33 2004 for Chombo&INSwithParticles by doxygen 1.3.2