00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _DIRICHLETPOISSONEBBC_H_
00012 #define _DIRICHLETPOISSONEBBC_H_
00013
00014 #include "RefCountedPtr.H"
00015
00016 #include "BaseEBBC.H"
00017 #include "BaseBCValue.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 #define CTOR_ARGS a_domain, \
00026 a_layout, \
00027 a_dx, \
00028 a_ghostCellsPhi, \
00029 a_ghostCellsRhs
00030
00031 #define CTOR_ARGS_WITH_DECLS const ProblemDomain& a_domain, \
00032 const EBISLayout& a_layout, \
00033 const RealVect& a_dx, \
00034 const IntVect* a_ghostCellsPhi=0, \
00035 const IntVect* a_ghostCellsRhs=0
00036
00037
00039
00041 class DirichletPoissonEBBC: public BaseEBBC
00042 {
00043 public:
00044
00046 DirichletPoissonEBBC();
00047
00049
00053 DirichletPoissonEBBC( CTOR_ARGS_WITH_DECLS );
00054
00055 void construct( CTOR_ARGS_WITH_DECLS );
00057
00059 virtual ~DirichletPoissonEBBC();
00060
00062
00064 virtual void define(const LayoutData<IntVectSet>& a_cfivs,
00065 const Real& a_factor);
00066
00068
00070 virtual void setOrder(int a_order);
00071
00073
00078 virtual int whichBC()
00079 {
00080 return 1;
00081 };
00082
00083 virtual LayoutData<BaseIVFAB<VoFStencil> >* getFluxStencil(int ivar)
00084 {
00085 return &m_fluxStencil;
00086 }
00087
00088 LayoutData<BaseIVFAB<Real> >& getFluxWeight()
00089 {
00090 return m_fluxWeight;
00091 }
00093
00095 virtual void setValue(Real a_value);
00096
00098
00100 virtual void setFunction(RefCountedPtr<BaseBCValue> a_func);
00101
00103
00105 virtual void applyEBFlux(EBCellFAB& a_lphi,
00106 const EBCellFAB& a_phi,
00107 VoFIterator& a_vofit,
00108 const LayoutData<IntVectSet>& a_cfivs,
00109 const DataIndex& a_dit,
00110 const RealVect& a_probLo,
00111 const RealVect& a_dx,
00112 const Real& a_factor,
00113 const bool& a_useHomogeneous,
00114 const Real& a_time);
00116
00118 virtual void getEBFlux(Real& a_flux,
00119 const VolIndex& a_vof,
00120 const LevelData<EBCellFAB>& a_phi,
00121 const LayoutData<IntVectSet>& a_cfivs,
00122 const DataIndex& a_dit,
00123 const RealVect& a_probLo,
00124 const RealVect& a_dx,
00125 const bool& a_useHomogeneous,
00126 const Real& a_time,
00127 const pair<int,Real>* a_cacheHint=0 );
00128
00129
00130 bool getSecondOrderStencil(VoFStencil& a_stencil,
00131 Real& a_weight,
00132 Vector<VoFStencil>& a_pointStencils,
00133 Vector<Real>& a_distanceAlongLine,
00134 const VolIndex& a_vof,
00135 const EBISBox& a_ebisBox,
00136 const RealVect& a_dx,
00137 const IntVectSet& a_cfivs);
00138
00139
00140 static int s_velComp;
00141 protected:
00142
00143 private:
00144 virtual void getFirstOrderStencil(VoFStencil& a_stencil,
00145 Real& a_weight,
00146 const VolIndex& a_vof,
00147 const EBISBox& a_ebisBox,
00148 const RealVect& a_dx);
00149
00150 virtual void getSecondOrderStencil(VoFStencil& a_stencil,
00151 Real& a_weight,
00152 const VolIndex& a_vof,
00153 const EBISBox& a_ebisBox,
00154 const RealVect& a_dx,
00155 const IntVectSet& a_cfivs);
00156
00157
00158 public:
00159 bool m_isDefined;
00160
00161 bool m_onlyHomogeneous;
00162 bool m_isFunction;
00163
00164 int m_order;
00165
00166 Real m_value;
00167 RefCountedPtr<BaseBCValue> m_func;
00168
00169 ProblemDomain m_domain;
00170 EBISLayout m_layout;
00171
00172 RealVect m_dx;
00173
00174
00175
00176 IntVect m_ghostCellsPhi;
00177 IntVect m_ghostCellsRHS;
00178
00179
00180 virtual void define(const LayoutData<IntVectSet>& a_cfivs);
00181 LayoutData<BaseIVFAB<Real> > m_fluxWeight;
00182 LayoutData<BaseIVFAB<VoFStencil> > m_fluxStencil;
00183
00184 };
00185
00187
00189 class DirichletPoissonEBBCFactory: public BaseEBBCFactory
00190 {
00191 public:
00193
00195 DirichletPoissonEBBCFactory();
00196
00198
00200 virtual ~DirichletPoissonEBBCFactory();
00201
00203
00205 virtual void setOrder(int a_order);
00206
00208
00210 virtual void setValue(Real a_value);
00211
00213
00215 virtual void setFunction(RefCountedPtr<BaseBCValue> a_func);
00216
00218
00220 virtual DirichletPoissonEBBC* create( CTOR_ARGS_WITH_DECLS );
00221
00222 protected:
00223 bool m_varcoef;
00224
00225 private:
00226 bool m_onlyHomogeneous;
00227 bool m_isFunction;
00228
00229 int m_order;
00230
00231 Real m_value;
00232 RefCountedPtr<BaseBCValue> m_func;
00233
00234 };
00235
00236
00237
00238 #undef CTOR_ARGS
00239 #undef CTOR_ARGS_WITH_DECLS
00240
00241 #include "NamespaceFooter.H"
00242 #endif