00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _DIRICHLETCONDUCTIVITYEBBC_H_
00012 #define _DIRICHLETCONDUCTIVITYEBBC_H_
00013
00014 #include "RefCountedPtr.H"
00015
00016 #include "DirichletPoissonEBBC.H"
00017 #include "BaseBCValue.H"
00018 #include "NamespaceHeader.H"
00019
00020
00021
00022
00023 class DirichletConductivityEBBC: public ConductivityBaseEBBC
00024 {
00025 public:
00026
00027 virtual void define(const LayoutData<IntVectSet>& a_cfivs,
00028 const Real& a_factor);
00029
00030
00031 virtual void applyEBFlux(EBCellFAB& a_lphi,
00032 const EBCellFAB& a_phi,
00033 VoFIterator& a_vofit,
00034 const LayoutData<IntVectSet>& a_cfivs,
00035 const DataIndex& a_dit,
00036 const RealVect& a_probLo,
00037 const RealVect& a_dx,
00038 const Real& a_factor,
00039 const bool& a_useHomogeneous,
00040 const Real& a_time);
00041
00042
00043 DirichletConductivityEBBC(const ProblemDomain& a_domain,
00044 const EBISLayout& a_layout,
00045 const RealVect& a_dx,
00046 const IntVect* a_ghostCellsPhi,
00047 const IntVect* a_ghostCellsRhs):ConductivityBaseEBBC()
00048
00049 {
00050 m_bc.construct(a_domain, a_layout, a_dx, a_ghostCellsPhi, a_ghostCellsRhs);
00051 }
00052
00053 virtual LayoutData<BaseIVFAB<VoFStencil> >* getFluxStencil(int ivar)
00054 {
00055 return &m_fluxStencil;
00056 }
00057
00058
00059 virtual ~DirichletConductivityEBBC();
00060
00061
00062 virtual void setValue(Real a_value);
00063
00064
00065 virtual int whichBC()
00066 {
00067 return 0;
00068 };
00069
00070 virtual void setOrder(int a_order)
00071 {
00072 m_bc.setOrder(a_order);
00073 }
00074
00075
00076 virtual void setFunction(RefCountedPtr<BaseBCValue> a_flux);
00077
00078
00079 virtual void getEBFlux(Real& a_flux,
00080 const VolIndex& a_vof,
00081 const LevelData<EBCellFAB>& a_phi,
00082 const LayoutData<IntVectSet>& a_cfivs,
00083 const DataIndex& a_dit,
00084 const RealVect& a_probLo,
00085 const RealVect& a_dx,
00086 const bool& a_useHomogeneous,
00087 const Real& a_time,
00088 const pair<int,Real>* a_cacheHint=0 );
00089
00090
00091 static int s_velComp;
00092
00093 private:
00094 DirichletPoissonEBBC m_bc;
00095 LayoutData<BaseIVFAB<VoFStencil> > m_fluxStencil;
00096 };
00097
00098
00099 class DirichletConductivityEBBCFactory: public BaseEBBCFactory
00100 {
00101 public:
00102
00103 DirichletConductivityEBBCFactory();
00104
00105
00106 virtual ~DirichletConductivityEBBCFactory();
00107
00108 virtual void setOrder(int a_order)
00109 {
00110 m_order = a_order;
00111 }
00112
00113
00114 virtual void setValue(Real a_value);
00115
00116
00117 virtual void setFunction(RefCountedPtr<BaseBCValue> a_flux);
00118
00119
00120 virtual DirichletConductivityEBBC* create(const ProblemDomain& a_domain,
00121 const EBISLayout& a_layout,
00122 const RealVect& a_dx,
00123 const IntVect* a_ghostCellsPhi=0,
00124 const IntVect* a_ghostCellsRhs=0);
00125
00126 private:
00127 bool m_onlyHomogeneous;
00128 bool m_isFunction;
00129 int m_order;
00130 Real m_value;
00131 RefCountedPtr<BaseBCValue> m_flux;
00132 RefCountedPtr<LevelData<BaseIVFAB<Real> > >m_data;
00133 bool m_dataBased;
00134 };
00135
00136 #include "NamespaceFooter.H"
00137 #endif