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

NodeBC.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 // NodeBC.H
00029 // adapted from GhostBC by DTGraves, Mon, July 19, 1999
00030 // petermc, 13 Feb 2001
00031 // petermc, 21 Oct 2002, removed m_inhomogeneous, which can be in
00032 // derived class of FaceNodeBC.
00033 
00034 #ifndef NODEBC_H
00035 #define NODEBC_H
00036 
00037 #include "ProblemDomain.H"
00038 #include "NodeFArrayBox.H"
00039 #include "REAL.H"
00040 #include "SPACE.H"
00041 #include "Tuple.H"
00042 #include "Interval.H"
00043 #include "Vector.H"
00044 #include "LoHiSide.H"
00045 
00047 
00056 class FaceNodeBC
00057 {
00058 public:
00059   friend class DomainNodeBC;
00060 
00062 
00064 
00066   FaceNodeBC():m_components(-1,-1){};
00067   
00069 
00071   FaceNodeBC(int a_dir, Side::LoHiSide a_sd);
00072 
00074   FaceNodeBC(int a_dir, Side::LoHiSide a_sd, const Interval& a_comps);
00075 
00077 
00079   virtual ~FaceNodeBC(){;}
00080 
00081 protected:
00082 
00084 
00086 
00089   virtual FaceNodeBC* new_boxBC() const = 0;
00090 
00092 
00094   void
00095   define(int a_dir, Side::LoHiSide a_sd);
00096 
00098   void
00099   define(int a_dir, Side::LoHiSide a_sd, const Interval& a_comps);
00100 
00102 
00104 
00106   virtual void
00107   applyInhomogeneousBCs(FArrayBox& a_state, 
00108                         const ProblemDomain& a_domain, 
00109                         Real a_dx) const; 
00110 
00111   virtual void
00112   applyInhomogeneousBCs(FArrayBox& a_state, 
00113                         const Box& a_domain, 
00114                         Real a_dx) const; 
00115 
00117 
00119   virtual void
00120   applyHomogeneousBCs(FArrayBox& a_state, 
00121                       const ProblemDomain& domain, 
00122                       Real a_dx) const;
00123   virtual void
00124   applyHomogeneousBCs(FArrayBox& a_state, 
00125                       const Box& domain, 
00126                       Real a_dx) const;
00127 
00129   virtual void
00130   applyEitherBCs(FArrayBox& a_state, 
00131                  const ProblemDomain& domain, 
00132                  Real a_dx,
00133                  bool a_homogeneous) const;
00134 
00135   virtual void
00136   applyEitherBCs(FArrayBox& a_state, 
00137                  const Box& domain, 
00138                  Real a_dx,
00139                  bool a_homogeneous) const;
00140 
00142 
00145   virtual void
00146   fillBCValues(FArrayBox& a_neumfac,
00147                FArrayBox& a_dircfac,
00148                FArrayBox& a_inhmval,
00149                Real a_dx,
00150                const ProblemDomain& domain) const = 0;
00151 
00152   virtual void
00153   fillBCValues(FArrayBox& a_neumfac,
00154                FArrayBox& a_dircfac,
00155                FArrayBox& a_inhmval,
00156                Real a_dx,
00157                const Box& domain) const = 0;
00158 
00160 
00162   virtual void
00163   applyBCs(const Box& a_bcbox, 
00164            FArrayBox& a_state,
00165            const FArrayBox& a_neumfac,
00166            const FArrayBox& a_dircfac,
00167            const FArrayBox& a_inhmval,
00168            Real a_dx) const;
00169 
00170   Side::LoHiSide m_side;
00171   int m_direction;
00172   Interval m_components;
00173 
00174 private:
00175   FaceNodeBC(const FaceNodeBC&):m_components(-1,-1) {;}
00176   virtual void operator=(const FaceNodeBC&){;}
00177 };
00178 
00179 
00181 
00191 class DomainNodeBC
00192 {
00193 public:
00194 
00196 
00198   DomainNodeBC();
00199 
00201   ~DomainNodeBC();
00202 
00204 
00206 
00209   const FaceNodeBC&
00210   operator() (int direction, Side::LoHiSide side) const;
00211 
00213 
00215 
00217   void
00218   setFaceNodeBC(const FaceNodeBC& a_bc);
00219 
00221 
00228   void
00229   applyHomogeneousBCs(NodeFArrayBox& a_state,
00230                       const ProblemDomain& a_domain, 
00231                       Real a_dx) const;
00232 
00233   void
00234   applyHomogeneousBCs(NodeFArrayBox& a_state,
00235                       const Box& a_domain, 
00236                       Real a_dx) const;
00237 
00239 
00246   void
00247   applyInhomogeneousBCs(NodeFArrayBox& a_state,
00248                         const ProblemDomain& a_domain, 
00249                         Real a_dx) const;
00250 
00251   void
00252   applyInhomogeneousBCs(NodeFArrayBox& a_state,
00253                         const Box& a_domain, 
00254                         Real a_dx) const;
00255 
00257   DomainNodeBC& operator=(const DomainNodeBC&);
00258 
00260   DomainNodeBC(const DomainNodeBC&);
00261 
00262 protected:
00263 
00265   bool isBCDefined(const int a_dir, const Side::LoHiSide a_side) const;
00266 
00267   void resetFaceNodeBC(const int a_dir, const Side::LoHiSide a_side);
00268 
00269   Tuple<FaceNodeBC*, SpaceDim> m_loBC;
00270   Tuple<FaceNodeBC*, SpaceDim> m_hiBC;
00271 
00272 private:
00273 };
00274 
00275 #endif

Generated on Tue Apr 15 18:31:55 2003 for AMRNodeElliptic by doxygen1.2.16