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
00023
00024
00025
00026 class DirichletPoissonEBBC: public BaseEBBC
00027 {
00028 public:
00029
00030
00031 DirichletPoissonEBBC();
00032
00033 DirichletPoissonEBBC(const ProblemDomain& a_domain,
00034 const EBISLayout& a_layout,
00035 const RealVect& a_dx,
00036 const IntVect* a_ghostCellsPhi=0,
00037 const IntVect* a_ghostCellsRhs=0);
00038
00039 void construct(const ProblemDomain& a_domain,
00040 const EBISLayout& a_layout,
00041 const RealVect& a_dx,
00042 const IntVect* a_ghostCellsPhi=0,
00043 const IntVect* a_ghostCellsRhs=0);
00044
00045
00046
00047 virtual ~DirichletPoissonEBBC();
00048
00049
00050
00051
00052 virtual void define(const LayoutData<IntVectSet>& a_cfivs,
00053 const Real& a_factor);
00054
00055
00056
00057
00058 virtual void setOrder(int a_order);
00059
00060 virtual LayoutData<BaseIVFAB<VoFStencil> >* getFluxStencil(int ivar)
00061 {
00062 return &m_fluxStencil;
00063 }
00064
00065 LayoutData<BaseIVFAB<Real> >& getFluxWeight()
00066 {
00067 return m_fluxWeight;
00068 }
00069
00070
00071
00072 virtual void setValue(Real a_value);
00073
00074
00075
00076
00077 virtual void setFunction(RefCountedPtr<BaseBCValue> a_func);
00078
00079
00080
00081
00082 virtual void applyEBFlux(EBCellFAB& a_lphi,
00083 const EBCellFAB& a_phi,
00084 VoFIterator& a_vofit,
00085 const LayoutData<IntVectSet>& a_cfivs,
00086 const DataIndex& a_dit,
00087 const RealVect& a_probLo,
00088 const RealVect& a_dx,
00089 const Real& a_factor,
00090 const bool& a_useHomogeneous,
00091 const Real& a_time);
00092
00093
00094
00095 virtual void getEBFlux(Real& a_flux,
00096 const VolIndex& a_vof,
00097 const LevelData<EBCellFAB>& a_phi,
00098 const LayoutData<IntVectSet>& a_cfivs,
00099 const DataIndex& a_dit,
00100 const RealVect& a_probLo,
00101 const RealVect& a_dx,
00102 const bool& a_useHomogeneous,
00103 const Real& a_time,
00104 const pair<int,Real>* a_cacheHint=0 );
00105
00106
00107 bool getSecondOrderStencil(VoFStencil& a_stencil,
00108 Real& a_weight,
00109 Vector<VoFStencil>& a_pointStencils,
00110 Vector<Real>& a_distanceAlongLine,
00111 const VolIndex& a_vof,
00112 const EBISBox& a_ebisBox,
00113 const RealVect& a_dx,
00114 const IntVectSet& a_cfivs);
00115
00116 virtual void applyEBFluxPoint(const VolIndex& a_vof,
00117 EBCellFAB& a_lphi,
00118 const EBCellFAB& a_phi,
00119 VoFIterator& a_vofit,
00120 const LayoutData<IntVectSet>& a_cfivs,
00121 const DataIndex& a_dit,
00122 const RealVect& a_probLo,
00123 const RealVect& a_dx,
00124 const Real& a_factor,
00125 const bool& a_useHomogeneous,
00126 const Real& a_time) ;
00127
00128
00129
00130 static int s_velComp;
00131 static int s_leastSquaresRad;
00132 static bool s_areaFracWeighted;
00133 static bool s_useQuadrantBasedStencil;
00134
00135
00136 virtual void getFirstOrderStencil(VoFStencil& a_stencil,
00137 Real& a_weight,
00138 const VolIndex& a_vof,
00139 const EBISBox& a_ebisBox,
00140 const RealVect& a_dx);
00141
00142 virtual void getSecondOrderStencil(VoFStencil& a_stencil,
00143 Real& a_weight,
00144 const VolIndex& a_vof,
00145 const EBISBox& a_ebisBox,
00146 const RealVect& a_dx,
00147 const IntVectSet& a_cfivs);
00148
00149 public:
00150 bool m_isDefined;
00151
00152 bool m_onlyHomogeneous;
00153 bool m_isFunction;
00154
00155 int m_order;
00156
00157 Real m_value;
00158 RefCountedPtr<BaseBCValue> m_func;
00159
00160 ProblemDomain m_domain;
00161 EBISLayout m_layout;
00162
00163 RealVect m_dx;
00164
00165
00166
00167 IntVect m_ghostCellsPhi;
00168 IntVect m_ghostCellsRHS;
00169
00170
00171 virtual void define(const LayoutData<IntVectSet>& a_cfivs);
00172
00173
00174
00175 LayoutData<BaseIVFAB<Real> > m_fluxWeight;
00176 LayoutData<BaseIVFAB<VoFStencil> > m_fluxStencil;
00177
00178 };
00179
00180
00181
00182
00183 class DirichletPoissonEBBCFactory: public BaseEBBCFactory
00184 {
00185 public:
00186
00187
00188
00189 DirichletPoissonEBBCFactory();
00190
00191
00192
00193
00194 virtual ~DirichletPoissonEBBCFactory();
00195
00196
00197
00198
00199 virtual void setOrder(int a_order);
00200
00201
00202
00203
00204 virtual void setValue(Real a_value);
00205
00206
00207
00208
00209 virtual void setFunction(RefCountedPtr<BaseBCValue> a_func);
00210
00211
00212
00213
00214 virtual DirichletPoissonEBBC* create(const ProblemDomain& a_domain,
00215 const EBISLayout& a_layout,
00216 const RealVect& a_dx,
00217 const IntVect* a_ghostCellsPhi=0,
00218 const IntVect* a_ghostCellsRhs=0);
00219
00220 protected:
00221 bool m_onlyHomogeneous;
00222 bool m_isFunction;
00223
00224 int m_order;
00225
00226 Real m_value;
00227 RefCountedPtr<BaseBCValue> m_func;
00228
00229 RefCountedPtr<LevelData<BaseIVFAB<Real> > > m_data;
00230 bool m_dataBased;
00231 };
00232
00233 #include "NamespaceFooter.H"
00234 #endif