Chombo + EB  3.2
ConductivityBaseDomainBC.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #ifndef _CONDUCTIVITYBASEDOMAINBC_H_
12 #define _CONDUCTIVITYBASEDOMAINBC_H_
13 
14 #include "LoHiSide.H"
15 #include "RealVect.H"
16 #include "FArrayBox.H"
17 #include "BaseDomainBC.H"
18 #include "VolIndex.H"
19 #include "EBCellFAB.H"
20 #include "EBFaceFAB.H"
21 #include "EBFluxFAB.H"
22 #include "EBISLayout.H"
23 #include "EBLevelGrid.H"
24 #include "TensorCFInterp.H"
25 #include "BaseBCFuncEval.H"
26 #include "NamespaceHeader.H"
27 
28 
29 ///
30 /**
31  */
33 {
34 public:
35  ///
36  /**
37  */
39  {
40  m_coefSet = false;
41  }
42 
43  void
44  setValue(Real a_value)
45  {
46  m_onlyHomogeneous = false;
47  m_isFunction = false;
48  m_value = a_value;
50  }
51  void
53  {
54  m_value = 12345.6789;
55  m_func = a_func;
56 
57  m_onlyHomogeneous = false;
58  m_isFunction = true;
59  }
60 
62  {
63  }
64 
65  ///
66  /**
67  */
68  void setCoef(EBLevelGrid & a_eblg,
69  Real & a_beta,
71  {
72  m_coefSet = true;
73  m_eblg = a_eblg;
74  m_beta = a_beta;
75  m_bcoef = a_bcoef;
76  }
77 
78  Real bcvaluefunc(const RealVect & a_point,
79  const int & a_dir,
80  const Side::LoHiSide& a_side)
81  {
82  Real retval;
84  {
85  retval = 0;
86  }
87  else if(m_isFunction)
88  {
89  retval = m_func->value(a_point, 0);
90  }
91  else
92  {
93  retval = m_value;
94  }
95  return retval;
96  }
97 
98  //this makes applyOpRegular faster
99  virtual void
101  const Box& a_valid,
102  const Box& a_domain,
103  Real a_dx,
104  bool a_homogeneous)
105  {
106  MayDay::Error("This shouldn't be called unless using NWO");
107  }
108 
109 protected:
112 
115 
116  bool m_coefSet;
120 };
121 #include "NamespaceFooter.H"
122 #endif
virtual Real value(const RealVect &a_point, const int &a_comp) const =0
void setFunction(RefCountedPtr< BaseBCFuncEval > a_func)
Definition: ConductivityBaseDomainBC.H:52
Definition: BaseDomainBC.H:31
RefCountedPtr< LevelData< EBFluxFAB > > m_bcoef
Definition: ConductivityBaseDomainBC.H:119
Definition: ConductivityBaseDomainBC.H:32
Definition: EBLevelGrid.H:30
ConductivityBaseDomainBC()
Definition: ConductivityBaseDomainBC.H:38
Real m_beta
Definition: ConductivityBaseDomainBC.H:118
RefCountedPtr< BaseBCFuncEval > m_func
Definition: ConductivityBaseDomainBC.H:114
bool m_isFunction
Definition: ConductivityBaseDomainBC.H:111
virtual ~ConductivityBaseDomainBC()
Definition: ConductivityBaseDomainBC.H:61
virtual void fillPhiGhost(FArrayBox &a_state, const Box &a_valid, const Box &a_domain, Real a_dx, bool a_homogeneous)
Definition: ConductivityBaseDomainBC.H:100
double Real
Definition: REAL.H:33
LoHiSide
Definition: LoHiSide.H:27
void setValue(Real a_value)
Definition: ConductivityBaseDomainBC.H:44
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
bool m_coefSet
Definition: ConductivityBaseDomainBC.H:116
bool m_onlyHomogeneous
Definition: ConductivityBaseDomainBC.H:110
EBLevelGrid m_eblg
Definition: ConductivityBaseDomainBC.H:117
Real bcvaluefunc(const RealVect &a_point, const int &a_dir, const Side::LoHiSide &a_side)
Definition: ConductivityBaseDomainBC.H:78
Definition: FArrayBox.H:45
Real m_value
Definition: ConductivityBaseDomainBC.H:113
void setCoef(EBLevelGrid &a_eblg, Real &a_beta, RefCountedPtr< LevelData< EBFluxFAB > > &a_bcoef)
Definition: ConductivityBaseDomainBC.H:68