11 #ifndef _BASEFABIMPLEM_H_ 12 #define _BASEFABIMPLEM_H_ 19 #include "NamespaceHeader.H" 44 if (blerg.
nComp() != 1)
46 pout() <<
"ncomp busted" << endl;
51 pout() <<
"box return busted" << endl;
54 for (
int idir = 0; idir <
SpaceDim; idir++)
56 if (blerg.
size()[idir] != 2)
58 pout() <<
"size busted" <<endl;
65 pout() <<
"smallend busted" <<endl;
70 pout() <<
"bigend busted" <<endl;
77 int retval = testBoxAndComp();
271 for (
int k = 0; k < a_numcomp; k++)
273 a_data[k] =
m_dptr[loc+(a_n+k)*size];
356 const Box& a_destbox,
363 CH_assert(a_srccomp >= 0 && a_srccomp+a_numcomp <= a_src.
nComp());
366 performCopy(a_src,a_srcbox,a_srccomp,a_destbox,a_destcomp,a_numcomp);
385 performCopy(a_src,overlap,a_srccomp,overlap,a_destcomp,a_numcomp);
393 const Box& a_destbox)
398 Box overlap(a_destbox);
401 if (!overlap.isEmpty())
418 if (!overlap.isEmpty())
428 const Box& a_RegionTo,
432 if ((
this == &a_src) && (a_RegionFrom == a_RegionTo) && (a_Cdest == a_Csrc) )
439 copy(a_src, a_RegionFrom, a_Csrc.
begin(), a_RegionTo,
476 return a_box.
numPts() *
sizeof(T) * a_comps.
size();
490 T* buffer = (T*)a_buf;
492 ForAllThisCBNN(T,a_R,a_comps.
begin(),a_comps.
size())
497 return (
void*)buffer;
513 T* buffer = (T*)a_buf;
515 ForAllThisBNN(T,a_R,a_comps.
begin(),a_comps.
size())
521 return (
void*) buffer;
532 #ifdef CH_USE_MEMORY_TRACKING 552 #ifdef CH_USE_MEMORY_TRACKING 598 #ifdef CH_USE_MEMORY_TRACKING 608 std::string rtn = (
typeid(T)).name();
617 const Box& a_destbox,
624 CH_assert(a_srccomp >= 0 && a_srccomp + a_numcomp <= a_src.
nComp());
627 ForAllThisBNNXCBN(T, a_destbox, a_destcomp, a_numcomp, a_src, a_srcbox, a_srccomp)
645 for (
long i = 0, N = a_numcomp *
m_numpts; i < N; i++)
652 ForAllThisBNN(T,a_bx,a_nstart,a_numcomp)
665 template <
class T>
void 671 this->
box().
degenerate( degenerateBox, a_sliceSpec, &outofbounds );
677 a_slice.
copy( *
this, degenerateBox );
681 #include "NamespaceFooter.H" std::ostream & pout()
Use this in place of std::cout for program output.
void clear()
Definition: BaseFabImplem.H:186
void degenerate(BaseFab< T > &a_slice, const SliceSpec &a_sliceSpec) const
Definition: BaseFabImplem.H:666
bool contains(const BaseFab< T > &a_fab) const
{ comparison functions}
Definition: BaseFabImplem.H:316
IntVect size() const
size functions
Definition: Box.H:1814
const int * hiVect() const
Definition: Box.H:1841
static Arena * s_Arena
Definition: BaseFab.H:563
#define CH_assert(cond)
Definition: CHArray.H:37
bool sameSize(const Box &b) const
Definition: Box.H:1913
virtual void linearOut(void *a_buf, const Box &a_R, const Interval &a_comps) const
Definition: BaseFabImplem.H:479
void setVal(T a_x, const Box &a_bx, int a_nstart, int a_numcomp)
{ data modification functions}
Definition: BaseFabImplem.H:326
virtual ~BaseFab()
Definition: BaseFabImplem.H:130
int size() const
Definition: Interval.H:64
BaseFab< T > & shift(const IntVect &a_v)
{ domain modification functions}
Definition: BaseFabImplem.H:443
int begin() const
Definition: Interval.H:86
const int * loVect() const
Definition: Box.H:1834
virtual void linearIn(void *a_buf, const Box &a_R, const Interval &a_comps)
Definition: BaseFabImplem.H:500
Definition: SliceSpec.H:42
bool contains(const IntVect &p) const
Definition: Box.H:1888
Box & shiftHalf(int dir, int num_halfs)
static std::string name()
Definition: BaseFabImplem.H:606
Box m_domain
Definition: BaseFab.H:565
const IntVect & bigEnd() const
Definition: BaseFabImplem.H:217
int m_nvar
Definition: BaseFab.H:566
const Box & box() const
Definition: BaseFabImplem.H:202
A Concrete Class for Dynamic Memory Management.
Definition: Arena.H:124
const int * nCompPtr() const
Definition: BaseFabImplem.H:293
const int SpaceDim
Definition: SPACE.H:39
BaseFab()
Definition: BaseFabImplem.H:85
virtual void * alloc(size_t a_sz)=0
virtual void * linearOut2(void *a_buf, const Box &a_R, const Interval &a_comps) const
Same as linearOut, but returns the current location in the buffer.
Definition: BaseFabImplem.H:486
bool isAliased() const
Definition: BaseFabImplem.H:660
virtual void free(void *a_pt)=0
void getVal(T *a_data, const IntVect &a_pos, int a_N, int a_numcomp) const
Definition: BaseFabImplem.H:260
const IntVect & bigEnd() const
Definition: Box.H:1779
BaseFab< T > & shiftHalf(int a_dir, int a_numHalfs)
Definition: BaseFabImplem.H:458
Structure for passing component ranges in code.
Definition: Interval.H:23
T * m_dptr
Definition: BaseFab.H:570
static const IntVect Unit
Definition: IntVect.H:632
const IntVect & smallEnd() const
{ Accessors}
Definition: Box.H:1765
virtual void define(const Box &a_box, int a_comps, T *a_alias=NULL)
Definition: BaseFab.H:166
A Virtual Base Class for Dynamic Memory Managemen.
Definition: Arena.H:40
double Real
Definition: REAL.H:33
void define()
Definition: BaseFabImplem.H:524
virtual void performCopy(const BaseFab< T > &a_src, const Box &a_srcbox, int a_srccomp, const Box &a_destbox, int a_destcomp, int a_numcomp)
Definition: BaseFabImplem.H:614
const int * hiVect() const
Definition: BaseFabImplem.H:288
BaseFab< T > & copy(const BaseFab< T > &a_src, const Box &a_srcbox, int a_srccomp, const Box &a_destbox, int a_destcomp, int a_numcomp)
Definition: BaseFabImplem.H:353
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.
const IntVect & smallEnd() const
Definition: BaseFabImplem.H:212
T * dataPtr(int a_n=0)
Definition: BaseFabImplem.H:300
static const IntVect Zero
Definition: IntVect.H:627
static void Warning(const char *const a_msg=m_nullString)
Print out message to cerr and continue.
bool sameType(const Box &b) const
Definition: Box.H:1897
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
long index(const IntVect &v) const
Definition: Box.H:1954
bool m_aliased
Definition: BaseFab.H:571
long m_truesize
Definition: BaseFab.H:568
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
T & operator()(const IntVect &a_p, int a_N)
Definition: BaseFabImplem.H:222
const int * loVect() const
{ Fortran interface functions}
Definition: BaseFabImplem.H:283
Box & shift(int dir, int nzones)
shift functions
Definition: Box.H:2088
int nComp() const
{ accessors}
Definition: BaseFabImplem.H:195
void resize(const Box &a_b, int a_n=1, T *a_alias=NULL)
Definition: BaseFabImplem.H:135
void undefine()
Definition: BaseFabImplem.H:572
static int testBoxAndComp()
regression test
Definition: BaseFabImplem.H:37
void performSetVal(T a_x, const Box &a_bx, int a_nstart, int a_numcomp)
Definition: BaseFabImplem.H:633
static int test()
regression test
Definition: BaseFabImplem.H:75
bool isEmpty() const
{ Comparison Functions}
Definition: Box.H:1863
virtual void * linearIn2(void *a_buf, const Box &a_R, const Interval &a_comps)
same as linearIn, but returns the current location in the buffer
Definition: BaseFabImplem.H:509
IntVect size() const
Definition: BaseFabImplem.H:207
long m_numpts
Definition: BaseFab.H:567
void degenerate(Box &a_to, const SliceSpec &a_sliceSpec, bool *a_outofbounds=0) const