00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _CONDUCTIVITYBASEDOMAINBC_H_ 00012 #define _CONDUCTIVITYBASEDOMAINBC_H_ 00013 00014 #include "LoHiSide.H" 00015 #include "RealVect.H" 00016 #include "FArrayBox.H" 00017 #include "BaseDomainBC.H" 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 00028 00029 /// 00030 /** 00031 */ 00032 class ConductivityBaseDomainBC: public BaseDomainBC 00033 { 00034 public: 00035 /// 00036 /** 00037 */ 00038 ConductivityBaseDomainBC() 00039 { 00040 m_coefSet = false; 00041 } 00042 00043 void 00044 setValue(Real a_value) 00045 { 00046 m_onlyHomogeneous = false; 00047 m_isFunction = false; 00048 m_value = a_value; 00049 m_func = RefCountedPtr<BaseBCFuncEval>(); 00050 } 00051 void 00052 setFunction(RefCountedPtr<BaseBCFuncEval> a_func) 00053 { 00054 m_value = 12345.6789; 00055 m_func = a_func; 00056 00057 m_onlyHomogeneous = false; 00058 m_isFunction = true; 00059 } 00060 00061 virtual ~ConductivityBaseDomainBC() 00062 { 00063 } 00064 00065 /// 00066 /** 00067 */ 00068 void setCoef(EBLevelGrid & a_eblg, 00069 Real & a_beta, 00070 RefCountedPtr<LevelData<EBFluxFAB> >& a_bcoef) 00071 { 00072 m_coefSet = true; 00073 m_eblg = a_eblg; 00074 m_beta = a_beta; 00075 m_bcoef = a_bcoef; 00076 } 00077 00078 Real bcvaluefunc(const RealVect & a_point, 00079 const int & a_dir, 00080 const Side::LoHiSide& a_side) 00081 { 00082 Real retval; 00083 if(m_onlyHomogeneous) 00084 { 00085 retval = 0; 00086 } 00087 else if(m_isFunction) 00088 { 00089 retval = m_func->value(a_point, 0); 00090 } 00091 else 00092 { 00093 retval = m_value; 00094 } 00095 return retval; 00096 } 00097 00098 //this makes applyOpRegular faster 00099 virtual void 00100 fillPhiGhost(FArrayBox& a_state, 00101 const Box& a_valid, 00102 const Box& a_domain, 00103 Real a_dx, 00104 bool a_homogeneous) 00105 { 00106 MayDay::Error("This shouldn't be called unless using NWO"); 00107 } 00108 00109 protected: 00110 bool m_onlyHomogeneous; 00111 bool m_isFunction; 00112 00113 Real m_value; 00114 RefCountedPtr<BaseBCFuncEval> m_func; 00115 00116 bool m_coefSet; 00117 EBLevelGrid m_eblg; 00118 Real m_beta; 00119 RefCountedPtr<LevelData<EBFluxFAB> > m_bcoef; 00120 }; 00121 #include "NamespaceFooter.H" 00122 #endif