11 #ifndef _BASEIVFABI_H_ 12 #define _BASEIVFABI_H_ 21 #include "NamespaceHeader.H" 30 s_verbose = a_verbose;
39 s_verboseDebug = a_verboseDebug;
42 template <
class T>
inline 49 template <
class T>
inline 56 template <
class T>
inline 62 template <
class T>
inline 68 template <
class T>
inline 74 define(a_ivsin, a_ebgraph, a_nvarin);
77 #pragma intel optimization_level 0 78 template <
class T>
inline 90 m_ebgraph = a_ebGraph;
96 m_fab.resize(minbox, 1);
101 for (ivsit.
reset(); ivsit.
ok(); ++ivsit)
103 m_nVoFs += m_ebgraph.numVoFs(ivsit());
112 m_data.resize(m_nVoFs*m_nComp);
113 T* currentLoc = &m_data[0];
114 for (ivsit.
reset(); ivsit.
ok(); ++ivsit)
116 int numVoFs = m_ebgraph.numVoFs(ivsit());
117 m_fab(ivsit(), 0) = currentLoc;
118 currentLoc += numVoFs;
124 template <
class T>
inline 128 for (
int ivec = 0; ivec < m_nVoFs*m_nComp; ivec++)
130 m_data[ivec] = a_value;
135 template <
class T>
inline 142 int ioffset = ivar*m_nVoFs;
143 for (
int ivec = 0; ivec < m_nVoFs; ivec ++)
145 m_data[ivec+ioffset] = a_value;
149 template <
class T>
inline 159 if ( !m_ivs.isEmpty() )
162 ivsIntersect &= a_box;
164 for (
VoFIterator vofit(ivsIntersect, m_ebgraph); vofit.
ok(); ++vofit)
167 for (
int icomp = a_nstart; icomp < a_numcomp; icomp++)
169 thisFAB(vof, icomp) = a_value;
175 template <
class T>
inline 193 CH_assert( (a_fromBox == a_toBox) || m_ebgraph.getDomain().isPeriodic() );
194 Box intBox = a_fromBox;
196 ivsIntersect &= a_src.
m_ivs;
197 ivsIntersect &= intBox;
199 int compSize = a_srcInterval.
size();
200 for (
VoFIterator vofit(ivsIntersect, m_ebgraph); vofit.
ok(); ++vofit)
203 for (
int icomp = 0; icomp < compSize; icomp++)
205 int isrccomp = a_srcInterval.
begin() + icomp;
206 int idstcomp = a_dstInterval.
begin() + icomp;
207 thisFAB(vof, idstcomp) = a_src(vof, isrccomp);
213 template <
class T>
inline 232 for (
unsigned int ivof = 0; ivof < vofs.
size(); ivof++)
236 IntVect iv = vofs[ivof].gridIndex();
237 pout() <<
"BaseIVFAB::size vof " << vofs[ivof] <<
" Is irregular? " << m_ebgraph.isIrregular(iv) << endl;
239 for (
int icomp = a_comps.
begin(); icomp <= a_comps.
end(); icomp++)
241 const T& dataPt = (*this)(vofs[ivof], icomp);
243 datasize += pointsize;
248 int retval = vofsize + datasize;
251 pout() <<
"BaseIVFAB::size " << retval << endl;
256 template <
class T>
inline 262 CH_TIME(
"BaseIVFAB::linearout");
265 pout() <<
"" << endl;
266 pout() <<
"BaseIVFAB<T>::linearOut " <<
" for box " << a_region << endl;
276 unsigned char* charbuffer = (
unsigned char *) a_buf;
281 for (
unsigned int ivof = 0; ivof < vofs.
size(); ivof++)
286 pout() <<
"vof " << vof << endl;
288 for (
int icomp = a_comps.
begin(); icomp <= a_comps.
end(); icomp++)
290 const T& dataPt = (*this)(vof, icomp);
298 template <
class T>
inline 302 CH_TIME(
"BaseIVFAB::linearin");
307 pout() <<
"" << endl;
308 pout() <<
"BaseIVFAB<T>::linearIn " <<
" for box " << a_region << endl;
311 unsigned char* charbuffer = (
unsigned char *) a_buf;
316 for (
unsigned int ivof = 0; ivof < vofs.
size(); ivof++)
321 pout() <<
"vof " << vof << endl;
323 for (
int icomp = a_comps.
begin(); icomp <= a_comps.
end(); icomp++)
325 T& dataPt = (*this)(vof, icomp);
333 template <
class T>
inline 339 CH_assert((a_comp >= 0) && (a_comp < m_nComp));
341 T* dataPtr = (T*)(m_fab(a_vof.
gridIndex(), 0));
343 dataPtr += a_comp*m_nVoFs;
347 template <
class T>
inline 363 template <
class T>
inline 367 return (m_isDefined);
370 template <
class T>
inline 377 template <
class T>
inline 383 static T* dummy = NULL;
384 if (m_nVoFs == 0)
return dummy;
386 T* retval = &(m_data[a_comp*m_nVoFs]);
390 template <
class T>
inline 396 static T* dummy = NULL;
397 if (m_nVoFs == 0)
return dummy;
398 const T* retval = &(m_data[a_comp*m_nVoFs]);
403 template <
class T>
inline 410 template <
class T>
inline 418 T* dataPtr = getIndex(a_ndin, a_comp);
422 template <
class T>
inline 425 const int& a_comp)
const 431 T* dataPtr = getIndex(a_ndin, a_comp);
435 template <
class T>
inline 446 #include "NamespaceFooter.H" std::ostream & pout()
Use this in place of std::cout for program output.
static void setVerbose(bool a_verbose)
Definition: BaseIVFABI.H:28
virtual ~BaseIVFAB()
Definition: BaseIVFABI.H:63
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
#define CH_assert(cond)
Definition: CHArray.H:37
IntVectSet m_ivs
Definition: BaseIVFAB.H:261
BaseIVFAB()
Definition: BaseIVFABI.H:57
virtual void setDefaultValues()
Definition: BaseIVFABI.H:437
void copy(const Box &a_fromBox, const Interval &a_destInterval, const Box &a_toBox, const BaseIVFAB< T > &a_src, const Interval &a_srcInterval)
Definition: BaseIVFABI.H:177
void linearListOut(void *const a_outBuf, const Vector< T > &a_inputT)
Definition: SPMDI.H:258
int size() const
Definition: Interval.H:75
void setVal(const T &value)
Definition: BaseIVFABI.H:126
int begin() const
Definition: Interval.H:97
const IntVect & gridIndex() const
Definition: VolIndex.H:125
bool isDefined() const
Definition: BaseIVFABI.H:365
int size(const Box &R, const Interval &comps) const
Definition: BaseIVFABI.H:214
const Vector< VolIndex > getVector() const
const IntVectSet & getIVS() const
Definition: BaseIVFABI.H:51
static void setVerboseDebug(bool a_verboseDebug)
Definition: BaseIVFABI.H:37
void reset()
same as begin()
Definition: IntVectSet.H:722
bool ok() const
returns true if this iterator is still in its IntVectSet
Definition: IntVectSet.H:711
Geometric description within a box.
Definition: EBGraph.H:427
#define CH_TIME(name)
Definition: CH_Timer.H:82
Structure for passing component ranges in code.
Definition: Interval.H:23
void linearOut(void *const a_outBuf, const T &inputT)
Definition: SPMDI.H:33
int linearSize(const T &inputT)
Definition: SPMDI.H:21
virtual void clear()
Definition: BaseIVFABI.H:349
virtual void define(const IntVectSet &a_region, const EBGraph &a_ebgraph, const int &a_nvarin)
Definition: BaseIVFABI.H:80
size_t size() const
Definition: Vector.H:192
void linearOut(void *buf, const Box &R, const Interval &comps) const
Definition: BaseIVFABI.H:257
virtual T * getIndex(const VolIndex &a_vof, const int &a_comp) const
get index into vector
Definition: BaseIVFABI.H:335
const EBGraph & getEBGraph() const
Definition: BaseIVFABI.H:44
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
int m_nComp
Definition: BaseIVFAB.H:254
void linearListIn(Vector< T > &a_outputT, const void *const a_inBuf)
Definition: SPMDI.H:229
Iterator for all vofs within an IntVectSet and an Ebgraph.
Definition: VoFIterator.H:27
int cellIndex() const
Definition: VolIndex.H:133
void linearIn(void *buf, const Box &R, const Interval &comps)
Definition: BaseIVFABI.H:299
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
int linearListSize(const Vector< T > &a_input)
Definition: SPMDI.H:290
T * dataPtr(int a_dataType, int a_ivar)
Definition: BaseIVFAB.H:64
T & operator()(const VolIndex &a_vof, const int &varlocin)
Definition: BaseIVFABI.H:412
Volume of Fluid Index.
Definition: VolIndex.H:31
int end() const
Definition: Interval.H:102
Iterator for an IntVectSet.
Definition: IntVectSet.H:640
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.
bool isEmpty() const
Returns true if no IntVects are in this IntVectSet.
int nComp() const
Definition: BaseIVFABI.H:405
int numVoFs() const
Definition: BaseIVFABI.H:372
Definition: BaseIVFAB.H:32