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 75 for (
int ivec = 0; ivec < m_nFaces*m_nComp; ivec++)
77 m_data[ivec] = a_value;
81 template <
class T>
inline 90 for (
int ivec = ivar; ivec < m_nFaces*m_nComp; ivec += m_nComp)
92 m_data[ivec] = a_value;
96 template <
class T>
inline 116 Box intBox = a_toBox;
117 Box boxIntersect = m_box;
118 boxIntersect &= a_src.
m_box;
119 boxIntersect &= intBox;
120 int compSize = a_srcInterval.
size();
122 for (
int iface = 0; iface < m_faces.size(); iface++)
129 for (
int icomp = 0; icomp < compSize; icomp++)
131 int isrccomp = a_srcInterval.
begin() + icomp;
132 int idstcomp = a_dstInterval.
begin() + icomp;
133 (*this)(face, idstcomp) = a_src(face, isrccomp);
140 template <
class T>
inline 146 CH_assert((a_comp >= 0) && (a_comp < this->m_nComp));
148 T* dataPtr = this->m_data;
151 for (
int iface = 0; iface < m_faces.size(); ++iface)
153 if (a_face == m_faces[iface])
165 retval += a_comp*this->m_nFaces;
170 template <
class T>
inline 184 template <
class T>
inline 192 T* dataPtr = getIndex(a_ndin, a_comp);
196 template <
class T>
inline 199 const int& a_comp)
const 204 T* dataPtr = getIndex(a_ndin, a_comp);
208 template <
class T>
inline 214 return m_data + a_comp*m_nFaces;
217 template <
class T>
inline 223 return m_data + a_comp*m_nFaces;
226 template <
class T>
inline 237 template <
class T>
inline 243 for (
int iface = 0; iface < m_faces.size(); iface++)
253 template <
class T>
inline 262 getFaceSubset(faces, a_region);
269 for (
int iface = 0; iface < faces.
size(); iface++)
271 for (
int icomp = a_comps.
begin(); icomp <= a_comps.
end(); icomp++)
273 const T& dataPt = (*this)(faces[iface], icomp);
275 datasize += pointsize;
279 int retval = facesize + datasize;
283 pout() <<
"###############" << std::endl;
284 pout() <<
"MiniIFFAB size() for region " << m_ebgraph.getRegion() << std::endl;
285 pout() <<
" a_comps = (" << a_comps.
begin() <<
"," << a_comps.
end() <<
")," << endl;
286 pout() <<
"m_box = " << m_box;
287 pout() <<
"size = " << retval << std::endl;
288 pout() <<
"###############" << std::endl;
294 template <
class T>
inline 303 getFaceSubset(faces, a_region);
306 unsigned char* charbuffer = (
unsigned char *) a_buf;
312 for (
int iface = 0; iface < faces.
size(); iface++)
315 for (
int icomp = a_comps.
begin(); icomp <= a_comps.
end(); icomp++)
318 const T& dataPt = thisFAB(face, icomp);
326 template <
class T>
inline 333 unsigned char* charbuffer = (
unsigned char *) a_buf;
338 for (
int iface = 0; iface < faces.
size(); iface++)
341 for (
int icomp = a_comps.
begin(); icomp <= a_comps.
end(); icomp++)
344 T& dataPt = (*this)(face, icomp);
354 #include "NamespaceFooter.H" std::ostream & pout()
Use this in place of std::cout for program output.
bool isDefined() const
Definition: MiniIFFAB.H:123
int m_nComp
Definition: MiniIFFAB.H:196
int size(const Box &R, const Interval &comps) const
Definition: MiniIFFABI.H:256
IntVect size() const
size functions
Definition: Box.H:1814
#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:297
void setVal(const T &value)
Definition: MiniIFFABI.H:72
Definition: FaceIndex.H:28
void linearListOut(void *const a_outBuf, const Vector< T > &a_inputT)
Definition: SPMDI.H:255
int size() const
Definition: Interval.H:64
int begin() const
Definition: Interval.H:86
bool contains(const IntVect &p) const
Definition: Box.H:1888
const IntVect & gridIndex(const Side::LoHiSide &a_sd) const
void clear()
Definition: MiniIFFABI.H:173
MiniIFFAB()
Definition: MiniIFFABI.H:23
const int & direction() const
Definition: LoHiSide.H:31
Geometric description within a box.
Definition: EBGraph.H:432
const int SpaceDim
Definition: SPACE.H:39
void setDefaultValues()
Definition: MiniIFFABI.H:228
void resize(unsigned int isize)
Definition: Vector.H:323
void linearIn(void *buf, const Box &R, const Interval &comps)
Definition: MiniIFFABI.H:329
void push_back(const T &in)
Definition: Vector.H:283
Structure for passing component ranges in code.
Definition: Interval.H:23
void linearOut(void *const a_outBuf, const T &inputT)
Definition: SPMDI.H:32
int linearSize(const T &inputT)
Definition: SPMDI.H:20
size_t size() const
Definition: Vector.H:177
T * dataPtr(const int &a_comp)
Definition: MiniIFFABI.H:210
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:240
T * getIndex(const FaceIndex &a_face, const int &a_comp) const
Definition: MiniIFFABI.H:143
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:99
T & operator()(const FaceIndex &a_face, const int &varlocin)
Definition: MiniIFFABI.H:186
void define(const Box &a_box, const EBGraph &a_ebgraph, const int &a_direction, const int &a_nvarin)
Definition: MiniIFFABI.H:48
void linearListIn(Vector< T > &a_outputT, const void *const a_inBuf)
Definition: SPMDI.H:226
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:287
int end() const
Definition: Interval.H:91
bool isEmpty() const
{ Comparison Functions}
Definition: Box.H:1863
void linearIn(T &a_outputT, const void *const inBuf)
Definition: SPMDI.H:26
Box m_box
Definition: MiniIFFAB.H:184