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

RegGhostBC.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 _REGGHOST_BC_H_
00030 #define _REGGHOST_BC_H_
00031 
00032 #include "Box.H"
00033 #include "FArrayBox.H"
00034 #include "REAL.H"
00035 #include "SPACE.H"
00036 #include "Tuple.H"
00037 #include "Interval.H"
00038 #include "Vector.H"
00039 #include "LoHiSide.H"
00040 #include "ProblemDomain.H"
00041 
00043 
00054 class RegBoxGhostBC
00055 {
00056 public:
00057   friend class RegDomainGhostBC;
00058 
00060   RegBoxGhostBC():m_components(-1,-1) {};
00061 
00063   RegBoxGhostBC(int            a_dir,
00064                 Side::LoHiSide a_sd);
00065 
00067   RegBoxGhostBC(int             a_dir,
00068                 Side::LoHiSide  a_sd,
00069                 const Interval& a_comps);
00070 
00072   virtual ~RegBoxGhostBC() {};
00073 
00074 protected:
00076   virtual RegBoxGhostBC* newBoxGhostBC() const = 0;
00077 
00079   void define(int            a_dir,
00080               Side::LoHiSide a_sd);
00081 
00083   void define(int             a_dir,
00084               Side::LoHiSide  a_sd,
00085               const Interval& a_comps);
00086 
00088   virtual void applyInhomogeneousBCs(FArrayBox& a_state, 
00089                                      const Box& a_domain, 
00090                                      Real       a_dx) const; 
00091 
00093   virtual void applyInhomogeneousBCs(FArrayBox&           a_state, 
00094                                      const ProblemDomain& a_domain, 
00095                                      Real                 a_dx) const; 
00096 
00098   virtual void applyHomogeneousBCs(FArrayBox& a_state, 
00099                                    const Box& a_domain, 
00100                                    Real       a_dx) const;
00101 
00103   virtual void applyHomogeneousBCs(FArrayBox&           a_state, 
00104                                    const ProblemDomain& a_domain, 
00105                                    Real                 a_dx) const;
00106 
00108   virtual void fillBCValues(FArrayBox& a_neumfac,
00109                             FArrayBox& a_dircfac,
00110                             FArrayBox& a_inhmval,
00111                             Real       a_dx,
00112                             const Box& a_domain) const = 0;
00113 
00114   virtual void applyBCs(const Box&       a_bcBox, 
00115                         FArrayBox&       a_state,
00116                         const FArrayBox& a_neumfac,
00117                         const FArrayBox& a_dircfac,
00118                         const FArrayBox& a_inhmval,
00119                         Real             a_dx) const;
00120 
00122   virtual void fillBCValues(FArrayBox&           a_neumfac,
00123                             FArrayBox&           a_dircfac,
00124                             FArrayBox&           a_inhmval,
00125                             Real                 a_dx,
00126                             const ProblemDomain& a_domain) const = 0;
00127 
00128   Side::LoHiSide m_side;
00129 
00130   int m_direction;
00131 
00132   Interval m_components;
00133 
00134 private:
00135   RegBoxGhostBC(const RegBoxGhostBC&):m_components(-1,-1) {};
00136   void operator= (const RegBoxGhostBC&) {};
00137 };
00138 
00140 
00151 class RegDomainGhostBC
00152 {
00153 public:
00155   RegDomainGhostBC();
00156 
00158   RegDomainGhostBC(const RegDomainGhostBC& a_dgbcin);
00159 
00161   ~RegDomainGhostBC();
00162 
00164   RegDomainGhostBC& operator= (const RegDomainGhostBC& a_dgbcin);
00165 
00167   const RegBoxGhostBC& operator() (int            a_direction,
00168                                    Side::LoHiSide a_side) const;
00169 
00171 
00175   void setBoxGhostBC(const RegBoxGhostBC& a_ghostBC);
00176 
00178 
00182   void applyHomogeneousBCs(FArrayBox& a_state,
00183                            const Box& a_domain, 
00184                            Real       a_dx) const;
00185 
00187 
00191   void applyHomogeneousBCs(FArrayBox&           a_state,
00192                            const ProblemDomain& a_domain, 
00193                            Real                 a_dx) const;
00194 
00196 
00200   void applyInhomogeneousBCs(FArrayBox& a_state,
00201                              const Box& a_domain, 
00202                              Real       a_dx) const;
00203 
00205 
00209   void applyInhomogeneousBCs(FArrayBox&           a_state,
00210                              const ProblemDomain& a_domain, 
00211                              Real                 a_dx) const;
00212 
00213 protected:
00215   bool isBCDefined(const int            a_dir,
00216                    const Side::LoHiSide a_side) const;
00217 
00218   void resetBoxGhostBC(const int            a_dir,
00219                        const Side::LoHiSide a_side);
00220 
00221   Tuple<RegBoxGhostBC*, SpaceDim> m_loGhostBC;
00222   Tuple<RegBoxGhostBC*, SpaceDim> m_hiGhostBC;
00223 };
00224 
00225 #endif

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