19 #include "NamespaceHeader.H" 28 s_verbose = a_verbose;
31 template <
class T>
inline 38 template <
class T>
inline 44 template <
class T>
inline 50 template <
class T>
inline 54 define( a_ivsin, a_nvarin );
59 template<
class T>
inline 75 for (ivsit.
reset(); ivsit.
ok(); ++ivsit)
108 template <
class T>
inline 117 template <
class T>
inline 145 ivsIntersect &= set2;
148 int compSize = a_srcInterval.
size();
153 for (
int icomp = 0; icomp < compSize; icomp++)
155 int isrccomp = a_srcInterval.
begin() + icomp;
156 int idstcomp = a_dstInterval.
begin() + icomp;
157 thisFAB(iv, idstcomp) = a_src(iv2, isrccomp);
171 int numberThings = subset.
numPts();
172 int retval = numberThings*
sizeof(
Real)*a_comps.
size() +
sizeof(int);
173 retval +=
SpaceDim*
sizeof(int)*numberThings;
187 for (
int idir=0; idir<
SpaceDim; idir++ ) {
193 IntVect shift = a_region.smallEnd() - ibl;
194 IntVect shift2 = a_region.bigEnd() - ibh;
197 int* iptr = (
int*)rptr;
198 int count_received = *iptr++;
200 for (
int i=0; i<count_received; i++ )
204 for (
int idir=0; idir<
SpaceDim; idir++ ) iv2[idir] = *iptr++;
210 for (
int c=a_comps.
begin(); c<=a_comps.
end(); c++ )
226 for (
int idir=0; idir<
SpaceDim; idir++ ) {
228 *rptr++ = a_region.bigEnd(idir);
231 int* iptr = (
int*)rptr;
232 int count = subset.
numPts();
240 for (
int idir=0; idir<
SpaceDim; idir++ ) *iptr++ = iv[idir];
242 for (
int c=a_comps.
begin(); c<=a_comps.
end(); c++ )
248 CH_assert( ((
char*)rptr) - ((
char*)a_buf) ==
size(a_region,a_comps) );
261 int numberThings = subset.
numPts();
262 int retval = numberThings*
sizeof(int)*a_comps.
size() +
sizeof(int);
263 retval +=
SpaceDim*
sizeof(int)*numberThings;
276 int* rptr = (
int*)a_buf;
277 for (
int idir=0; idir<
SpaceDim; idir++ )
280 *rptr++ = a_region.bigEnd(idir);
283 int* iptr = (
int*)rptr;
284 int count = subset.
numPts();
292 for (
int idir=0; idir<
SpaceDim; idir++ ) *iptr++ = iv[idir];
294 for (
int c=a_comps.
begin(); c<=a_comps.
end(); c++ )
310 int* rptr = (
int*)a_buf;
311 for (
int idir=0; idir<
SpaceDim; idir++ )
318 IntVect shift = a_region.smallEnd() - ibl;
319 IntVect shift2 = a_region.bigEnd() - ibh;
322 int* iptr = (
int*)rptr;
323 int count_received = *iptr++;
325 for (
int i=0; i<count_received; i++ )
329 for (
int idir=0; idir<
SpaceDim; idir++ ) iv2[idir] = *iptr++;
335 for (
int c=a_comps.
begin(); c<=a_comps.
end(); c++ )
343 template <
class T>
inline 348 int numberThings = subset.
numPts();
355 int retval=
sizeof(int);
356 for(
int icomp=a_comps.
begin(); icomp<=a_comps.
end(); icomp++ ) {
363 retval +=
SpaceDim*
sizeof(int)*numberThings;
368 template <
class T>
inline 380 for (
int idir=0; idir<
SpaceDim; idir++ ) {
382 *rptr++ = a_region.bigEnd(idir);
385 int* iptr = (
int*)rptr;
387 int count = subset.
numPts();
392 char* cptr = (
char*)iptr;
398 for (
int idir=0; idir<
SpaceDim; idir++ ) *iptr++ = iv[idir];
401 for(
int c=a_comps.
begin(); c<=a_comps.
end(); c++ ) {
403 m_dataPtr[iloc].linearOut( (
void*)cptr );
407 if( cptr - ((
char*)a_buf) !=
size(a_region,a_comps) ) {
408 pout() <<
" region " << a_region << endl;
409 pout() <<
" comps " << a_comps.
begin() <<
" to " << a_comps.
end() << endl;
410 pout() <<
" size " <<
size(a_region,a_comps) << endl;
411 pout() <<
" ptrdiff " << (cptr - ((
char*)a_buf)) << endl;
413 CH_assert( cptr - ((
char*)a_buf) ==
size(a_region,a_comps) );
416 template <
class T>
inline 427 for (
int idir=0; idir<
SpaceDim; idir++ ) {
433 IntVect shift = a_region.smallEnd() - ibl;
434 IntVect shift2 = a_region.bigEnd() - ibh;
437 int* iptr = (
int*)rptr;
439 int count_received = *iptr++;
443 char* cptr = (
char*)iptr;
444 for (
int i=0; i<count_received; i++ )
448 for (
int idir=0; idir<
SpaceDim; idir++ ) iv2[idir] = *iptr++;
454 for(
int c=a_comps.
begin(); c<=a_comps.
end(); c++ ) {
463 template <
class T>
inline 471 int ioffset =
m_ivmap(a_iv, 0);
479 template <
class T>
inline 495 template <
class T>
inline 502 template <
class T>
inline 509 template <
class T>
inline 516 template <
class T>
inline 524 int iloc =
getIndex(a_ndin, a_comp);
528 template <
class T>
inline 531 const int& a_comp)
const 536 int iloc =
getIndex(a_ndin, a_comp);
540 template <
class T>
inline 550 template <
class T>
inline 560 template <
class T>
inline 567 template <
class T>
inline 587 #include "NamespaceFooter.H" std::ostream & pout()
Use this in place of std::cout for program output.
void clear()
Definition: BaseFabImplem.H:252
static void setVerbose(bool a_verbose)
Definition: IVSFABI.H:26
const int * hiVect() const
Definition: IVSFABI.H:569
const int * getVect() const
Definition: IntVect.H:862
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
#define CH_SPACEDIM
Definition: SPACE.H:51
#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:119
void define(const IntVectSet &a_region, const int &a_nvarin)
Definition: IVSFABI.H:60
IntVect m_loVect
Definition: IVSFAB.H:180
const int * loVect() const
Definition: IVSFABI.H:562
int size() const
Definition: Interval.H:75
IntVectSet m_ivs
Definition: IVSFAB.H:190
IntVect m_hiVect
Definition: IVSFAB.H:181
int begin() const
Definition: Interval.H:99
T * m_dataPtr
Definition: IVSFAB.H:177
void linearIn(void *buf, const Box &R, const Interval &comps)
Definition: IVSFABI.H:417
void linearOut(void *buf, const Box &R, const Interval &comps) const
Definition: IVSFABI.H:369
int getIndex(const IntVect &a_iv, const int &a_comp) const
Definition: IVSFABI.H:465
void makeEmpty()
Modifies this IntVectSet to be empty.
int m_nComp
Definition: IVSFAB.H:178
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:110
const int SpaceDim
Definition: SPACE.H:38
bool m_isDefined
Definition: IVSFAB.H:191
int numIvs() const
Definition: IVSFABI.H:504
int size(const Box &R, const Interval &comps) const
Definition: IVSFABI.H:344
const IntVect & bigEnd() const
Definition: Box.H:1784
int m_nIvs
Definition: IVSFAB.H:179
Structure for passing component ranges in code.
Definition: Interval.H:23
static const IntVect Unit
Definition: IntVect.H:663
const IntVect & smallEnd() const
{ Accessors}
Definition: Box.H:1770
~IVSFAB()
Definition: IVSFABI.H:45
virtual void define(const Box &a_box, int a_comps, T *a_alias=NULL)
Definition: BaseFab.H:205
double Real
Definition: REAL.H:33
const IntVectSet & getIVS() const
Definition: IVSFABI.H:33
int nComp() const
Definition: IVSFABI.H:511
T & operator()(const IntVect &a_iv, const int &varlocin)
Definition: IVSFABI.H:518
static const IntVect Zero
Definition: IntVect.H:658
BaseFab< int > m_ivmap
Definition: IVSFAB.H:189
bool isDefined() const
Definition: IVSFABI.H:497
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
int end() const
Definition: Interval.H:104
Iterator for an IntVectSet.
Definition: IntVectSet.H:640
void clear()
Definition: IVSFABI.H:481
const Box & minBox() const
Returns the minimum enclosing box of this IntVectSet.
bool contains(const IntVect &iv) const
Returns true if this IntVectSet contains iv.
bool isEmpty() const
Returns true if no IntVects are in this IntVectSet.
void shift(const IntVect &iv)
Increment all the IntVects in this IntVectSet by the IntVect iv.
const T * dataPtr(const int &a_comp) const
Definition: IVSFABI.H:542
IVSFAB()
Definition: IVSFABI.H:39