11 #ifndef _MINIIFFABI_H_ 12 #define _MINIIFFABI_H_ 16 #include "NamespaceHeader.H" 22 template <
class T>
inline 28 template <
class T>
inline 34 template <
class T>
inline 38 const int& a_direction,
42 define(a_box, a_ebgraph, a_direction, a_nvarin);
45 template <
class T>
inline 50 const int& a_direction,
58 m_direction = a_direction;
59 m_ebgraph = a_ebgraph;
63 m_faces = m_ebgraph.getMultiValuedFaces(a_direction, a_box);
64 m_nFaces = m_faces.
size();
66 m_data =
new T[m_nComp*m_nFaces];
69 template <
class T>
inline 73 const int& a_direction,
77 define(a_ivs, a_ebgraph, a_direction, a_nvarin);
80 template <
class T>
inline 85 const int& a_direction,
93 m_direction = a_direction;
94 m_ebgraph = a_ebgraph;
100 m_nFaces = m_faces.
size();
102 m_data =
new T[m_nComp*m_nFaces];
105 template <
class T>
inline 111 for (
int ivec = 0; ivec < m_nFaces*m_nComp; ivec++)
113 m_data[ivec] = a_value;
117 template <
class T>
inline 126 for (
int ivec = ivar; ivec < m_nFaces*m_nComp; ivec += m_nComp)
128 m_data[ivec] = a_value;
132 template <
class T>
inline 152 Box intBox = a_toBox;
153 Box boxIntersect = m_box;
154 boxIntersect &= a_src.
m_box;
155 boxIntersect &= intBox;
156 int compSize = a_srcInterval.
size();
158 for (
int iface = 0; iface < m_faces.size(); iface++)
165 for (
int icomp = 0; icomp < compSize; icomp++)
167 int isrccomp = a_srcInterval.
begin() + icomp;
168 int idstcomp = a_dstInterval.
begin() + icomp;
169 (*this)(face, idstcomp) = a_src(face, isrccomp);
176 template <
class T>
inline 182 CH_assert((a_comp >= 0) && (a_comp < this->m_nComp));
184 T* dataPtr = this->m_data;
187 for (
int iface = 0; iface < m_faces.size(); ++iface)
189 if (a_face == m_faces[iface])
201 retval += a_comp*this->m_nFaces;
205 template <
class T>
inline 208 :m_data(a_original.dataPtr(a_comps.begin())),
209 m_faces(a_original.m_faces),
210 m_nFaces(a_original.m_nFaces),
211 m_nComp(a_comps.size()),
212 m_direction(a_original.m_direction),
214 m_isDefined(a_original.m_isDefined)
219 template <
class T>
inline 233 template <
class T>
inline 245 template <
class T>
inline 248 const int& a_comp)
const 257 template <
class T>
inline 266 template <
class T>
inline 275 template <
class T>
inline 286 template <
class T>
inline 292 for (
int iface = 0; iface <
m_faces.
size(); iface++)
302 template <
class T>
inline 318 for (
int iface = 0; iface < faces.
size(); iface++)
320 for (
int icomp = a_comps.
begin(); icomp <= a_comps.
end(); icomp++)
322 const T& dataPt = (*this)(faces[iface], icomp);
324 datasize += pointsize;
328 int retval = facesize + datasize;
332 pout() <<
"###############" << std::endl;
334 pout() <<
" a_comps = (" << a_comps.
begin() <<
"," << a_comps.
end() <<
")," << endl;
336 pout() <<
"size = " << retval << std::endl;
337 pout() <<
"###############" << std::endl;
343 template <
class T>
inline 355 unsigned char* charbuffer = (
unsigned char *) a_buf;
361 for (
int iface = 0; iface < faces.
size(); iface++)
364 for (
int icomp = a_comps.
begin(); icomp <= a_comps.
end(); icomp++)
367 const T& dataPt = thisFAB(face, icomp);
375 template <
class T>
inline 382 unsigned char* charbuffer = (
unsigned char *) a_buf;
387 for (
int iface = 0; iface < faces.
size(); iface++)
390 for (
int icomp = a_comps.
begin(); icomp <= a_comps.
end(); icomp++)
393 T& dataPt = (*this)(face, icomp);
403 #include "NamespaceFooter.H" std::ostream & pout()
Use this in place of std::cout for program output.
bool isDefined() const
Definition: MiniIFFAB.H:150
int m_nComp
Definition: MiniIFFAB.H:223
int size(const Box &R, const Interval &comps) const
Definition: MiniIFFABI.H:305
int m_nFaces
Definition: MiniIFFAB.H:222
IntVect size() const
size functions
Definition: Box.H:1803
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
#define CH_assert(cond)
Definition: CHArray.H:37
~MiniIFFAB()
Definition: MiniIFFABI.H:29
void linearOut(void *buf, const Box &R, const Interval &comps) const
Definition: MiniIFFABI.H:346
void setVal(const T &value)
Definition: MiniIFFABI.H:108
Definition: FaceIndex.H:28
void linearListOut(void *const a_outBuf, const Vector< T > &a_inputT)
Definition: SPMDI.H:258
int size() const
Definition: Interval.H:75
bool m_aliased
Definition: MiniIFFAB.H:225
int begin() const
Definition: Interval.H:97
Iterator over faces within an IntVectSet and an Ebgraph.
Definition: FaceIterator.H:67
EBGraph m_ebgraph
Definition: MiniIFFAB.H:212
Definition: FaceIterator.H:48
bool contains(const IntVect &p) const
Definition: Box.H:1871
const IntVect & gridIndex(const Side::LoHiSide &a_sd) const
void clear()
Definition: MiniIFFABI.H:222
MiniIFFAB()
Definition: MiniIFFABI.H:23
const int & direction() const
Definition: LoHiSide.H:31
Geometric description within a box.
Definition: EBGraph.H:427
const int SpaceDim
Definition: SPACE.H:38
void setDefaultValues()
Definition: MiniIFFABI.H:277
void resize(unsigned int isize)
Definition: Vector.H:346
void linearIn(void *buf, const Box &R, const Interval &comps)
Definition: MiniIFFABI.H:378
void push_back(const T &in)
Definition: Vector.H:295
Structure for passing component ranges in code.
Definition: Interval.H:23
static bool s_verbose
Definition: MiniIFFAB.H:209
const Vector< FaceIndex > & getVector() const
T * m_data
Definition: MiniIFFAB.H:220
void linearOut(void *const a_outBuf, const T &inputT)
Definition: SPMDI.H:33
int m_direction
Definition: MiniIFFAB.H:224
int linearSize(const T &inputT)
Definition: SPMDI.H:21
size_t size() const
Definition: Vector.H:192
Vector< FaceIndex > m_faces
Definition: MiniIFFAB.H:221
T * dataPtr(const int &a_comp)
Definition: MiniIFFABI.H:259
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.
void getFaceSubset(Vector< FaceIndex > &a_subFaces, const Box &a_subBox) const
Definition: MiniIFFABI.H:289
T * getIndex(const FaceIndex &a_face, const int &a_comp) const
Definition: MiniIFFABI.H:179
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
void copy(const Box &a_intBox, const Interval &a_destInterval, const Box &a_toBox, const MiniIFFAB< T > &a_src, const Interval &a_srcInterval)
Definition: MiniIFFABI.H:135
T & operator()(const FaceIndex &a_face, const int &varlocin)
Definition: MiniIFFABI.H:235
void linearListIn(Vector< T > &a_outputT, const void *const a_inBuf)
Definition: SPMDI.H:229
Definition: MiniIFFAB.H:34
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: LoHiSide.H:30
int linearListSize(const Vector< T > &a_input)
Definition: SPMDI.H:290
bool m_isDefined
Definition: MiniIFFAB.H:226
int end() const
Definition: Interval.H:102
bool isEmpty() const
{ Comparison Functions}
Definition: Box.H:1846
void linearIn(T &a_outputT, const void *const inBuf)
Definition: SPMDI.H:27
const Box & minBox() const
Returns the minimum enclosing box of this IntVectSet.
Box m_box
Definition: MiniIFFAB.H:211
const Box & getRegion() const
Definition: EBGraph.H:829
void define(const IntVectSet &a_ivs, const EBGraph &a_ebgraph, const int &a_direction, const int &a_nvarin)
Definition: MiniIFFABI.H:83