20 #include "NamespaceHeader.H" 29 s_verbose = a_verbose;
32 template <
class T>
inline 39 template <
class T>
inline 45 template <
class T>
inline 51 template <
class T>
inline 56 define(a_ivsin, a_nvarin);
59 template <
class T>
inline 73 m_ivmap.resize(minbox, 1);
75 for (ivsit.
reset(); ivsit.
ok(); ++ivsit)
78 m_ivmap(iv,0) = m_nIvs;
82 if ( (m_nIvs > 0) && m_nComp > 0)
84 m_dataPtr =
new T[m_nComp*m_nIvs];
103 m_hiVect[0] = m_nIvs;
115 template <
class T>
inline 120 for (
int ivec = 0; ivec < m_nIvs*m_nComp; ivec++)
121 m_dataPtr[ivec] = a_value;
124 template <
class T>
inline 143 Box intBox = a_fromBox;
145 ivsIntersect &= a_src.
m_ivs;
146 ivsIntersect &= intBox;
148 int compSize = a_srcInterval.
size();
152 for (
int icomp = 0; icomp < compSize; icomp++)
154 int isrccomp = a_srcInterval.
begin() + icomp;
155 int idstcomp = a_dstInterval.
begin() + icomp;
156 thisFAB(iv, idstcomp) = a_src(iv, isrccomp);
170 int numberThings = subset.
numPts();
171 return numberThings*
sizeof(
Real)*a_comps.
size() +
sizeof(int);
174 template <
class T>
inline 183 int numberThings = subset.
numPts();
185 int sizeofThing = dummy.linearSize();
186 int retval = numberThings*sizeofThing +
sizeof(int);
197 int count = subset.
numPts();
198 int* iptr = (
int*)a_buf;
204 for (
int c=a_comps.
begin(); c<=a_comps.
end(); c++ )
206 int iloc = getIndex(iv, c);
207 *rptr++ = m_dataPtr[iloc];
210 CH_assert( ((
char*)rptr) - ((
char*)a_buf) == size(a_region,a_comps) );
213 template <
class T>
inline 222 int count = subset.
numPts();
223 int *iptr = (
int*)a_buf;
226 int Tsz = dummy.linearSize();
227 char* cptr = (
char*)iptr;
231 int iloc = getIndex(iv, 0);
232 m_dataPtr[iloc].linearOut( (
void*)cptr );
236 CH_assert( cptr - ((
char*)a_buf) == size(a_region,a_comps) );
243 int count_expected = subset.
numPts();
244 int *iptr = (
int*)a_buf;
245 int count_received = *iptr++;
246 if ( count_expected != count_received )
254 for (
int c=a_comps.
begin(); c<=a_comps.
end(); c++ )
256 int iloc = getIndex(iv, c);
257 m_dataPtr[iloc] = *rptr++;
260 CH_assert( ((
char*)rptr) - ((
char*)a_buf) == size(a_region,a_comps) );
263 template <
class T>
inline 270 int count_expected = subset.
numPts();
271 int *iptr = (
int*)a_buf;
272 int count_received = *iptr++;
273 CH_assert( count_expected == count_received );
275 int Tsz = dummy.linearSize();
276 char* cptr = (
char*)iptr;
280 int iloc = getIndex(iv, 0);
281 m_dataPtr[iloc].linearIn( (
void*)cptr );
285 CH_assert( cptr - ((
char*)a_buf) == size(a_region,a_comps) );
288 template <
class T>
inline 294 CH_assert((a_comp >= 0) && (a_comp < m_nComp));
296 int ioffset = m_ivmap(a_iv, 0);
300 ioffset += m_nIvs*a_comp;
304 template <
class T>
inline 312 if (m_dataPtr != NULL)
320 template <
class T>
inline 324 return (m_isDefined);
327 template <
class T>
inline 334 template <
class T>
inline 341 template <
class T>
inline 349 int iloc = getIndex(a_ndin, a_comp);
350 return(m_dataPtr[iloc]);
353 template <
class T>
inline 356 const int& a_comp)
const 361 int iloc = getIndex(a_ndin, a_comp);
362 return(m_dataPtr[iloc]);
365 template <
class T>
inline 372 return m_dataPtr + a_comp*m_nIvs;
375 template <
class T>
inline 382 return m_dataPtr + a_comp*m_nIvs;
385 template <
class T>
inline 389 return m_loVect.getVect();
392 template <
class T>
inline 396 return m_hiVect.getVect();
399 template <
class T>
inline 411 template <
class T>
inline 419 template <
class T>
inline 425 #include "NamespaceFooter.H" static void setVerbose(bool a_verbose)
Definition: IVSFABI.H:27
const int * hiVect() const
Definition: IVSFABI.H:394
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
#define CH_SPACEDIM
Definition: SPACE.H:52
#define CH_assert(cond)
Definition: CHArray.H:37
void copy(const Box &a_fromBox, const Interval &a_destInterval, const Box &a_toBox, const IVSFAB< T > &a_src, const Interval &a_srcInterval)
Definition: IVSFABI.H:126
void define(const IntVectSet &a_region, const int &a_nvarin)
Definition: IVSFABI.H:61
const int * loVect() const
Definition: IVSFABI.H:387
int size() const
Definition: Interval.H:64
IntVectSet m_ivs
Definition: IVSFAB.H:188
int begin() const
Definition: Interval.H:86
void linearIn(void *buf, const Box &R, const Interval &comps)
Definition: IVSFABI.H:264
void linearOut(void *buf, const Box &R, const Interval &comps) const
Definition: IVSFABI.H:214
int getIndex(const IntVect &a_iv, const int &a_comp) const
Definition: IVSFABI.H:290
int m_nComp
Definition: IVSFAB.H:176
int numPts() const
Returns the number of IntVects in this IntVectSet.
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
void setVal(const T &value)
Definition: IVSFABI.H:117
int numIvs() const
Definition: IVSFABI.H:329
int size(const Box &R, const Interval &comps) const
Definition: IVSFABI.H:175
Structure for passing component ranges in code.
Definition: Interval.H:23
void setDefaultValues()
Definition: IVSFABI.H:401
static const IntVect Unit
Definition: IntVect.H:632
~IVSFAB()
Definition: IVSFABI.H:46
double Real
Definition: REAL.H:33
const IntVectSet & getIVS() const
Definition: IVSFABI.H:34
int nComp() const
Definition: IVSFABI.H:336
T & operator()(const IntVect &a_iv, const int &varlocin)
Definition: IVSFABI.H:343
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.
static const IntVect Zero
Definition: IntVect.H:627
bool isDefined() const
Definition: IVSFABI.H:322
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
IVSFAB< T > & operator=(const IVSFAB< T > &)
Definition: IVSFABI.H:413
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
int end() const
Definition: Interval.H:91
Iterator for an IntVectSet.
Definition: IntVectSet.H:640
void clear()
Definition: IVSFABI.H:306
const Box & minBox() const
Returns the minimum enclosing box of this IntVectSet.
bool isEmpty() const
Returns true if no IntVects are in this IntVectSet.
const T * dataPtr(const int &a_comp) const
Definition: IVSFABI.H:367
IVSFAB()
Definition: IVSFABI.H:40