00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _BASEDOMAINBC_H_
00012 #define _BASEDOMAINBC_H_
00013
00014 #include "LoHiSide.H"
00015 #include "RealVect.H"
00016 #include "FArrayBox.H"
00017
00018 #include "VolIndex.H"
00019 #include "EBCellFAB.H"
00020 #include "EBFaceFAB.H"
00021 #include "EBFluxFAB.H"
00022 #include "EBISLayout.H"
00023 #include "EBLevelGrid.H"
00024 #include "TensorCFInterp.H"
00025 #include "BaseBCFuncEval.H"
00026 #include "NamespaceHeader.H"
00027
00029
00031 class BaseDomainBC
00032 {
00033 public:
00035
00037 BaseDomainBC()
00038 {
00039
00040 };
00041
00043
00045 virtual ~BaseDomainBC() {};
00046
00048
00050 virtual void getFaceFlux(BaseFab<Real>& a_faceFlux,
00051 const BaseFab<Real>& a_phi,
00052 const RealVect& a_probLo,
00053 const RealVect& a_dx,
00054 const int& a_idir,
00055 const Side::LoHiSide& a_side,
00056 const DataIndex& a_dit,
00057 const Real& a_time,
00058 const bool& a_useHomogeneous) = 0;
00059
00061
00068 virtual int whichBC(int a_idir,
00069 Side::LoHiSide a_side)
00070 {
00071 return -777;
00072 }
00073
00074 virtual void getFaceFlux(BaseFab<Real>& a_faceFlux,
00075 const Real& a_betaFace,
00076 const BaseFab<Real>& a_phi,
00077 const RealVect& a_probLo,
00078 const RealVect& a_dx,
00079 const int& a_idir,
00080 const Side::LoHiSide& a_side,
00081 const DataIndex& a_dit,
00082 const Real& a_time,
00083 const bool& a_useHomogeneous)
00084 {
00085 getFaceFlux(a_faceFlux,
00086 a_phi,
00087 a_probLo,
00088 a_dx,
00089 a_idir,
00090 a_side,
00091 a_dit,
00092 a_time,
00093 a_useHomogeneous);
00094 }
00095
00096
00098
00102 virtual void getFaceFlux(Real& a_faceFlux,
00103 const VolIndex& a_vof,
00104 const int& a_comp,
00105 const EBCellFAB& a_phi,
00106 const RealVect& a_probLo,
00107 const RealVect& a_dx,
00108 const int& a_idir,
00109 const Side::LoHiSide& a_side,
00110 const DataIndex& a_dit,
00111 const Real& a_time,
00112 const bool& a_useHomogeneous) = 0;
00113
00114
00115 virtual void getFaceFlux(Real& a_faceFlux,
00116 const VolIndex& a_vof,
00117 const int& a_comp,
00118 const Real & a_betaFace,
00119 const EBCellFAB& a_phi,
00120 const RealVect& a_probLo,
00121 const RealVect& a_dx,
00122 const int& a_idir,
00123 const Side::LoHiSide& a_side,
00124 const DataIndex& a_dit,
00125 const Real& a_time,
00126 const bool& a_useHomogeneous)
00127 {
00128 getFaceFlux(a_faceFlux,
00129 a_vof,
00130 a_comp,
00131 a_phi,
00132 a_probLo,
00133 a_dx,
00134 a_idir,
00135 a_side,
00136 a_dit,
00137 a_time,
00138 a_useHomogeneous);
00139 }
00140
00142
00147 virtual void getFaceGradPhi(Real& a_faceFlux,
00148 const FaceIndex& a_face,
00149 const int& a_comp,
00150 const EBCellFAB& a_phi,
00151 const RealVect& a_probLo,
00152 const RealVect& a_dx,
00153 const int& a_idir,
00154 const Side::LoHiSide& a_side,
00155 const DataIndex& a_dit,
00156 const Real& a_time,
00157 const bool& a_useAreaFrac,
00158 const RealVect& a_centroid,
00159 const bool& a_useHomogeneous) = 0;
00160
00161
00162 virtual void getFaceGradPhi(Real& a_faceFlux,
00163 const FaceIndex& a_face,
00164 const int& a_comp,
00165 const Real& a_betaFace,
00166 const EBCellFAB& a_phi,
00167 const RealVect& a_probLo,
00168 const RealVect& a_dx,
00169 const int& a_idir,
00170 const Side::LoHiSide& a_side,
00171 const DataIndex& a_dit,
00172 const Real& a_time,
00173 const bool& a_useAreaFrac,
00174 const RealVect& a_centroid,
00175 const bool& a_useHomogeneous)
00176 {
00177 getFaceGradPhi(a_faceFlux,
00178 a_face,
00179 a_comp,
00180 a_phi,
00181 a_probLo,
00182 a_dx,
00183 a_idir,
00184 a_side,
00185 a_dit,
00186 a_time,
00187 a_useAreaFrac,
00188 a_centroid,
00189 a_useHomogeneous);
00190 }
00191
00192 virtual void enforceFaceVel(LevelData<EBFluxFAB>& a_velocity,
00193 const DisjointBoxLayout& a_grids,
00194 const EBISLayout& a_ebisl,
00195 const ProblemDomain& a_domain,
00196 const RealVect& a_dx,
00197 const Real& a_time,
00198 const RealVect& a_origin,
00199 const bool& a_doDivFreeOutflow);
00200
00202
00206 virtual void getFaceVel(Real& a_faceFlux,
00207 const FaceIndex& a_vof,
00208 const EBFluxFAB& a_vel,
00209 const RealVect& a_probLo,
00210 const RealVect& a_dx,
00211 const int& a_idir,
00212 const int& a_icomp,
00213 const Real& a_time,
00214 const Side::LoHiSide& a_side,
00215 const bool& a_doDivFreeOutflow) = 0;
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227 };
00228
00230
00232 class ViscousBaseDomainBC: public BaseDomainBC
00233 {
00234 public:
00236
00238 ViscousBaseDomainBC()
00239 {
00240 m_coefSet = false;
00241 m_value = 12345.6789;
00242 m_func = RefCountedPtr<BaseBCFuncEval>();
00243 m_isFunction = false;
00244 }
00245
00246 virtual ~ViscousBaseDomainBC()
00247 {
00248 }
00250
00252 void setCoef(EBLevelGrid & a_eblg,
00253 Real & a_beta,
00254 RefCountedPtr<LevelData<EBFluxFAB> >& a_eta,
00255 RefCountedPtr<LevelData<EBFluxFAB> >& a_lambda)
00256 {
00257 m_coefSet = true;
00258 m_eblg = a_eblg;
00259 m_beta = a_beta;
00260 m_eta = a_eta;
00261 m_lambda = a_lambda;
00262 }
00263
00264 virtual void getFaceVel(Real& a_faceFlux,
00265 const FaceIndex& a_vof,
00266 const EBFluxFAB& a_vel,
00267 const RealVect& a_probLo,
00268 const RealVect& a_dx,
00269 const int& a_idir,
00270 const int& a_icomp,
00271 const Real& a_time,
00272 const Side::LoHiSide& a_side,
00273 const bool& a_doDivFreeOutflow)
00274 {
00275
00276 MayDay::Error();
00277 }
00278 virtual void getFaceGradPhi(Real& a_faceFlux,
00279 const FaceIndex& a_face,
00280 const int& a_comp,
00281 const EBCellFAB& a_phi,
00282 const RealVect& a_probLo,
00283 const RealVect& a_dx,
00284 const int& a_idir,
00285 const Side::LoHiSide& a_side,
00286 const DataIndex& a_dit,
00287 const Real& a_time,
00288 const bool& a_useAreaFrac,
00289 const RealVect& a_centroid,
00290 const bool& a_useHomogeneous)
00291 {
00292
00293 MayDay::Error();
00294 }
00296
00298 virtual void setValue(Real a_value)
00299 {
00300 m_value = a_value;
00301 m_func = RefCountedPtr<BaseBCFuncEval>();
00302
00303 m_isFunction = false;
00304 }
00305
00306
00308
00310 virtual void setFunction(RefCountedPtr<BaseBCFuncEval> a_func)
00311 {
00312 m_value = 12345.6789;
00313 m_func = a_func;
00314
00315 m_isFunction = true;
00316 }
00317
00318 void getFluxFromGrad(BaseFab<Real>& a_flux,
00319 const FArrayBox& a_grad,
00320 const DataIndex& a_dit,
00321 const int& a_idir);
00322
00323 protected:
00324 bool m_isFunction;
00325
00326
00327 Real m_value;
00328 RefCountedPtr<BaseBCFuncEval> m_func;
00329
00330 Real m_beta;
00331 bool m_coefSet;
00332 EBLevelGrid m_eblg;
00333 RefCountedPtr<LevelData<EBFluxFAB> > m_eta;
00334 RefCountedPtr<LevelData<EBFluxFAB> > m_lambda;
00335 };
00336
00338
00340 class ConductivityBaseDomainBC: public BaseDomainBC
00341 {
00342 public:
00344
00346 ConductivityBaseDomainBC()
00347 {
00348 m_coefSet = false;
00349 }
00350
00351 virtual ~ConductivityBaseDomainBC()
00352 {
00353 }
00354
00356
00358 void setCoef(EBLevelGrid & a_eblg,
00359 Real & a_beta,
00360 RefCountedPtr<LevelData<EBFluxFAB> >& a_bcoef)
00361 {
00362 m_coefSet = true;
00363 m_eblg = a_eblg;
00364 m_beta = a_beta;
00365 m_bcoef = a_bcoef;
00366 }
00367
00368
00369 protected:
00370 bool m_coefSet;
00371 EBLevelGrid m_eblg;
00372 Real m_beta;
00373 RefCountedPtr<LevelData<EBFluxFAB> > m_bcoef;
00374 };
00376
00378 class BaseDomainBCFactory
00379 {
00380 public:
00382
00384 BaseDomainBCFactory() {};
00385
00387
00389 virtual ~BaseDomainBCFactory() {};
00390
00392
00394 virtual BaseDomainBC* create(const ProblemDomain& a_domain,
00395 const EBISLayout& a_layout,
00396 const RealVect& a_dx) = 0;
00397 };
00398 #include "NamespaceFooter.H"
00399 #endif