Chombo + EB + MF  3.2
BaseFab.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 _BASEFAB_H_
12 #define _BASEFAB_H_
13 
14 #include <cstdlib>
15 #include "SPACE.H"
16 #include <string>
17 #include <typeinfo>
18 #include <cmath>
19 
20 #include "Box.H"
21 #include "Arena.H"
22 #include "Interval.H"
23 #include "REAL.H"
24 #include "ShapeArray.H"
25 #include "NamespaceHeader.H"
26 
27 #ifdef USE_PROTO
28 #include "Proto.H"
29 #endif
30 
31 struct SliceSpec;
32 
33 /** A Fortran Array-like Container
34 
35  BaseFab emulates the Fortran array concept.
36  Useful operations can be performed upon
37  BaseFab's in C++, and they provide a convenient interface to
38  Fortran when it is necessary to retreat into that language.
39 
40  `BaseFab' is a template class. Through use of the
41  template, a `BaseFab' may be based upon any class. So far at least,
42  most applications have been based upon simple types like `integer's,
43  `real's, or `doubleprecision's. Most applications do not use BaseFab's
44  directly, but utilize specialized classes derived from BaseFab.
45 
46  It will be easier to use a `BaseFab' if you understand the following
47  concepts. `BaseFab' objects depend on the dimensionality of space
48  (indirectly through the DOMAIN `Box' member). It is
49  typical to define the macro `CH_SPACEDIM' to be 1, 2, or 3 to indicate
50  the dimension of space. See the discussion of class `Box' for more
51  information. A `BaseFab' contains a `Box' DOMAIN, which indicates the
52  integer indexing space over which the array is defined. A `BaseFab'
53  also has NVAR components. By components, we mean that for each
54  point in the rectangular indexing space, there are NVAR values
55  associated with that point. A Fortran array corresponding to a
56  `BaseFab' would have (CH_SPACEDIM+1) dimensions.
57 
58  By design, the array layout in a `BaseFab' mirrors that of a
59  Fortran array. The first index (x direction for example) varies
60  most rapidly, the next index (y direction), if any, varies next
61  fastest. The component index varies last, after all the spatial
62  indices.
63 
64  It is sometimes convenient to be able to treat a sub-array within an
65  existing `BaseFab' as a `BaseFab' in its own right. This is often
66  referred to as 'aliasing' the `BaseFab'. Note that when aliasing is
67  used, the BaseFab's domain will not, in general, be the same as the
68  parent BaseFab's domain, nor will the number of components.
69  BaseFab is a dimension dependent class, so CH_SPACEDIM must be
70  defined as either 1, 2, or 3 when compiling.
71 
72  This is NOT a polymorphic class.
73 
74  It does NOT provide a copy constructor or assignment operator.
75 
76  T MUST have a default constructor and an assignment operator.
77 */
78 
79 extern Real BaseFabRealSetVal;
80 
81 template <class T> class BaseFab
82 {
83 public:
84  /// {\bf constructors, destructor and defines}
85 
86  ///for AggStencil and its minions
87  virtual long offset(const IntVect& a_iv, const int& a_ivar) const
88  {
89  CH_assert(a_ivar >= 0);
90  CH_assert(a_ivar < m_nvar);
91  CH_assert(!(m_dptr == 0));
93 
94  IntVect ivDiff = a_iv - m_domain.smallEnd();
95  IntVect ivSize = m_domain.size();
96  long offset = ivDiff[0];
97 
98 #if CH_SPACEDIM > 1
99  offset += ivDiff[1]*ivSize[0] ;
100 #endif
101 #if CH_SPACEDIM > 2
102  offset += ivDiff[2]*ivSize[0]*ivSize[1];
103 #endif
104 #if CH_SPACEDIM > 3
105  offset += ivDiff[3]*ivSize[0]*ivSize[1]*ivSize[2];
106 #endif
107 #if CH_SPACEDIM > 4
108  offset += ivDiff[4]*ivSize[0]*ivSize[1]*ivSize[2]*ivSize[3];
109 #endif
110 #if CH_SPACEDIM > 5
111  offset += ivDiff[5]*ivSize[0]*ivSize[1]*ivSize[2]*ivSize[3]*ivSize[4];
112 #endif
113  offset += m_numpts * a_ivar;
114 
115  return offset;
116  }
117 
118  /**
119  Constructs an invalid `BaseFab'. The domain is invalid, the
120  number of components is zero, and no actual array memory is
121  allocated. An invalid `BaseFab' must be resize()d
122  (see `BaseFab::resize') before use.
123  */
124  BaseFab ();
125 
126  ///
127  /**
128  Constructs a BaseFab with desired domain and number of components.
129  */
130  BaseFab(const Box& a_bx,
131  int a_n,
132  T* a_alias = NULL);
133 
134  /**
135  Constructs an 'aliased' BaseFab of the requested interval of the
136  argument BaseFab. This BaseFab does not allocate any memory, but
137  sets its data pointer into the memory pointed to by the argument
138  BaseFab. It is the users responsiblity to ensure this aliased
139  BaseFab is not used after the original BaseFab has deleted its data ptr
140  (resize, define(..) called, or destruction, etc.).
141 
142  This aliased BaseFab will also generate side effects (modifying the values
143  of data in one will modify the other's data).
144 
145  This aliased BaseFab will have a_comps.size() components, starting at zero.
146  */
147  BaseFab(const Interval& a_comps,
148  BaseFab<T>& a_original);
149 
150 #ifdef USE_PROTO
151  template <unsigned int C>
152  void define(Proto::BoxData<T,C,1,1>& a_original);
153 
154  template<unsigned int C>
155  operator Proto::BoxData<T,C>()
156  {
157  Proto::BoxData<T,C> bd;
158  bd.define(this->dataPtr(0), this->box(), C);
159  return bd;
160  }
161 
162  template<unsigned int C>
163  operator const Proto::BoxData<T,C>() const
164  {
165  Proto::BoxData<T,C> bd;
166  bd.define(this->dataPtr(0), this->box(), C);
167  return bd;
168  }
169 
170  template <unsigned int C>
171  inline BaseFab(const Proto::BoxData<T,C>& a_bd, const Proto::Point a_center = Proto::Point::Zeros())
172  {
173  m_domain = Box(a_bd.box().low(), a_bd.box().high(), a_center);
174  m_nvar = C;
175  m_numpts = a_bd.box().size();
176  m_truesize = a_bd.size();
177  m_dptr = const_cast<T*>(a_bd.data(a_bd.box().low()));
178  m_aliased = true;
179  }
180 #endif
181 
182  /// move constructor
183  BaseFab(BaseFab<T>&& a_in) noexcept;
184  ///
185  /**
186  The destructor deletes the array memory. Unless this was an aliased
187  BaseFab.
188  */
189  virtual ~BaseFab();
190 
191  /**
192  This function resizes a `BaseFab' so it covers the `Box' a_b with a_n
193  components. If a_alias is not NULL the memory it points to is used
194  (without checking size); otherwise the existing data is lost and the
195  new data is uninitialized.
196  */
197  void resize(const Box& a_b,
198  int a_n = 1,
199  T* a_alias=NULL);
200 
201  /**
202  Make BaseFab with desired domain and number of components. Existing
203  data is lost. Data is in uninialized state.
204  */
205  virtual void define(const Box& a_box,
206  int a_comps,
207  T* a_alias = NULL)
208  {
209  resize(a_box, a_comps, a_alias);
210  }
211 
212  /**
213  alias define. no memory allocated. this BaseFab sets its data ptr
214  directly in the a_original BaseFab data.
215  */
216  virtual void define(const Interval& a_comps,
217  BaseFab<T>& a_original);
218 
219  /**
220  The function returns the `BaseFab' to the invalid state. (See
221  comments for constructors above.) The memory is freed.
222  */
223  void clear();
224 
225  /// {\bf accessors}
226 
227  ///
228  /**
229  Returns the number of components.
230  */
231  int nComp() const;
232 
233  ///
234  /**
235  Returns the domain (box) where the array is defined.
236  */
237  const Box& box() const;
238 
239  /**
240  Returns an IntVect giving the length
241  of the domain in each direction.
242  */
243  IntVect size() const;
244 
245  /**
246  Returns the lower corner of the domain. See class `Box' for analogue.
247  */
248  const IntVect& smallEnd() const;
249 
250  /**
251  Returns the upper corner of the domain. See class `Box' for analogue.
252  */
253  const IntVect& bigEnd() const;
254 
255  ///
256  /**
257  Returns an Interval for the entire range on components.
258  */
260  {
261  return Interval(0, m_nvar-1);
262  }
263 
264  /// move assignment
265  inline BaseFab<T>& operator= (BaseFab<T>&&) noexcept;
266  /**
267  Returns a modifiable lvalue reference to the Nth component value defined
268  at position p in the domain. This operator may be inefficient if the
269  C++ compiler is unable to optimize the C++ code.
270  */
271  T& operator () (const IntVect& a_p,
272  int a_N);
273 
274  T& operator () (const IntVect& a_p);
275 
276 #if CXXSTD>=14
277  /**
278  Begins C-style multi-dimensional array indexing. E.g., fab[c][k][j][i].
279  The m_mdarray only stores a pointer to the data so while this function
280  is const (the pointer does not change), it ultimately returns a modifiable
281  lvalue
282  */
283  auto operator[](const int a_idx) const noexcept
284  {
285  CH_assert(isUsable());
286  return m_mdarray[a_idx];
287  }
288 #endif
289 
290  /**
291  Returns a conatant reference to the Nth component value defined at
292  position p in the domain. This operator may be inefficient if the C++
293  compiler is unable to optimize the C++ code.
294  */
295  const T& operator () (const IntVect& p,
296  int N) const;
297 
298  const T& operator () (const IntVect& p) const;
299 
300  /**
301  This function puts numcomp component values, starting at component N,
302  from position pos in the domain into array data, that must be allocated
303  by the user.
304  */
305  void getVal(T* a_data,
306  const IntVect& a_pos,
307  int a_N,
308  int a_numcomp) const;
309 
310  /**
311  This function puts all component values, starting at component 0,
312  from position pos in the domain into array data, that must be allocated
313  by the user.
314  */
315  void getVal(T* a_data,
316  const IntVect& a_pos) const;
317 
318  ///{\bf Fortran interface functions}
319 
320  /**
321  Returns the lower corner of the domain. Instead of returning them in
322  the form of IntVects, as in smallEnd and bigEnd, it returns the values
323  as a pointer to an array of constant integers. This is useful when
324  interfacing to Fortran subroutines. It should not be used in any other
325  context!!!
326  */
327  const int* loVect() const;
328 
329  /**
330  Returns the upper corner of the domain. Instead of returning them in
331  the form of IntVects, as in smallEnd and bigEnd, it returns the values
332  as a pointer to an array of constant integers. This is useful when
333  interfacing to Fortran subroutines. It should not be used in any other
334  context!!!
335  */
336  const int* hiVect() const;
337 
338  /**
339  Returns a pointer to an integer that contains the number of components
340  in the BaseFab. This is useful when interfacing to Fortran subroutines.
341  It should not be used in any other context!!!
342  */
343  const int* nCompPtr() const;
344 
345  /**
346  Returns a pointer to an object of type T that is the value of the a_nth
347  component associated with the cell at the low end of the domain. This
348  is commonly used to get a pointer to data in the array which is then
349  handed off to a Fortran subroutine. It should not be used in any other
350  context!!! Remember that data is stored in Fortran array order, with
351  the component index coming last. In other words, `dataPtr' returns a
352  pointer to all the a_nth components.
353  */
354  T* dataPtr(int a_n = 0);
355 
356  /**
357  Returns a constant pointer to an object of type T that is the value of
358  the a_nth component associated with the cell at the low end of the domain.
359  This is commonly used to get a pointer to data in the array which is
360  then handed off to a Fortran subroutine. It should not be used in any
361  other context!!! Remember that data is stored in Fortran array order,
362  with the component index coming last. In other words, `dataPtr' returns
363  a pointer to all the a_nth components.
364  */
365  const T* dataPtr(int a_n = 0) const;
366 
367  ///{\bf comparison functions}
368 
369  /**
370  Returns true if the domain of a_fab is totally contained within the domain
371  of this `BaseFab'.
372  */
373  bool contains(const BaseFab<T>& a_fab) const;
374 
375  /**
376  Returns true if a_bx is totally contained within the domain of this
377  `BaseFab'.
378  */
379  bool contains(const Box& a_bx) const;
380 
381  ///{\bf data modification functions}
382 
383  /**
384  The setVal functions set subregions in the `BaseFab' to a constant value.
385  This most general form specifies the subbox, the starting component
386  number, and the number of components to be set.
387  */
388  void setVal(T a_x,
389  const Box& a_bx,
390  int a_nstart,
391  int a_numcomp);
392 
393  ///
394  /**
395  Modifies this BaseFab so that all values of a component, a_n, in the
396  specified Box, a_bx, are set to the given value, a_x.
397  */
398  void setVal(T a_x,
399  const Box& a_bx,
400  int a_n);
401 
402  ///
403  /**
404  Modifies this BaseFab so that all values of a component, a_n, are set to
405  the given value, a_x.
406  */
407  void setVal(T a_x,
408  int a_n);
409 
410  ///
411  /**
412  Modifies this BaseFab so that all values of all components are set to
413  the given value, a_x.
414  */
415  void setVal(T a_x);
416 
417  /**
418  Modifies this BaseFab by copying the contents of the argument BaseFab
419  into it. This, the most general form of copy, specifies the contents
420  of any sub-box a_srcbox in `BaseFab' a_src may be copied into a (possibly
421  different) a_destbox in the destination `BaseFab'. Note that although
422  the a_srcbox and the a_destbox may be disjoint, they must be the same size
423  and shape. If the sizes differ, the copy is undefined and a runtime
424  error results. This copy function is the only one of the copy
425  functions to allow a copy between differing boxes. The user also
426  specifies how many components are copied, starting at component
427  a_srccomp in a_src and stored starting at component a_destcomp. The
428  results are UNDEFINED if the a_src and dest BaseFabs are the same and
429  the a_srcbox and a_destbox overlap.
430 
431  */
432  BaseFab<T>& copy(const BaseFab<T>& a_src,
433  const Box& a_srcbox,
434  int a_srccomp,
435  const Box& a_destbox,
436  int a_destcomp,
437  int a_numcomp);
438 
439  /**
440  Modifies this BaseFab by copying the contents of the argument BaseFab
441  into it. A copy within the intersecting region of the domains of the
442  two BaseFabs is performed. The user specifies how many components are
443  copied, starting at component a_srccomp in a_src and stored starting at
444  component a_destcomp.
445  */
446  BaseFab<T>& copy(const BaseFab<T>& a_src,
447  int a_srccomp,
448  int a_destcomp,
449  int a_numcomp = 1);
450 
451  /**
452  Modifies this BaseFab by copying the contents of the argument BaseFab
453  into it. A copy within the intersecting region of the domains of the
454  two BaseFabs and the specified Box a_destbox is performed. All
455  components are copied.
456  */
457  BaseFab<T>& copy(const BaseFab<T>& a_src,
458  const Box& a_destbox);
459 
460  /**
461  Modifies this BaseFab by copying the contents of the argument BaseFab
462  into it. A copy within the intersecting region of the domains of the
463  two BaseFabs is performed. All components are copied.
464  */
465  BaseFab<T>& copy(const BaseFab<T>& a_src);
466 
467  ///
468  /**
469  Copy from a subsection of one box into another. Assumes the boxes are
470  both in the same index space, and that box R is completely contained
471  in both the source and destination boxes.
472  */
473  void copy(const Box& a_RegionFrom,
474  const Interval& a_Cdest,
475  const Box& a_RegionTo,
476  const BaseFab<T>& a_src,
477  const Interval& a_Csrc);
478 
479  /// {\bf domain modification functions}
480 
481  ///
482  /**
483  Modifies the domain of this BaseFab by shifting. Equivalent to
484  fab.shift(0,a_v[0]).shift(1,a_v[1])... There is no effect upon
485  the array memory.
486  */
487  BaseFab<T>& shift(const IntVect& a_v);
488 
489  ///
490  /**
491  Modifies the domain of this BaseFab by shifting it a_ncells
492  indexing positions in coordinate direction a_idir. Directions are
493  zero-based. It is an error if not 0 <= a_idir < SpaceDim. There is
494  no effect upon the array memory.
495  */
496  BaseFab<T>& shift(int a_idir,
497  int a_ncells);
498 
499  ///
500  /**
501  Modifies the domain of this BaseFab by shifting by "half" indices,
502  thereby converting the Box from type CELL to NODE or vice-versa.
503  fab.shiftHalf(0,1) shifts the domain to the right by 1/2 cells.
504  fab.shiftHalf(1,-3) shifts the domain in the -j direction by 3/2 cells.
505  NOTE: If a_numHalfs is EVEN the shift is a_numHalfs/2 full zones
506  and hence will not change the type. This is: fab.shiftHalf(1,4) ==
507  fab.shift(1,2). Directions are zero-based. It is an error if not 0
508  <= a_dir < SpaceDim. There is no effect upon the array memory.
509  */
510  BaseFab<T>& shiftHalf(int a_dir,
511  int a_numHalfs);
512 
513  ///
514  /**
515  Modifies the domain of this BaseFab by shifting by half indices.
516  Equivalent to fab.shiftHalf(0,a_v[0]).shiftHalf(1,a_v[1]) ...
517  There is no effect upon the array memory.
518  */
519  BaseFab<T>& shiftHalf(const IntVect& a_v);
520 
521  ///{\bf linearization functions}
522 
523  ///
524  /**
525  Returns the size, in number of bytes, of a flat linear
526  representation of the data in this object in the area defined
527  by the input Box a_box and the component Interval a_comps. The size
528  does not include the size of a_box and a_comps.
529  */
530  virtual size_t size(const Box& a_box,
531  const Interval& a_comps) const;
532 
533  ///
534  /**
535  Write a linear representation of the internal data. Assumes that
536  sufficient memory for the buffer has already been allocated by the
537  caller.
538  */
539  virtual void linearOut(void* a_buf,
540  const Box& a_R,
541  const Interval& a_comps) const;
542 
543  /// Same as linearOut, but returns the current location in the buffer
544  virtual void* linearOut2(void* a_buf,
545  const Box& a_R,
546  const Interval& a_comps) const;
547 
548  ///
549  virtual void linearIn(void* a_buf,
550  const Box& a_R,
551  const Interval& a_comps);
552 
553  /// same as linearIn, but returns the current location in the buffer
554  virtual void* linearIn2(void* a_buf,
555  const Box& a_R,
556  const Interval& a_comps);
557 
558  /// These functions are required for broadcast & gather.
559 
560  void linearOut(void* a_buf) const;
561  ///
562  void linearIn(const void* const a_buf);
563  ///
564  int linearSize(void) const;
565 
566  ///
567  static int preAllocatable()
568  {
569  return 0; // static preAllocatable
570  }
571 
572  /**
573  Turns a_slice into a BaseFab that's the same as *this except that it's just
574  one cell thick in the a_sliceSpec.direction-th direction, and its
575  coordinate in that direction is a_sliceSpec.position.
576 
577  If a_sliceSpec.position is outside the range of *this, that's a fatal error.
578  */
579  void degenerate(BaseFab<T>& a_slice, const SliceSpec& a_sliceSpec) const;
580 
581  ///
582  bool isAliased() const;
583 
584  /**
585  The BaseFab is defined and the number of elements is > 0
586  */
587  bool isUsable() const;
588 
589  ///regression test
590  static int test();
591 
592  ///regression test
593  static int testBoxAndComp();
594 protected:
595  //
596  // Allocates memory for the `BaseFab<T>'.
597  //
598  void define();
599 
600  //
601  // Deallocates memory for the `BaseFab<T>'.
602  //
603  void undefine();
604 
605  static std::string name();
606 
607  //
608  // The function called by BaseFab copy operations.
609  //
610  virtual void performCopy(const BaseFab<T>& a_src,
611  const Box& a_srcbox,
612  int a_srccomp,
613  const Box& a_destbox,
614  int a_destcomp,
615  int a_numcomp);
616 
617  //
618  // This function is called by the `BaseFab' setVal operations.
619  //
620  void performSetVal(T a_x,
621  const Box& a_bx,
622  int a_nstart,
623  int a_numcomp);
624 
625  //
626  // template class static data member. not sure if this will
627  // work with all compilers. It has been in the draft standard
628  // for some time
629  //
630  static Arena* s_Arena;
631 
632  Box m_domain; // My index space.
633  int m_nvar; // Number components.
634  long m_numpts; // Cached number of points in FAB.
635  long m_truesize; // m_nvar * m_numpts that was allocated on heap
636  // (only if m_aliased == false).
637  T* __restrict m_dptr; // The data pointer.
638  bool m_aliased; // The BaseFab is not allocated memory, but is an alias. bvs
639 #if CXXSTD>=14
640  shape::ShapeArray<T, SpaceDim + 1, int> m_mdarray;
641  // Reshapes m_dptr into a multidimensional array
642 #endif
643 
644 private:
645  //
646  // These functions are made private to prevent use of the default
647  // functions provided by the C++ compiler.
648  //
650  BaseFab (const BaseFab<T>&);
651 };
652 
653 #include "NamespaceFooter.H"
654 
655 #include "BaseFabImplem.H"
656 
657 #endif
void clear()
Definition: BaseFabImplem.H:252
void degenerate(BaseFab< T > &a_slice, const SliceSpec &a_sliceSpec) const
Definition: BaseFabImplem.H:829
bool contains(const BaseFab< T > &a_fab) const
{ comparison functions}
Definition: BaseFabImplem.H:389
IntVect size() const
size functions
Definition: Box.H:1819
static Arena * s_Arena
Definition: BaseFab.H:630
#define CH_assert(cond)
Definition: CHArray.H:37
virtual void linearOut(void *a_buf, const Box &a_R, const Interval &a_comps) const
Definition: BaseFabImplem.H:568
void setVal(T a_x, const Box &a_bx, int a_nstart, int a_numcomp)
{ data modification functions}
Definition: BaseFabImplem.H:399
virtual ~BaseFab()
Definition: BaseFabImplem.H:168
BaseFab< T > & shift(const IntVect &a_v)
{ domain modification functions}
Definition: BaseFabImplem.H:516
virtual void linearIn(void *a_buf, const Box &a_R, const Interval &a_comps)
Definition: BaseFabImplem.H:588
Definition: SliceSpec.H:41
bool contains(const IntVect &p) const
Definition: Box.H:1887
static std::string name()
Definition: BaseFabImplem.H:763
Box m_domain
Definition: BaseFab.H:632
const IntVect & bigEnd() const
Definition: BaseFabImplem.H:286
int m_nvar
Definition: BaseFab.H:633
const Box & box() const
Definition: BaseFabImplem.H:271
int linearSize(void) const
Definition: BaseFabImplem.H:667
BaseFab< T > & operator=(BaseFab< T > &&) noexcept
move assignment
Definition: BaseFabImplem.H:101
const int * nCompPtr() const
Definition: BaseFabImplem.H:366
BaseFab()
Definition: BaseFabImplem.H:115
void const char const int const int const int const Real const Real const int const Real const int const Real Real * C
Definition: Lapack.H:83
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:574
bool isAliased() const
Definition: BaseFabImplem.H:817
void getVal(T *a_data, const IntVect &a_pos, int a_N, int a_numcomp) const
Definition: BaseFabImplem.H:333
static int preAllocatable()
Definition: BaseFab.H:567
BaseFab< T > & shiftHalf(int a_dir, int a_numHalfs)
Definition: BaseFabImplem.H:539
Structure for passing component ranges in code.
Definition: Interval.H:23
const IntVect & smallEnd() const
{ Accessors}
Definition: Box.H:1770
virtual void define(const Box &a_box, int a_comps, T *a_alias=NULL)
Definition: BaseFab.H:205
A Virtual Base Class for Dynamic Memory Managemen.
Definition: Arena.H:40
double Real
Definition: REAL.H:33
void define()
Definition: BaseFabImplem.H:672
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:771
const int * hiVect() const
Definition: BaseFabImplem.H:361
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:426
Interval interval() const
Definition: BaseFab.H:259
virtual long offset(const IntVect &a_iv, const int &a_ivar) const
{ constructors, destructor and defines}
Definition: BaseFab.H:87
const IntVect & smallEnd() const
Definition: BaseFabImplem.H:281
Definition: BaseFab.H:81
T * dataPtr(int a_n=0)
Definition: BaseFabImplem.H:373
T *__restrict m_dptr
Definition: BaseFab.H:637
Real BaseFabRealSetVal
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
bool m_aliased
Definition: BaseFab.H:638
long m_truesize
Definition: BaseFab.H:635
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
T & operator()(const IntVect &a_p, int a_N)
Definition: BaseFabImplem.H:291
const int * loVect() const
{ Fortran interface functions}
Definition: BaseFabImplem.H:356
int nComp() const
{ accessors}
Definition: BaseFabImplem.H:264
void const char const int const int * N
Definition: Lapack.H:83
void resize(const Box &a_b, int a_n=1, T *a_alias=NULL)
Definition: BaseFabImplem.H:173
void undefine()
Definition: BaseFabImplem.H:728
static int testBoxAndComp()
regression test
Definition: BaseFabImplem.H:39
void performSetVal(T a_x, const Box &a_bx, int a_nstart, int a_numcomp)
Definition: BaseFabImplem.H:790
static int test()
regression test
Definition: BaseFabImplem.H:77
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:596
IntVect size() const
Definition: BaseFabImplem.H:276
long m_numpts
Definition: BaseFab.H:634
bool isUsable() const
Definition: BaseFabImplem.H:823