00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 // 00012 // PhysIBC.H 00013 // ============ 00014 // 00015 // Virtual base class through which a user specifies the initial and boundary 00016 // conditions for a hyperbolic system of PDEs. 00017 // 00018 00019 #ifndef _PHYSIBC_H_ 00020 #define _PHYSIBC_H_ 00021 00022 #include "FArrayBox.H" 00023 #include "REAL.H" 00024 #include "LevelData.H" 00025 #include "ProblemDomain.H" 00026 #include "NamespaceHeader.H" 00027 00028 /// Physical/domain initial and boundary conditions 00029 /** 00030 Virtual base class through which a user specifies the initial and 00031 boundary conditions for a hyperbolic system of PDEs. 00032 */ 00033 class PhysIBC 00034 { 00035 public: 00036 /// Constructor 00037 /** 00038 */ 00039 PhysIBC(); 00040 00041 /// Destructor 00042 /** 00043 */ 00044 virtual ~PhysIBC(); 00045 00046 /// Define the object 00047 /** 00048 */ 00049 virtual void define(/// problem domain index space 00050 const ProblemDomain& a_domain, 00051 /// grid spacing 00052 const Real& a_dx); 00053 00054 /// Factory method - this object is its own factory 00055 /** 00056 Return a pointer to a new PhysIBC object with m_isDefined = false (i.e., 00057 its define() must be called before it is used). 00058 */ 00059 virtual PhysIBC* new_physIBC() = 0; 00060 00061 /// Set up initial conditions 00062 /** 00063 */ 00064 virtual void initialize(/// conserved variables 00065 LevelData<FArrayBox>& a_U) = 0; 00066 00067 /// Set boundary primitive values 00068 /** 00069 */ 00070 virtual void primBC(/// primitive variables at face centers; this routine replaces values along boundary faces of domain 00071 FArrayBox& a_WGdnv, 00072 /// extrapolated primitive variables to a_side of cells in direction a_dir (cell-centered data) 00073 const FArrayBox& a_Wextrap, 00074 /// primitive variables at start of time step (cell-centered data) 00075 const FArrayBox& a_W, 00076 /// normal direction of the domain where boundary condition fluxes needed 00077 const int& a_dir, 00078 /// side of the domain where boundary condition fluxes needed 00079 const Side::LoHiSide& a_side, 00080 /// physical time of the problem, for time-varying boundary conditions 00081 const Real& a_time) = 0; 00082 00083 /// Set boundary slopes 00084 /** 00085 The boundary slopes in a_dW are already set to one-sided difference 00086 approximations. If this function doesn't change them, they will be 00087 used for the slopes at the boundaries. 00088 */ 00089 virtual 00090 void setBdrySlopes(/// face-centered differences of primitive variables 00091 FArrayBox& a_dW, 00092 /// primitive variables at start of time step (cell-centered data) 00093 const FArrayBox& a_W, 00094 /// normal direction of faces 00095 const int& a_dir, 00096 /// physical time of the problem, for time-varying boundary conditions 00097 const Real& a_time) = 0; 00098 00099 /// Adjust boundary fluxes to account for artificial viscosity 00100 /** 00101 */ 00102 virtual 00103 void artViscBC(/// face-centered flux, to be adjusted on boundary 00104 FArrayBox& a_F, 00105 /// cell-centered conserved variables 00106 const FArrayBox& a_U, 00107 /// face-centered divergence of cell-centered velocity 00108 const FArrayBox& a_divVel, 00109 /// normal direction of faces 00110 const int& a_dir, 00111 /// physical time of the problem, for time-varying boundary conditions 00112 const Real& a_time) = 0; 00113 00114 /// This function is called by primBC() to get boundary faces of a Box. 00115 virtual 00116 void getBoundaryFaces(/// face-centered box of boundary faces to fill in; subbox of a_dataFaceBox 00117 Box& a_boundaryBox, 00118 /// entire face-centered box 00119 const Box& a_dataFaceBox, 00120 /// normal direction of faces 00121 const int& a_dir, 00122 /// side of the domain where boundary faces needed 00123 const Side::LoHiSide& a_side); 00124 00125 protected: 00126 00127 // Has this object been defined 00128 bool m_isDefined; 00129 00130 // The current level's problem domain 00131 ProblemDomain m_domain; 00132 00133 // The current level's grid spacing 00134 Real m_dx; 00135 00136 private: 00137 00138 // Disallowed for all the usual reasons 00139 void operator=(const PhysIBC&); 00140 PhysIBC(const PhysIBC&); 00141 }; 00142 00143 #include "NamespaceFooter.H" 00144 #endif