00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _DIRICHLETVISCOUSTENSOREBBC_H_
00012 #define _DIRICHLETVISCOUSTENSOREBBC_H_
00013
00014 #include "RefCountedPtr.H"
00015
00016 #include "BaseEBBC.H"
00017 #include "BaseBCFuncEval.H"
00018 #include "LayoutData.H"
00019 #include "IntVectSet.H"
00020 #include "EBStencil.H"
00021 #include "NamespaceHeader.H"
00022 class VoFCache;
00023 class VoFStencil;
00024
00025
00026
00027
00028 class DirichletViscousTensorEBBC: public ViscousBaseEBBC
00029 {
00030 public:
00031
00032
00033 DirichletViscousTensorEBBC();
00034
00035
00036
00037
00038
00039
00040 DirichletViscousTensorEBBC( const ProblemDomain& a_domain,
00041 const EBISLayout& a_layout,
00042 const RealVect& a_dx,
00043 const IntVect* a_ghostCellsPhi,
00044 const IntVect* a_ghostCellsRhs);
00045
00046
00047
00048
00049 virtual ~DirichletViscousTensorEBBC();
00050
00051
00052
00053
00054 virtual void define(const LayoutData<IntVectSet>& a_cfivs,
00055 const Real& a_factor);
00056
00057 virtual LayoutData<BaseIVFAB<VoFStencil> >* getFluxStencil(int ivar)
00058 {
00059 return &m_fluxStencil[ivar];
00060 }
00061
00062 virtual void applyEBFlux(EBCellFAB& a_lphi,
00063 const EBCellFAB& a_phi,
00064 VoFIterator& a_vofit,
00065 const LayoutData<IntVectSet>& a_cfivs,
00066 const DataIndex& a_dit,
00067 const RealVect& a_probLo,
00068 const RealVect& a_dx,
00069 const Real& a_factor,
00070 const bool& a_useHomogeneous,
00071 const Real& a_time);
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 void getGradient(Real a_grad[SpaceDim][SpaceDim],
00084 const VolIndex& a_vof,
00085 const EBCellFAB& a_phi,
00086 const EBISBox& a_ebisBox,
00087 const DataIndex& a_dit,
00088 const Real& a_dx,
00089 bool a_homogeneous);
00090
00091
00092 void getGradientStenValue(Real a_grad[SpaceDim][SpaceDim],
00093 const VolIndex& a_vof,
00094 const EBCellFAB& a_phi,
00095 const EBISBox& a_ebisBox,
00096 const DataIndex& a_dit,
00097 const Real& a_dx,
00098 bool a_homogeneous);
00099 protected:
00100
00101 void getGradInhomOnly(Real a_grad[SpaceDim][SpaceDim],
00102 const Real& a_weight,
00103 const VolIndex& a_vof,
00104 const EBISBox& a_ebisBox,
00105 const Real& a_dx);
00106
00107 void getNormalStencil(VoFStencil& a_stencil,
00108 Real& a_weight,
00109 const VolIndex& a_vof,
00110 const EBISBox& a_ebisBox,
00111 const RealVect& a_dx,
00112 const IntVectSet& a_cfivs);
00113
00114
00115 void getFluxStencil(VoFStencil a_stencil[SpaceDim],
00116 Real a_weight[ SpaceDim],
00117 const DataIndex& a_dit,
00118 const VolIndex& a_vof,
00119 const EBISBox& a_ebisBox,
00120 const RealVect& a_dx,
00121 const IntVectSet& a_cfivs);
00122
00123
00124 void
00125 getGradientFunction(Real a_grad[SpaceDim][SpaceDim],
00126 const VolIndex& a_vof,
00127 const EBCellFAB& a_phi,
00128 const EBISBox& a_ebisBox,
00129 const DataIndex& a_dit,
00130 const Real& a_dx,
00131 bool a_homogeneous);
00132
00133
00134 bool getSecondOrderStencil(VoFStencil& a_stencil,
00135 Real& a_weight,
00136 Vector<VoFStencil>& a_pointStencil,
00137 Vector<Real>& a_distanceAlongLine,
00138 const VolIndex& a_vof,
00139 const EBISBox& a_ebisBox,
00140 const RealVect& a_dx,
00141 const IntVectSet& a_cfivs);
00142
00143 void getFirstOrderStencil(VoFStencil& a_stencil,
00144 Real& a_weight,
00145 const VolIndex& a_vof,
00146 const EBISBox& a_ebisBox,
00147 const RealVect& a_dx,
00148 const IntVectSet& a_cfivs);
00149
00150
00151 void getJacobianAndInverse(Real a_Jacobian[SpaceDim][SpaceDim],
00152 Real a_Jinverse[SpaceDim][SpaceDim],
00153 RealVect& a_normal,
00154 RealVect a_tangents[SpaceDim-1]);
00155
00156
00157 virtual RealVect getInhomogeneousContribution(const VolIndex& a_vof,
00158 const EBCellFAB& a_phi,
00159 const EBISBox& a_ebisBox,
00160 const DataIndex& a_dit,
00161 const Real& a_dx);
00162
00163 void getFlux(Real a_flux[SpaceDim][SpaceDim],
00164 const VolIndex& a_vof,
00165 const EBCellFAB& a_phi,
00166 const EBISBox& a_ebisBox,
00167 const DataIndex& a_dit,
00168 const Real& a_dx,
00169 bool a_homogeneous);
00170
00171
00172 void getCartesianGradientStencil(VoFStencil a_gradStencils[SpaceDim][SpaceDim],
00173 VoFStencil & a_normalStencil,
00174 const DataIndex& a_dit,
00175 const VolIndex& a_vof,
00176 const EBISBox& a_ebisBox,
00177 const RealVect& a_dx);
00178
00179
00180 static int s_leastSquaresRad;
00181 protected:
00182
00183 bool m_isDefined;
00184
00185 ProblemDomain m_domain;
00186 EBISLayout m_ebisl;
00187
00188 RealVect m_dx;
00189
00190
00191
00192 LayoutData<BaseIVFAB<VoFStencil> > m_fluxStencil[CH_SPACEDIM];
00193 LayoutData<BaseIVFAB<Real> > m_fluxWeight[CH_SPACEDIM];
00194 const IntVect m_ghostCellsPhi;
00195 const IntVect m_ghostCellsRHS;
00196
00197
00198 };
00199
00200
00201
00202
00203 class DirichletViscousTensorEBBCFactory: public BaseEBBCFactory
00204 {
00205 public:
00206
00207
00208
00209 DirichletViscousTensorEBBCFactory();
00210
00211
00212
00213
00214 virtual ~DirichletViscousTensorEBBCFactory();
00215
00216
00217
00218
00219
00220 virtual void setValue(Real a_value);
00221
00222
00223
00224
00225 virtual void setFunction(RefCountedPtr<BaseBCFuncEval> a_func);
00226
00227
00228
00229
00230 virtual DirichletViscousTensorEBBC* create( const ProblemDomain& a_domain,
00231 const EBISLayout& a_layout,
00232 const RealVect& a_dx,
00233 const IntVect* a_ghostCellsPhi,
00234 const IntVect* a_ghostCellsRhs);
00235
00236 protected:
00237
00238 private:
00239 bool m_isFunction;
00240
00241 Real m_value;
00242 RefCountedPtr<BaseBCFuncEval> m_func;
00243 const IntVect m_ghostCellsPhi;
00244 const IntVect m_ghostCellsRHS;
00245
00246 };
00247
00248
00249
00250 #include "NamespaceFooter.H"
00251 #endif