00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
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