00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _NODEBC_H_
00018 #define _NODEBC_H_
00019
00020 #include "ProblemDomain.H"
00021 #include "NodeFArrayBox.H"
00022 #include "REAL.H"
00023 #include "SPACE.H"
00024 #include "Tuple.H"
00025 #include "Interval.H"
00026 #include "Vector.H"
00027 #include "LoHiSide.H"
00028 #include "NamespaceHeader.H"
00029
00031
00041 class FaceNodeBC
00042 {
00043 public:
00044 friend class DomainNodeBC;
00045
00050
00052
00054 FaceNodeBC():m_components(-1,-1){};
00055
00057
00060 FaceNodeBC(int a_dir, Side::LoHiSide a_sd);
00061
00063
00066 FaceNodeBC(int a_dir, Side::LoHiSide a_sd, const Interval& a_comps);
00067
00069
00071 virtual ~FaceNodeBC(){;}
00072
00073 protected:
00074
00076
00079 virtual FaceNodeBC* new_boxBC() const = 0;
00080
00082
00085 void
00086 define(int a_dir, Side::LoHiSide a_sd);
00087
00089
00092 void
00093 define(int a_dir, Side::LoHiSide a_sd, const Interval& a_comps);
00094
00101
00103
00105 virtual void
00106 applyInhomogeneousBCs(
00107 FArrayBox& a_state,
00109 const ProblemDomain& a_domain,
00111 Real a_dx) const;
00112
00114
00116 virtual void
00117 applyInhomogeneousBCs(
00118 FArrayBox& a_state,
00120 const Box& a_domain,
00122 Real a_dx) const;
00123
00125
00127 virtual void
00128 applyHomogeneousBCs(
00129 FArrayBox& a_state,
00131 const ProblemDomain& domain,
00133 Real a_dx) const;
00135
00137 virtual void
00138 applyHomogeneousBCs(
00139 FArrayBox& a_state,
00141 const Box& domain,
00143 Real a_dx) const;
00145
00147 virtual void
00148 applyEitherBCs(
00149 FArrayBox& a_state,
00151 const ProblemDomain& domain,
00153 Real a_dx,
00155 bool a_homogeneous) const;
00156
00158
00160 virtual void
00161 applyEitherBCs(
00162 FArrayBox& a_state,
00164 const Box& domain,
00166 Real a_dx,
00168 bool a_homogeneous) const;
00169
00171
00174 virtual void
00175 applyBCs(
00176 const Box& a_bcbox,
00178 FArrayBox& a_state,
00180 const FArrayBox& a_neumfac,
00182 const FArrayBox& a_dircfac,
00184 const FArrayBox& a_inhmval,
00186 Real a_dx) const;
00187
00194
00196
00202 virtual void
00203 fillBCValues(
00204 FArrayBox& a_neumfac,
00206 FArrayBox& a_dircfac,
00208 FArrayBox& a_inhmval,
00210 Real a_dx,
00212 const ProblemDomain& domain) const = 0;
00213
00215
00221 virtual void
00222 fillBCValues(
00223 FArrayBox& a_neumfac,
00225 FArrayBox& a_dircfac,
00227 FArrayBox& a_inhmval,
00229 Real a_dx,
00231 const Box& domain) const = 0;
00232
00237 Side::LoHiSide m_side;
00238
00241 int m_direction;
00242
00245 Interval m_components;
00246
00247 private:
00248 FaceNodeBC(const FaceNodeBC&):m_components(-1,-1) {;}
00249 virtual void operator=(const FaceNodeBC&){;}
00250 };
00251
00252
00254
00267 class DomainNodeBC
00268 {
00269 public:
00270
00275
00277
00280 DomainNodeBC();
00281
00283
00285 ~DomainNodeBC();
00286
00288
00290 DomainNodeBC& operator=(const DomainNodeBC&);
00291
00293
00295 DomainNodeBC(const DomainNodeBC&);
00296
00303
00305
00308 const FaceNodeBC&
00309 operator() (int direction, Side::LoHiSide side) const;
00310
00317
00319
00321 void
00322 setFaceNodeBC(const FaceNodeBC& a_bc);
00323
00330
00332
00334 void
00335 applyHomogeneousBCs(
00336 NodeFArrayBox& a_state,
00338 const ProblemDomain& a_domain,
00340 Real a_dx) const;
00341
00343
00345 void
00346 applyHomogeneousBCs(
00347 NodeFArrayBox& a_state,
00349 const Box& a_domain,
00351 Real a_dx) const;
00352
00354
00356 void
00357 applyInhomogeneousBCs(
00358 NodeFArrayBox& a_state,
00360 const ProblemDomain& a_domain,
00362 Real a_dx) const;
00363
00365
00367 void
00368 applyInhomogeneousBCs(
00369 NodeFArrayBox& a_state,
00371 const Box& a_domain,
00373 Real a_dx) const;
00374
00377 protected:
00378
00382 bool isBCDefined(int a_dir, const Side::LoHiSide a_side) const;
00383
00386 void resetFaceNodeBC(const int a_dir, const Side::LoHiSide a_side);
00387
00388 Tuple<FaceNodeBC*, SpaceDim> m_loBC;
00389 Tuple<FaceNodeBC*, SpaceDim> m_hiBC;
00390
00391 private:
00392 };
00393
00394 #include "NamespaceFooter.H"
00395
00396 #endif