Main Page | Modules | Namespace List | 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 
00057 class FaceNodeBC
00058 {
00059 public:
00060   friend class DomainNodeBC;
00061 
00066 
00068 
00070   FaceNodeBC():m_components(-1,-1){};
00071   
00073 
00076   FaceNodeBC(int a_dir, Side::LoHiSide a_sd);
00077 
00079 
00082   FaceNodeBC(int a_dir, Side::LoHiSide a_sd, const Interval& a_comps);
00083 
00085 
00087   virtual ~FaceNodeBC(){;}
00088 
00089 protected:
00090 
00092 
00095   virtual FaceNodeBC* new_boxBC() const = 0;
00096 
00098 
00101   void
00102   define(int a_dir, Side::LoHiSide a_sd);
00103 
00105 
00108   void
00109   define(int a_dir, Side::LoHiSide a_sd, const Interval& a_comps);
00110 
00117 
00119 
00121   virtual void
00122   applyInhomogeneousBCs(
00123                         FArrayBox& a_state, 
00125                         const ProblemDomain& a_domain, 
00127                         Real a_dx) const; 
00128 
00130 
00132   virtual void
00133   applyInhomogeneousBCs(
00134                         FArrayBox& a_state, 
00136                         const Box& a_domain, 
00138                         Real a_dx) const; 
00139 
00141 
00143   virtual void
00144   applyHomogeneousBCs(
00145                       FArrayBox& a_state, 
00147                       const ProblemDomain& domain, 
00149                       Real a_dx) const;
00151 
00153   virtual void
00154   applyHomogeneousBCs(
00155                       FArrayBox& a_state, 
00157                       const Box& domain, 
00159                       Real a_dx) const;
00161 
00163   virtual void
00164   applyEitherBCs(
00165                  FArrayBox& a_state,
00167                  const ProblemDomain& domain, 
00169                  Real a_dx,
00171                  bool a_homogeneous) const;
00172 
00174 
00176   virtual void
00177   applyEitherBCs(
00178                  FArrayBox& a_state,
00180                  const Box& domain, 
00182                  Real a_dx,
00184                  bool a_homogeneous) const;
00185 
00187 
00190   virtual void
00191   applyBCs(
00192            const Box& a_bcbox,
00194            FArrayBox& a_state,
00196            const FArrayBox& a_neumfac,
00198            const FArrayBox& a_dircfac,
00200            const FArrayBox& a_inhmval,
00202            Real a_dx) const;
00203 
00210 
00212 
00218   virtual void
00219   fillBCValues(
00220                FArrayBox& a_neumfac,
00222                FArrayBox& a_dircfac,
00224                FArrayBox& a_inhmval,
00226                Real a_dx,
00228                const ProblemDomain& domain) const = 0;
00229 
00231 
00237   virtual void
00238   fillBCValues(
00239                FArrayBox& a_neumfac,
00241                FArrayBox& a_dircfac,
00243                FArrayBox& a_inhmval,
00245                Real a_dx,
00247                const Box& domain) const = 0;
00248 
00253   Side::LoHiSide m_side;
00254 
00257   int m_direction;
00258 
00261   Interval m_components;
00262 
00263 private:
00264   FaceNodeBC(const FaceNodeBC&):m_components(-1,-1) {;}
00265   virtual void operator=(const FaceNodeBC&){;}
00266 };
00267 
00268 
00270 
00283 class DomainNodeBC
00284 {
00285 public:
00286 
00291 
00293 
00296   DomainNodeBC();
00297 
00299 
00301   ~DomainNodeBC();
00302 
00304 
00306   DomainNodeBC& operator=(const DomainNodeBC&);
00307 
00309 
00311   DomainNodeBC(const DomainNodeBC&);
00312 
00319 
00321 
00324   const FaceNodeBC&
00325   operator() (int direction, Side::LoHiSide side) const;
00326 
00333 
00335 
00337   void
00338   setFaceNodeBC(const FaceNodeBC& a_bc);
00339 
00346 
00348 
00350   void
00351   applyHomogeneousBCs(
00352                       NodeFArrayBox& a_state,
00354                       const ProblemDomain& a_domain,
00356                       Real a_dx) const;
00357 
00359 
00361   void
00362   applyHomogeneousBCs(
00363                       NodeFArrayBox& a_state,
00365                       const Box& a_domain,
00367                       Real a_dx) const;
00368 
00370 
00372   void
00373   applyInhomogeneousBCs(
00374                         NodeFArrayBox& a_state,
00376                         const ProblemDomain& a_domain, 
00378                         Real a_dx) const;
00379 
00381 
00383   void
00384   applyInhomogeneousBCs(
00385                         NodeFArrayBox& a_state,
00387                         const Box& a_domain, 
00389                         Real a_dx) const;
00390 
00393 protected:
00394 
00398   bool isBCDefined(int a_dir, const Side::LoHiSide a_side) const;
00399 
00402   void resetFaceNodeBC(const int a_dir, const Side::LoHiSide a_side);
00403 
00404   Tuple<FaceNodeBC*, SpaceDim> m_loBC;
00405   Tuple<FaceNodeBC*, SpaceDim> m_hiBC;
00406 
00407 private:
00408 };
00409 
00410 #endif

Generated on Fri Jul 2 17:53:42 2004 for Chombo by doxygen 1.3.2