Chombo + EB  3.0
EBFaceFAB.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 // ANAG, LBNL
12 
13 #ifndef _EBFACEFAB_H_
14 #define _EBFACEFAB_H_
15 
16 #include <cmath>
17 #include <cstdlib>
18 #include "SPACE.H"
19 #include "BaseEBFaceFAB.H"
20 #include "FArrayBox.H"
21 #include "NamespaceHeader.H"
22 
23 ///
24 /**
25  EBFaceFAB is a BaseEBFaceFAB<Real>
26  which includes arithmetic functions.
27  */
28 class EBFaceFAB: public BaseEBFaceFAB<Real>
29 {
30 public:
31  ///
32  EBFaceFAB();
33 
34  ///
35  /**
36  Box going into this needs to be cell-centered.
37  Data will exist over the surrounding nodes of the box.
38  */
39  EBFaceFAB(const EBISBox& a_ebisBox,
40  const Box& a_region,
41  int a_iDir, int a_nVar);
42 
43 
44 void define(const EBISBox& a_ebisBox,
45  const Box& a_region,
46  int a_iDir, int a_nComp);
47  ///
48  virtual ~EBFaceFAB();
49 
50  ///
51  const FArrayBox& getFArrayBox() const;
52 
53  ///
54  /**
55  Does a dynamic cast of the BaseFab<Real>
56  to a FArrayBox for arithmetic purposes.
57  */
59 
60  ///
61  /**
62  Both fabs need the same ebisBox and region and number of components.
63  */
64  EBFaceFAB& operator+=(const EBFaceFAB& a_ebfab);
65 
66 
67  ///
68  /**
69  Both fabs need the same ebisBox and region.
70  */
71  EBFaceFAB& plus(const EBFaceFAB& a_ebfab,
72  int a_srccomp,
73  int a_destcomp,
74  int a_numcomp);
75 
76 
77  ///
78  /**
79  Both fabs need the same ebisBox and region and number of components.
80  */
81  EBFaceFAB& operator-=(const EBFaceFAB& a_ebfab);
82 
83  ///
84  /**
85  Both fabs need the same ebisBox and region.
86  */
87  EBFaceFAB& minus(const EBFaceFAB& a_ebfab,
88  int a_srccomp,
89  int a_destcomp,
90  int a_numcomp);
91 
92 
93  ///
94  /**
95  Both fabs need the same ebisBox and region and number of components.
96  */
97  EBFaceFAB& operator*=(const EBFaceFAB& a_ebfab);
98 
99  ///
100  /**
101  Both fabs need the same ebisBox and region.
102  */
103  EBFaceFAB& mult(const EBFaceFAB& a_ebfab,
104  int a_srccomp,
105  int a_destcomp,
106  int a_numcomp);
107 
108 
109  ///
110  /**
111  Both fabs need the same ebisBox and region and number of components.
112  */
113  EBFaceFAB& operator/=(const EBFaceFAB& a_ebfab);
114 
115 
116  ///
117  /**
118  Both fabs need the same ebisBox and region.
119  */
120  EBFaceFAB& divide(const EBFaceFAB& a_ebfab,
121  int a_srccomp,
122  int a_destcomp,
123  int a_numcomp);
124 
125 
126  ///
127  /**
128  */
129  EBFaceFAB& operator+=(const Real& a_scalar);
130 
131  ///
132  /**
133  */
134  EBFaceFAB& operator-=(const Real& a_scalar);
135 
136  ///
137  /**
138  */
139  EBFaceFAB& operator*=(const Real& a_scalar);
140 
141  ///
142  /**
143  */
144  EBFaceFAB& operator/=(const Real& a_scalar);
145 
146  //! Returns the maximum value for the given component in the FAB.
147  Real max(int a_comp = 0) const;
148 
149  //! Returns the minimum value for the given component in the FAB.
150  Real min(int a_comp = 0) const;
151 
152  //needed for leveldata to compile but invalid
153  EBFaceFAB(const Box& a_region, int a_nComp)
154  {
155  MayDay::Error("bogus constructor");
156  }
157 private:
158  //verboten for all the usual reasons
159  EBFaceFAB(const EBFaceFAB& ebcin)
160  {
161  MayDay::Error("bogus constructor");
162  }
163  void operator=(const EBFaceFAB& ebcin)
164  {
165  MayDay::Error("bogus constructor");
166  }
167 
168 };
169 
170 #include "NamespaceFooter.H"
171 #endif
Real min(int a_comp=0) const
Returns the minimum value for the given component in the FAB.
virtual ~EBFaceFAB()
EBFaceFAB(const Box &a_region, int a_nComp)
Definition: EBFaceFAB.H:153
const FArrayBox & getFArrayBox() const
Definition: EBISBox.H:46
EBFaceFAB & operator-=(const EBFaceFAB &a_ebfab)
EBFaceFAB & operator+=(const EBFaceFAB &a_ebfab)
Array defined at the Faces of an Box in an EBISBox.
Definition: BaseEBFaceFAB.H:43
Definition: EBFaceFAB.H:28
EBFaceFAB & operator/=(const EBFaceFAB &a_ebfab)
double Real
Definition: REAL.H:33
EBFaceFAB & minus(const EBFaceFAB &a_ebfab, int a_srccomp, int a_destcomp, int a_numcomp)
EBFaceFAB(const EBFaceFAB &ebcin)
Definition: EBFaceFAB.H:159
EBFaceFAB & plus(const EBFaceFAB &a_ebfab, int a_srccomp, int a_destcomp, int a_numcomp)
EBFaceFAB & divide(const EBFaceFAB &a_ebfab, int a_srccomp, int a_destcomp, int a_numcomp)
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
void define(const EBISBox &a_ebisBox, const Box &a_region, int a_iDir, int a_nComp)
EBFaceFAB & mult(const EBFaceFAB &a_ebfab, int a_srccomp, int a_destcomp, int a_numcomp)
Definition: FArrayBox.H:44
void operator=(const EBFaceFAB &ebcin)
Definition: EBFaceFAB.H:163
Real max(int a_comp=0) const
Returns the maximum value for the given component in the FAB.
EBFaceFAB & operator*=(const EBFaceFAB &a_ebfab)