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 _GHOSTBC_H_
00030 #define _GHOSTBC_H_
00031
00032 #include "Box.H"
00033 #include "FArrayBox.H"
00034 #include "REAL.H"
00035 #include "SPACE.H"
00036 #include "Tuple.H"
00037
00038 #include "Interval.H"
00039 #include "Vector.H"
00040 #include "LoHiSide.H"
00041 #include "ProblemDomain.H"
00042
00044
00054 class BoxGhostBC
00055 {
00056 public:
00057 friend class DomainGhostBC;
00058
00060 BoxGhostBC():m_components(-1,-1){};
00061
00063 virtual ~BoxGhostBC(){;}
00064
00066 BoxGhostBC(int a_dir,
00067 Side::LoHiSide a_sd);
00068
00070 BoxGhostBC(int a_dir,
00071 Side::LoHiSide a_sd,
00072 const Interval& a_comps);
00073
00074 protected:
00078 virtual BoxGhostBC* new_boxghostbc() const = 0;
00079
00083 void define(int a_dir,
00084 Side::LoHiSide a_sd);
00085
00087
00090 void define(int a_dir,
00091 Side::LoHiSide a_sd,
00092 const Interval& a_comps);
00093
00095
00100 virtual void applyInhomogeneousBCs(FArrayBox& a_state,
00101 const Box& a_domain,
00102 Real a_dx) const;
00103
00105
00110 virtual void applyHomogeneousBCs(FArrayBox& a_state,
00111 const Box& a_domain,
00112 Real a_dx) const;
00113
00115
00119 virtual void applyInhomogeneousBCs(FArrayBox& a_state,
00120 const ProblemDomain& a_domain,
00121 Real a_dx) const;
00122
00124
00128 virtual void applyHomogeneousBCs(FArrayBox& a_state,
00129 const ProblemDomain& a_domain,
00130 Real a_dx) const;
00131
00133
00136 virtual void fillBCValues(FArrayBox& a_neumfac,
00137 FArrayBox& a_dircfac,
00138 FArrayBox& a_inhmval,
00139 Real a_dx,
00140 const Box& a_domain) const = 0;
00141
00143
00148 virtual void applyBCs(const Box& a_bcbox,
00149 FArrayBox& a_state,
00150 const FArrayBox& a_neumfac,
00151 const FArrayBox& a_dircfac,
00152 const FArrayBox& a_inhmval,
00153 Real a_dx) const;
00154
00156
00163 virtual void fillBCValues(FArrayBox& a_neumfac,
00164 FArrayBox& a_dircfac,
00165 FArrayBox& a_inhmval,
00166 Real a_dx,
00167 const ProblemDomain& a_domain) const = 0;
00168
00172 Side::LoHiSide m_side;
00173
00177 int m_direction;
00178
00182 Interval m_components;
00183
00184 private:
00185 BoxGhostBC(const BoxGhostBC&):m_components(-1,-1) {;}
00186 virtual void operator=(const BoxGhostBC&){;}
00187 };
00188
00190
00201 class DomainGhostBC
00202 {
00203 public:
00205 DomainGhostBC();
00206
00208 ~DomainGhostBC();
00209
00211
00213 void setBoxGhostBC(const BoxGhostBC& a_ghostBC);
00214
00216 const BoxGhostBC& operator()(int a_direction,
00217 Side::LoHiSide a_side) const;
00218
00220
00222 void applyHomogeneousBCs(FArrayBox& a_state,
00223 const Box& a_domain,
00224 Real a_dx) const;
00225
00227
00229 void applyHomogeneousBCs(FArrayBox& a_state,
00230 const ProblemDomain& a_domain,
00231 Real a_dx) const;
00232
00234
00236 void applyInhomogeneousBCs(FArrayBox& a_state,
00237 const Box& a_domain,
00238 Real a_dx) const;
00239
00241
00243 void applyInhomogeneousBCs(FArrayBox& a_state,
00244 const ProblemDomain& a_domain,
00245 Real a_dx) const;
00246
00248 DomainGhostBC& operator=(const DomainGhostBC& a_dgbcin);
00249
00251 DomainGhostBC(const DomainGhostBC& a_dgbcin);
00252
00253 protected:
00257 bool isBCDefined(const int a_dir,
00258 const Side::LoHiSide a_side) const;
00259
00263 void resetBoxGhostBC(const int a_dir,
00264 const Side::LoHiSide a_side);
00265
00269 Tuple<BoxGhostBC*, SpaceDim> m_loGhostBC;
00273 Tuple<BoxGhostBC*, SpaceDim> m_hiGhostBC;
00274
00275 private:
00276 };
00277
00278 #endif