Chombo + EB  3.0
BaseFabImplem.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #ifndef _BASEFABIMPLEM_H_
12 #define _BASEFABIMPLEM_H_
13 
14 #include "BaseFabMacros.H"
15 #include "CH_Timer.H"
16 #include "SliceSpec.H"
17 #include "MayDay.H"
18 #include "parstream.H"
19 #include "NamespaceHeader.H"
20 
21 //
22 // BaseFab<Real> specializations
23 //
24 
25 template < > void BaseFab<Real>::define();
26 
27 template < > void BaseFab<Real>::undefine();
28 
29 template < > void BaseFab<Real>::setVal (Real val);
30 
31 template < > void BaseFab<int>::define();
32 
33 template < > void BaseFab<int>::undefine();
34 
35 template < > int BaseFab<int>::test();
36 
37 template <class T> int BaseFab<T>::testBoxAndComp()
38 {
39  MayDay::Warning("pretty minimal test");
41  BaseFab<T> blerg;
42  blerg.define(b, 1);
43 
44  if (blerg.nComp() != 1)
45  {
46  pout() << "ncomp busted" << endl;
47  return -2;
48  }
49  if (blerg.box() != b)
50  {
51  pout() << "box return busted" << endl;
52  return -2;
53  }
54  for (int idir = 0; idir < SpaceDim; idir++)
55  {
56  if (blerg.size()[idir] != 2)
57  {
58  pout() << "size busted" <<endl;
59  return -3;
60  }
61  }
62 
63  if (blerg.smallEnd() != IntVect::Zero)
64  {
65  pout() << "smallend busted" <<endl;
66  return -4;
67  }
68  if (blerg.bigEnd() != IntVect::Unit)
69  {
70  pout() << "bigend busted" <<endl;
71  return -5;
72  }
73  return 0;
74 }///
75 template <class T> int BaseFab<T>::test()
76 {
77  int retval = testBoxAndComp();
78  return retval;
79 }
80 
81 //
82 // Implementation.=====================================
83 //
84 
85 template <class T> inline BaseFab<T>::BaseFab()
86  :
87  m_domain(Box()),
88  m_nvar(0),
89  m_numpts(0),
90  m_truesize(0),
91  m_dptr(0),
92  m_aliased(false)
93 {
94 }
95 
96 template <class T> inline BaseFab<T>::BaseFab(const Box& a_bx,
97  int a_n,
98  T* a_alias)
99  :
100  m_domain(a_bx),
101  m_nvar(a_n),
102  m_numpts(a_bx.numPts()),
103  m_truesize(a_bx.numPts() * a_n),
104  m_dptr(0),
105  m_aliased(false)
106 {
107  if (a_alias != NULL)
108  {
109  m_dptr = a_alias;
110  m_aliased = true;
111  }
112  else
113  {
114  define();
115  }
116 }
117 
118 template <class T> inline BaseFab<T>::BaseFab(const Interval& a_comps,
119  BaseFab<T>& a_original)
120  :
121  m_domain(a_original.m_domain),
122  m_nvar(a_comps.size()),
123  m_numpts(a_original.m_numpts),
124  m_truesize(a_original.m_numpts * m_nvar),
125  m_dptr(a_original.dataPtr(a_comps.begin())),
126  m_aliased(true)
127 {
128 }
129 
130 template <class T> inline BaseFab<T>::~BaseFab()
131 {
132  undefine();
133 }
134 
135 template <class T> void BaseFab<T>::resize(const Box& a_b,
136  int a_n,
137  T* a_alias)
138 {
139  // m_nvar = a_n;
140  // m_domain = a_b;
141  // m_numpts = m_domain.numPts();
142  //
143  // if (m_dptr == 0)
144  // {
145  // define();
146  // }
147  // else if (m_nvar*m_numpts > m_truesize)
148  // {
149  // undefine();
150  // define();
151  // }
152 
153  undefine();
154 
155  m_nvar = a_n;
156  m_domain = a_b;
158 
159  if (a_alias != NULL)
160  {
161  m_dptr = a_alias;
162  m_aliased = true;
163  }
164  else
165  {
166  m_aliased = false;
167  define();
168  }
169 }
170 
171 template <class T> inline void BaseFab<T>::define(const Interval& a_comps,
172  BaseFab<T>& a_original)
173 {
174  undefine();
175 
176  m_domain = a_original.m_domain;
177  m_numpts = a_original.m_numpts;
178  m_truesize = a_original.m_numpts*a_comps.size();
179  m_nvar = a_comps.size();
180  m_dptr = a_original.dataPtr(a_comps.begin());
181  m_aliased = true;
182  // resize(a_original.m_domain, a_comps.size(),
183  // a_original.dataPtr(a_comps.begin()));
184 }
185 
186 template <class T> inline void BaseFab<T>::clear()
187 {
188  undefine();
189 
190  m_domain = Box();
191  m_nvar = 0;
192  m_numpts = 0;
193 }
194 
195 template <class T> inline int BaseFab<T>::nComp() const
196 {
197  return m_nvar;
198 }
199 
200 template <class T> Arena* BaseFab<T>::s_Arena = NULL;
201 
202 template <class T> inline const Box& BaseFab<T>::box() const
203 {
204  return m_domain;
205 }
206 
207 template <class T> inline IntVect BaseFab<T>::size() const
208 {
209  return m_domain.size();
210 }
211 
212 template <class T> inline const IntVect& BaseFab<T>::smallEnd() const
213 {
214  return m_domain.smallEnd();
215 }
216 
217 template <class T> inline const IntVect& BaseFab<T>::bigEnd() const
218 {
219  return m_domain.bigEnd();
220 }
221 
222 template <class T> inline T& BaseFab<T>::operator () (const IntVect& a_p,
223  int a_n)
224 {
225  CH_assert(a_n >= 0);
226  CH_assert(a_n < m_nvar);
227  CH_assert(!(m_dptr == 0));
229 
230  return m_dptr[m_domain.index(a_p) + a_n * m_numpts];
231 }
232 
233 template <class T> inline T& BaseFab<T>::operator () (const IntVect& a_p)
234 {
235  CH_assert(!(m_dptr == 0));
237 
238  return m_dptr[m_domain.index(a_p)];
239 }
240 
241 template <class T> inline const T& BaseFab<T>::operator () (const IntVect& a_p,
242  int a_n) const
243 {
244  CH_assert(a_n >= 0);
245  CH_assert(a_n < m_nvar);
246  CH_assert(!(m_dptr == 0));
248 
249  return m_dptr[m_domain.index(a_p) + a_n * m_numpts];
250 }
251 
252 template <class T> inline const T& BaseFab<T>::operator () (const IntVect& a_p) const
253 {
254  CH_assert(!(m_dptr == 0));
256 
257  return m_dptr[m_domain.index(a_p)];
258 }
259 
260 template <class T> inline void BaseFab<T>::getVal(T* a_data,
261  const IntVect& a_pos,
262  int a_n,
263  int a_numcomp) const
264 {
265  const int loc = m_domain.index(a_pos);
266  const long size = m_domain.numPts();
267 
268  CH_assert(!(m_dptr == 0));
269  CH_assert(a_n >= 0 && a_n + a_numcomp <= m_nvar);
270 
271  for (int k = 0; k < a_numcomp; k++)
272  {
273  a_data[k] = m_dptr[loc+(a_n+k)*size];
274  }
275 }
276 
277 template <class T> inline void BaseFab<T>::getVal(T* a_data,
278  const IntVect& a_pos) const
279 {
280  getVal(a_data,a_pos,0,m_nvar);
281 }
282 
283 template <class T> inline const int* BaseFab<T>::loVect() const
284 {
285  return m_domain.loVect();
286 }
287 
288 template <class T> inline const int* BaseFab<T>::hiVect() const
289 {
290  return m_domain.hiVect();
291 }
292 
293 template <class T> inline const int* BaseFab<T>::nCompPtr() const
294 {
295  CH_assert(!(m_dptr == 0));
296 
297  return &m_nvar;
298 }
299 
300 template <class T> inline T* BaseFab<T>::dataPtr(int a_n)
301 {
302  CH_assert(!(m_dptr == 0));
303  CH_assert((a_n >= 0) && (a_n < m_nvar));
304 
305  return &m_dptr[a_n * m_numpts];
306 }
307 
308 template <class T> inline const T* BaseFab<T>::dataPtr(int a_n) const
309 {
310  CH_assert(!(m_dptr == 0));
311  CH_assert((a_n >= 0) && (a_n < m_nvar));
312 
313  return &m_dptr[a_n * m_numpts];
314 }
315 
316 template <class T> inline bool BaseFab<T>::contains(const BaseFab<T>& a_fab) const
317 {
318  return box().contains(a_fab.box()) && m_nvar <= a_fab.m_nvar;
319 }
320 
321 template <class T> inline bool BaseFab<T>::contains (const Box& a_bx) const
322 {
323  return box().contains(a_bx);
324 }
325 
326 template <class T> inline void BaseFab<T>::setVal(T a_x,
327  const Box& a_bx,
328  int a_nstart,
329  int a_numcomp)
330 {
331  performSetVal(a_x,a_bx,a_nstart,a_numcomp);
332 }
333 
334 template <class T> inline void BaseFab<T>::setVal(T a_x,
335  const Box& a_bx,
336  int a_n)
337 {
338  performSetVal(a_x,a_bx,a_n,1);
339 }
340 
341 template <class T> inline void BaseFab<T>::setVal(T a_x,
342  int a_n)
343 {
344  performSetVal(a_x,m_domain,a_n,1);
345 }
346 
347 template <class T> inline void BaseFab<T>::setVal(T a_x)
348 {
349  performSetVal(a_x,box(),0,m_nvar);
350 }
351 
352 template <class T>
354  const Box& a_srcbox,
355  int a_srccomp,
356  const Box& a_destbox,
357  int a_destcomp,
358  int a_numcomp)
359 {
360  CH_assert(a_srcbox.sameSize(a_destbox));
361  CH_assert(a_src.box().contains(a_srcbox));
362  CH_assert(m_domain.contains(a_destbox));
363  CH_assert(a_srccomp >= 0 && a_srccomp+a_numcomp <= a_src.nComp());
364  CH_assert(a_destcomp >= 0 && a_destcomp+a_numcomp <= m_nvar);
365 
366  performCopy(a_src,a_srcbox,a_srccomp,a_destbox,a_destcomp,a_numcomp);
367 
368  return *this;
369 }
370 
371 template <class T>
373  int a_srccomp,
374  int a_destcomp,
375  int a_numcomp)
376 {
377  CH_assert(a_srccomp >= 0 && a_srccomp + a_numcomp <= a_src.m_nvar);
378  CH_assert(a_destcomp >= 0 && a_destcomp + a_numcomp <= m_nvar);
379 
380  Box overlap(m_domain);
381  overlap &= a_src.m_domain;
382 
383  if (!overlap.isEmpty())
384  {
385  performCopy(a_src,overlap,a_srccomp,overlap,a_destcomp,a_numcomp);
386  }
387 
388  return *this;
389 }
390 
391 template <class T>
393  const Box& a_destbox)
394 {
395  CH_assert(m_nvar <= a_src.m_nvar);
396  CH_assert(m_domain.contains(a_destbox));
397 
398  Box overlap(a_destbox);
399  overlap &= a_src.m_domain;
400 
401  if (!overlap.isEmpty())
402  {
403  performCopy(a_src,overlap,0,overlap,0,m_nvar);
404  }
405 
406  return *this;
407 }
408 
409 template <class T>
411 {
412  CH_assert(m_nvar <= a_src.m_nvar);
414 
415  Box overlap(m_domain);
416  overlap &= a_src.m_domain;
417 
418  if (!overlap.isEmpty())
419  {
420  performCopy(a_src,overlap,0,overlap,0,m_nvar);
421  }
422 
423  return *this;
424 }
425 
426 template <class T> inline void BaseFab<T>::copy(const Box& a_RegionFrom,
427  const Interval& a_Cdest,
428  const Box& a_RegionTo,
429  const BaseFab<T>& a_src,
430  const Interval& a_Csrc)
431 {
432  if ((this == &a_src) && (a_RegionFrom == a_RegionTo) && (a_Cdest == a_Csrc) )
433  {
434  return;
435  }
436 
437  CH_assert(a_Cdest.size() == a_Csrc.size());
438 
439  copy(a_src, a_RegionFrom, a_Csrc.begin(), a_RegionTo,
440  a_Cdest.begin(), a_Cdest.size());
441 }
442 
443 template <class T> inline BaseFab<T>& BaseFab<T>::shift(const IntVect& a_v)
444 {
445  m_domain += a_v;
446 
447  return *this;
448 }
449 
450 template <class T> inline BaseFab<T>& BaseFab<T>::shift(int a_idir,
451  int a_ncells)
452 {
453  m_domain.shift(a_idir,a_ncells);
454 
455  return *this;
456 }
457 
458 template <class T> inline BaseFab<T> & BaseFab<T>::shiftHalf(int a_idir,
459  int a_numHalfs)
460 {
461  m_domain.shiftHalf(a_idir,a_numHalfs);
462 
463  return *this;
464 }
465 
466 template <class T> inline BaseFab<T> & BaseFab<T>::shiftHalf(const IntVect& a_v)
467 {
468  m_domain.shiftHalf(a_v);
469 
470  return *this;
471 }
472 
473 template <class T> inline int BaseFab<T>::size(const Box& a_box,
474  const Interval& a_comps) const
475 {
476  return a_box.numPts() * sizeof(T) * a_comps.size();
477 }
478 
479 template <class T> inline void BaseFab<T>::linearOut(void* a_buf,
480  const Box& a_R,
481  const Interval& a_comps) const
482 {
483  void* buffer;
484  buffer = linearOut2(a_buf, a_R, a_comps);
485 }
486 template <class T> inline void* BaseFab<T>::linearOut2(void* a_buf,
487  const Box& a_R,
488  const Interval& a_comps) const
489 {
490  T* buffer = (T*)a_buf;
491 
492  ForAllThisCBNN(T,a_R,a_comps.begin(),a_comps.size())
493  {
494  *buffer = thisR;
495  ++buffer;
496  } EndFor;
497  return (void*)buffer;
498 }
499 
500 template <class T> inline void BaseFab<T>::linearIn(void* a_buf,
501  const Box& a_R,
502  const Interval& a_comps)
503 {
504  // pout() << "basefab::linearin box = " << a_R << "comps = (" << a_comps.begin() << "," << a_comps.end() << ")" << endl;
505  void* buffer;
506  buffer = linearIn2(a_buf, a_R, a_comps);
507 }
508 
509 template <class T> inline void* BaseFab<T>::linearIn2(void* a_buf,
510  const Box& a_R,
511  const Interval& a_comps)
512 {
513  T* buffer = (T*)a_buf;
514 
515  ForAllThisBNN(T,a_R,a_comps.begin(),a_comps.size())
516  {
517  thisR = *buffer;
518  ++buffer;
519  } EndFor;
520 
521  return (void*) buffer;
522 }
523 
524 template <class T> inline void BaseFab<T>::define()
525 {
526  CH_assert(m_nvar > 0);
527  CH_assert(m_dptr == 0);
528  // CH_assert(m_numpts > 0); // OK if box is empty
530  //CH_assert(!(The_FAB_Arena == 0));// not a sufficient test !!!
531 
532 #ifdef CH_USE_MEMORY_TRACKING
533  if (s_Arena == NULL)
534  {
535  s_Arena = new BArena(name().c_str());
536  }
537 #else
538  if (s_Arena == NULL)
539  {
540  s_Arena = new BArena("");
541  }
542 #endif
543 
544  if (s_Arena == NULL)
545  {
546  MayDay::Error("malloc in basefab failed");
547  }
548 
550  m_dptr = static_cast<T*>(s_Arena->alloc(m_truesize * sizeof(T)));
551 
552 #ifdef CH_USE_MEMORY_TRACKING
553  s_Arena->bytes += m_truesize * sizeof(T) + sizeof(BaseFab<T>);
554  CH_assert(s_Arena->bytes > 0);
555  if (s_Arena->bytes > s_Arena->peak)
556  {
557  s_Arena->peak = s_Arena->bytes;
558  }
559 #endif
560 
561  //
562  // Now call T::T() on the raw memo'ry so we have valid Ts.
563  //
564  T* ptr = m_dptr;
565 
566  for (int i = 0; i < m_truesize; i++, ptr++)
567  {
568  new (ptr) T;
569  }
570 }
571 
572 template <class T> inline void BaseFab<T>::undefine()
573 {
574  //CH_assert(!(The_FAB_Arena == 0));
575  //
576  // Call T::~T() on the to-be-destroyed memory.
577  //
578  if (m_aliased)
579  {
580  m_dptr = 0;
581  return;
582  }
583 
584  if (m_dptr == 0)
585  {
586  return;
587  }
588 
589  T* ptr = m_dptr;
590 
591  for (int i = 0; i < m_truesize; i++, ptr++)
592  {
593  ptr->~T();
594  }
595 
596  s_Arena->free(m_dptr);
597 
598 #ifdef CH_USE_MEMORY_TRACKING
599  s_Arena->bytes -= m_truesize * sizeof(T) + sizeof(BaseFab<T>);
600  CH_assert(s_Arena->bytes >= 0);
601 #endif
602 
603  m_dptr = 0;
604 }
605 
606 template <class T> inline std::string BaseFab<T>::name()
607 {
608  std::string rtn = (typeid(T)).name();
609 
610  return rtn;
611 }
612 
613 template <class T>
614 inline void BaseFab<T>::performCopy(const BaseFab<T>& a_src,
615  const Box& a_srcbox,
616  int a_srccomp,
617  const Box& a_destbox,
618  int a_destcomp,
619  int a_numcomp)
620 {
621  CH_assert(a_src.box().contains(a_srcbox));
622  CH_assert(box().contains(a_destbox));
623  CH_assert(a_destbox.sameSize(a_srcbox));
624  CH_assert(a_srccomp >= 0 && a_srccomp + a_numcomp <= a_src.nComp());
625  CH_assert(a_destcomp >= 0 && a_destcomp + a_numcomp <= nComp());
626  // CH_TIME("BaseFab::performCopy")
627  ForAllThisBNNXCBN(T, a_destbox, a_destcomp, a_numcomp, a_src, a_srcbox, a_srccomp)
628  {
629  thisR = a_srcR;
630  } EndForTX
631 }
632 
633 template <class T> inline void BaseFab<T>::performSetVal(T a_x,
634  const Box& a_bx,
635  int a_nstart,
636  int a_numcomp)
637 {
638  CH_assert(m_domain.contains(a_bx));
639  CH_assert(a_nstart >= 0 && a_nstart + a_numcomp <= m_nvar);
640 
641  if (a_bx == m_domain)
642  {
643  T* data = &m_dptr[a_nstart * m_numpts];
644 
645  for (long i = 0, N = a_numcomp * m_numpts; i < N; i++)
646  {
647  *data++ = a_x;
648  }
649  }
650  else
651  {
652  ForAllThisBNN(T,a_bx,a_nstart,a_numcomp)
653  {
654  thisR = a_x;
655  } EndFor
656  }
657 }
658 
659 template <class T>
661 {
662  return m_aliased;
663 }
664 
665 template <class T> void
667  const SliceSpec& a_sliceSpec ) const
668 {
669  bool outofbounds;
670  Box degenerateBox;
671  this->box().degenerate( degenerateBox, a_sliceSpec, &outofbounds );
672  if ( outofbounds )
673  {
674  MayDay::Error( "Tried to slice out-of-bounds." );
675  }
676  a_slice.define( degenerateBox, this->nComp() );
677  a_slice.copy( *this, degenerateBox );
678 }
679 
680 
681 #include "NamespaceFooter.H"
682 #endif
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
long numPts() const
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
Definition: BaseFab.H:76
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