Chombo + EB  3.2
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  /// aliasing constructor
68  EBFaceFAB(const Interval& a_interval, EBFaceFAB& a_original)
69  :BaseEBFaceFAB<Real>(a_interval, a_original)
70  {
71  }
72 
73  ///
74  /**
75  Both fabs need the same ebisBox and region.
76  */
77  EBFaceFAB& plus(const EBFaceFAB& a_ebfab,
78  int a_srccomp,
79  int a_destcomp,
80  int a_numcomp);
81 
82 
83  ///
84  /**
85  Both fabs need the same ebisBox and region and number of components.
86  */
87  EBFaceFAB& operator-=(const EBFaceFAB& a_ebfab);
88 
89  ///
90  /**
91  Both fabs need the same ebisBox and region.
92  */
93  EBFaceFAB& minus(const EBFaceFAB& a_ebfab,
94  int a_srccomp,
95  int a_destcomp,
96  int a_numcomp);
97 
98 
99  ///
100  /**
101  Both fabs need the same ebisBox and region and number of components.
102  */
103  EBFaceFAB& operator*=(const EBFaceFAB& a_ebfab);
104 
105  ///
106  /**
107  Both fabs need the same ebisBox and region.
108  */
109  EBFaceFAB& mult(const EBFaceFAB& a_ebfab,
110  int a_srccomp,
111  int a_destcomp,
112  int a_numcomp);
113 
114 
115  ///
116  /**
117  Both fabs need the same ebisBox and region and number of components.
118  */
119  EBFaceFAB& operator/=(const EBFaceFAB& a_ebfab);
120 
121 
122  ///
123  /**
124  Both fabs need the same ebisBox and region.
125  */
126  EBFaceFAB& divide(const EBFaceFAB& a_ebfab,
127  int a_srccomp,
128  int a_destcomp,
129  int a_numcomp);
130 
131 
132  ///
133  /**
134  */
135  EBFaceFAB& operator+=(const Real& a_scalar);
136 
137  ///
138  /**
139  */
140  EBFaceFAB& operator-=(const Real& a_scalar);
141 
142  ///
143  /**
144  */
145  EBFaceFAB& operator*=(const Real& a_scalar);
146 
147  ///
148  /**
149  */
150  EBFaceFAB& operator/=(const Real& a_scalar);
151 
152  //! Returns the maximum value for the given component in the FAB.
153  Real max(int a_comp = 0) const;
154 
155  //! Returns the minimum value for the given component in the FAB.
156  Real min(int a_comp = 0) const;
157 
158  //needed for leveldata to compile but invalid
159  EBFaceFAB(const Box& a_region, int a_nComp)
160  {
161  MayDay::Error("bogus constructor");
162  }
163 private:
164  //verboten for all the usual reasons
165  EBFaceFAB(const EBFaceFAB& ebcin)
166  {
167  MayDay::Error("bogus constructor");
168  }
169  void operator=(const EBFaceFAB& ebcin)
170  {
171  MayDay::Error("bogus constructor");
172  }
173 
174 };
175 
176 #include "NamespaceFooter.H"
177 #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:159
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
Structure for passing component ranges in code.
Definition: Interval.H:23
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:165
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:45
void operator=(const EBFaceFAB &ebcin)
Definition: EBFaceFAB.H:169
Real max(int a_comp=0) const
Returns the maximum value for the given component in the FAB.
EBFaceFAB(const Interval &a_interval, EBFaceFAB &a_original)
aliasing constructor
Definition: EBFaceFAB.H:68
EBFaceFAB & operator*=(const EBFaceFAB &a_ebfab)