Construct an initial FAB with the data space allocated but not initialized. ncomp is the number of components (variables) at each data point in the Box.
Create an NON-OWNING BaseFab. Thus BaseFab is not responsible for memory management. And it's caller's responsibility that p points to a chunk of memory large enough.
Returns a pointer to an object of type T that is the value of the Nth component associated with the cell at the low end of the domain. This is commonly used to get a pointer to data in the array which is then handed off to a Fortran subroutine. Remember that data is stored in Fortran array order, with the component index coming last. In other words, dataPtr returns a pointer to all the Nth components.
Returns a reference to the Nth component value defined at position p in the domain. This operator may be inefficient if the C++ compiler is unable to optimize the C++ code.
getVal (int *data, const IntVect &pos, int N, int numcomp) const noexcept
This function puts numcomp component values, starting at component N, from position pos in the domain into array data, that must be allocated by the user.
setVal (int const &x, const Box &bx, int dcomp, int ncomp) noexcept
The setVal functions set sub-regions in the BaseFab to a constant value. This most general form specifies the sub-box, the starting component number, and the number of components to be set.
void
setVal (int const &x, const Box &bx, int N=0) noexcept
setComplement (int const &x, const Box &b, int ns, int num) noexcept
This function is analogous to the fourth form of setVal above, except that instead of setting values on the Box b, values are set on the complement of b in the domain.
copy (const BaseFab< int > &src, const Box &srcbox, int srccomp, const Box &destbox, int destcomp, int numcomp) noexcept
The copy functions copy the contents of one BaseFab into another. The destination BaseFab is always the object which invokes the function. This, the most general form of copy, specifies the contents of any sub-box srcbox in BaseFab src may be copied into a (possibly different) destbox in the destination BaseFab. Note that although the srcbox and the destbox may be disjoint, they must be the same size and shape. If the sizes differ, the copy is undefined and a runtime error results. This copy function is the only one of the copy functions to allow a copy between differing boxes. The user also specifies how many components are copied, starting at component srccomp in src and stored starting at component destcomp. The results are UNDEFINED if the src and dest are the same and the srcbox and destbox overlap.
copy (const BaseFab< int > &src, int srccomp, int destcomp, int numcomp=1) noexcept
As above, except the destination Box and the source Box are taken to be the entire domain of the destination. A copy of the intersecting region is performed. class.
copy (const BaseFab< int > &src, const Box &destbox) noexcept
As above, except that the destination Box is specified, but the source Box is taken to the equal to the destination Box, and all components of the destination BaseFab are copied.
Perform shifts upon the domain of the BaseFab. They are completely analogous to the corresponding Box functions. There is no effect upon the array memory.
Perform shifts upon the domain of the BaseFab. They are completely analogous to the corresponding Box functions. There is no effect upon the array memory.
Perform shifts upon the domain of the BaseFab. They are completely analogous to the corresponding Box functions. There is no effect upon the array memory.
Perform shifts upon the domain of the BaseFab. They are completely analogous to the corresponding Box functions. There is no effect upon the array memory.
maxIndex (const Box &subbox, int comp=0) const noexcept
void
maxIndex (const Box &subbox, Real &max_value, IntVect &max_idx, int comp=0) const noexcept
Compute maximum value and location to allow efficient looping over multiple boxes.
int
maskLT (BaseFab< int > &mask, int const &val, int comp=0) const noexcept
Compute mask array with value of 1 in cells where BaseFab has value less than val, 0 otherwise. mask is resized by this function. The number of cells marked with 1 returned.
int
maskLE (BaseFab< int > &mask, int const &val, int comp=0) const noexcept
Mark cells with value val.
int
maskEQ (BaseFab< int > &mask, int const &val, int comp=0) const noexcept
Mark cells with value equal to val.
int
maskGT (BaseFab< int > &mask, int const &val, int comp=0) const noexcept
Mark cells with value greater than val.
int
maskGE (BaseFab< int > &mask, int const &val, int comp=0) const noexcept
Mark cells with value greater than or equal to val.
lockAdd (const BaseFab< int > &src, const Box &srcbox, const Box &destbox, int srccomp, int destcomp, int numcomp) noexcept
Atomically add srcbox region of src FAB to destbox region of this FAB. The srcbox and destbox must be same size. When OMP is on, this uses OMP locks in the implementation and it's usually faster than atomicAdd.
divide (const BaseFab< int > &src, int srccomp, int destcomp, int numcomp=1) noexcept
This FAB is numerator, src FAB is denominator divide src components (srccomp:srccomp+numcomp-1) into this FABs components (destcomp:destcomp+numcomp-1) where the two FABs intersect.
protected_divide (const BaseFab< int > &src, int srccomp, int destcomp, int numcomp=1) noexcept
Divide wherever "src" is "true" or "non-zero". This FAB is numerator, src FAB is denominator divide src components (srccomp:srccomp+numcomp-1) into this FABs components (destcomp:destcomp+numcomp-1) where the two FABs intersect.
protected_divide (const BaseFab< int > &src, const Box &subbox, int srccomp, int destcomp, int numcomp=1) noexcept
Divide wherever "src" is "true" or "non-zero". Same as above except division is restricted to intersection of subbox and src FAB. NOTE: subbox must be contained in this FAB.
linInterp (const BaseFab< int > &f1, const Box &b1, int comp1, const BaseFab< int > &f2, const Box &b2, int comp2, Real t1, Real t2, Real t, const Box &b, int comp, int numcomp=1) noexcept
Linear interpolation / extrapolation. Result is (t2-t)/(t2-t1)*f1 + (t-t1)/(t2-t1)*f2 Data is taken from b1 region of f1, b2 region of f2 and stored in b region of this FAB. Boxes b, b1 and b2 must be the same size. Data is taken from component comp1 of f1, comp2 of f2, and stored in component comp of this FAB. This FAB is returned as a reference for chaining.
linInterp (const BaseFab< int > &f1, int comp1, const BaseFab< int > &f2, int comp2, Real t1, Real t2, Real t, const Box &b, int comp, int numcomp=1) noexcept
Version of linInterp() in which b, b1, & b2 are the same.
linComb (const BaseFab< int > &f1, const Box &b1, int comp1, const BaseFab< int > &f2, const Box &b2, int comp2, Real alpha, Real beta, const Box &b, int comp, int numcomp=1) noexcept
Linear combination. Result is alpha*f1 + beta*f2. Data is taken from b1 region of f1, b2 region of f2 and stored in b region of this FAB. Boxes b, b1 and b2 must be the same size. Data is taken from component comp1 of f1, comp2 of f2, and stored in component comp of this FAB. This FAB is returned as a reference for chaining.
int
dot (const Box &xbx, int xcomp, const BaseFab< int > &y, const Box &ybx, int ycomp, int numcomp=1) const noexcept
iFortran Array Box's (generally called iFAB's) are objects constructed to emulate the FORTRAN array. Useful operations can be performed upon FAB's in C++, and they provide a convenient interface to FORTRAN when it is necessary to retreat into that language.
IArrayBox is derived from BaseFab<int>. IArrayBox adds additional useful capabilities which make sense for int types, such as L**p norms.
The C pre-processor macro AMREX_SPACEDIM must be defined to use this class. The internal precision of FARRAYBOX objects is set by defining either BL_USE_FLOAT or BL_USE_DOUBLE
This is NOT a polymorphic class.
This class does NOT provide a copy constructor or assignment operator.
Construct an initial FAB with the data space allocated but not initialized. ncomp is the number of components (variables) at each data point in the Box.