Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

FArrayBox Class Reference

#include <FArrayBox.H>

Inheritance diagram for FArrayBox:

Inheritance graph
[legend]
Collaboration diagram for FArrayBox:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FArrayBox ()
 FArrayBox (const Box &b, int ncomp, Real *alias=NULL)
void define (const Box &b, int ncomp, Real *alias=NULL)
 FArrayBox (const Interval &a_comps, FArrayBox &a_original)
void define (const Interval &a_comps, FArrayBox &a_original)
 FArrayBox (std::istream &is)
virtual ~FArrayBox ()
virtual Real norm (int p=2, int comp=0, int numcomp=1) const
virtual Real norm (const Box &subbox, int p=2, int comp=0, int numcomp=1) const
virtual Real sumPow (const Box &subbox, int p=2, int comp=0, int numcomp=1) const
Real dotProduct (const FArrayBox &fab2) const
 Return the dot product of this FArrayBox with another.

Real min (int comp=0) const
Real min (const Box &subbox, int comp=0) const
Real max (int comp=0) const
Real max (const Box &subbox, int comp=0) const
IntVect minIndex (int comp=0) const
IntVect minIndex (const Box &subbox, int comp=0) const
IntVect maxIndex (int comp=0) const
IntVect maxIndex (const Box &subbox, int comp=0) const
int maskLT (BaseFab< int > &mask, Real val, int comp=0) const
int maskLE (BaseFab< int > &mask, Real val, int comp=0) const
int maskEQ (BaseFab< int > &mask, Real val, int comp=0) const
int maskGT (BaseFab< int > &mask, Real val, int comp=0) const
int maskGE (BaseFab< int > &mask, Real val, int comp=0) const
void abs ()
void abs (int comp, int numcomp=1)
void abs (const Box &subbox, int comp=0, int numcomp=1)
Real sum (int comp, int numcomp=1) const
Real sum (const Box &subbox, int comp, int numcomp=1) const
FArrayBoxinvert (Real v)
FArrayBoxinvert (Real v, const Box &subbox, int comp=0, int numcomp=1)
FArrayBoxinvert (Real v, int comp, int numcomp=1)
FArrayBoxnegate (const Box &subbox, int comp=0, int numcomp=1)
FArrayBoxnegate (int comp, int numcomp=1)
FArrayBoxnegate ()
FArrayBoxplus (Real r, const Box &b, int comp=0, int numcomp=1)
FArrayBoxplus (Real r, int comp, int numcomp=1)
FArrayBoxoperator+= (Real r)
FArrayBoxoperator+= (const FArrayBox &f)
FArrayBoxplus (const FArrayBox &src)
FArrayBoxplus (Real r)
FArrayBoxplus_real (Real r)
FArrayBoxplus (const FArrayBox &src, const Real &scale)
FArrayBoxplus (const FArrayBox &src, const Real &scale, int srccomp, int destcomp, int numcomp=1)
FArrayBoxplus (const FArrayBox &src, int srccomp, int destcomp, int numcomp=1)
FArrayBoxplus (const FArrayBox &src, const Box &subbox, int srccomp, int destcomp, int numcomp=1)
FArrayBoxplus (const FArrayBox &src, const Box &srcbox, const Box &destbox, int srccomp, int destcomp, int numcomp=1)
FArrayBoxplus (const FArrayBox &src, const Box &srcbox, const Box &destbox, const Real &scale, int srccomp, int destcomp, int numcomp=1)
FArrayBoxoperator-= (Real r)
FArrayBoxoperator-= (const FArrayBox &f)
FArrayBoxminus (const FArrayBox &src)
FArrayBoxminus (const FArrayBox &src, int srccomp, int destcomp, int numcomp=1)
FArrayBoxminus (const FArrayBox &src, const Box &subbox, int srccomp, int destcomp, int numcomp=1)
FArrayBoxminus (const FArrayBox &src, const Box &srcbox, const Box &destbox, int srccomp, int destcomp, int numcomp=1)
FArrayBoxoperator *= (Real r)
FArrayBoxmult (Real r)
FArrayBoxmult (Real r, int comp, int numcomp=1)
FArrayBoxmult (Real r, const Box &b, int comp=0, int numcomp=1)
FArrayBoxoperator *= (const FArrayBox &f)
FArrayBoxmult (const FArrayBox &src)
FArrayBoxmult (const FArrayBox &src, int srccomp, int destcomp, int numcomp=1)
FArrayBoxmult (const FArrayBox &src, const Box &subbox, int srccomp, int destcomp, int numcomp=1)
FArrayBoxmult (const FArrayBox &src, const Box &srcbox, const Box &destbox, int srccomp, int destcomp, int numcomp=1)
FArrayBoxoperator/= (Real r)
FArrayBoxdivide (Real r)
FArrayBoxdivide (Real r, int comp, int numcomp=1)
FArrayBoxdivide (Real r, const Box &b, int comp=0, int numcomp=1)
FArrayBoxoperator/= (const FArrayBox &src)
FArrayBoxdivide (const FArrayBox &src)
FArrayBoxdivide (const FArrayBox &src, int srccomp, int destcomp, int numcomp=1)
FArrayBoxdivide (const FArrayBox &src, const Box &subbox, int srccomp, int destcomp, int numcomp=1)
FArrayBoxdivide (const FArrayBox &src, const Box &srcbox, const Box &destbox, int srccomp, int destcomp, int numcomp=1)
Real get (const IntVect &iv, int comp) const
void set (const IntVect &iv, int comp, Real val)

Protected Member Functions

virtual void performCopy (const BaseFab< Real > &src, const Box &srcbox, int srccomp, const Box &destbox, int destcomp, int numcomp)

Detailed Description

Fortran Array Boxes (generally called FABs) are objects constructed to interface with arrays in Fortran. Useful operations can be performed upon FABs in C++, and they provide a convenient interface to Fortran when it is necessary to retreat into that language for doing arithmetic operations when performance matters.

FArrayBox is derived from BaseFab<Real>. FArrayBox adds additional useful capabilities which make sense for Real types, such as I/O and L**p norms.

The C pre-processor macro `CH' must be defined to use this class. The internal precision of FArrayBox objects is set by defining either `CH' or `CH'

This class does NOT provide a copy constructor or assignment operator.


Constructor & Destructor Documentation

FArrayBox::FArrayBox  ) 
 

Constructs an invalid FArrayBox with no memory.

FArrayBox::FArrayBox const Box b,
int  ncomp,
Real alias = NULL
 

: Constructs an initial FArrayBox with the data space allocated but not inititialized. ncomp is the number of components (variables) at each data point in the Box.

FArrayBox::FArrayBox const Interval a_comps,
FArrayBox a_original
[inline]
 

Construct an aliaed FArrayBox. See BaseFab class for details.

FArrayBox::FArrayBox std::istream &  is  )  [explicit]
 

Constructs FArrayBox by reading it from istream.

virtual FArrayBox::~FArrayBox  )  [virtual]
 

The (virtual) destructor.


Member Function Documentation

void FArrayBox::abs const Box subbox,
int  comp = 0,
int  numcomp = 1
 

Modifies this FArrayBox by replacing eahc value with its absolute value, for components (comp: comp+numcomp-1) and within the subbox.

void FArrayBox::abs int  comp,
int  numcomp = 1
 

Modifies this FArrayBox by replacing eahc value with its absolute value, for components (comp: comp+numcomp-1).

void FArrayBox::abs  ) 
 

Modifies this FArrayBox by replacing each value with its absolute value.

void FArrayBox::define const Interval a_comps,
FArrayBox a_original
[inline]
 

void FArrayBox::define const Box b,
int  ncomp,
Real alias = NULL
[inline, virtual]
 

: Make BaseFab with desired domain and number of components. existing data is lost. Data is in uninialized state.

Reimplemented from BaseFab< Real >.

FArrayBox& FArrayBox::divide const FArrayBox src,
const Box srcbox,
const Box destbox,
int  srccomp,
int  destcomp,
int  numcomp = 1
 

: Modifies this FArrayBox by pointwise division by values in the argument FArrayBox. Divides this FArrayBox's components (destcomp:destcomp+numcomp-1) in the Box destbox by src's components (srccomp:srccomp+numcomp-1) in the Box srcbox. Corresponding locations within the two FArrayBoxes are indexed relative to srcbox and destbox, and will in general not be the same. The srcbox and destbox must be same size. The results are UNDEFINED if the src and dest FArrayBoxes are the same and the srcbox and destbox overlap.

FArrayBox& FArrayBox::divide const FArrayBox src,
const Box subbox,
int  srccomp,
int  destcomp,
int  numcomp = 1
 

: Modifies this FArrayBox by pointwise division by values in the argument FArrayBox. Divides this FArrayBox's components (destcomp:destcomp+numcomp-1) by src's components (srccomp:srccomp+numcomp-1) where the domain of this FArrayBox intersects the subbox. NOTE: subbox must be contained in this FAB.

FArrayBox& FArrayBox::divide const FArrayBox src,
int  srccomp,
int  destcomp,
int  numcomp = 1
 

: Modifies this FArrayBox by pointwise division by values in the argument FArrayBox. Divides this FArrayBox's components (destcomp:destcomp+numcomp-1) by src's components (srccomp:srccomp+numcomp-1) where the domains of the two FArrayBoxes intersect.

FArrayBox& FArrayBox::divide const FArrayBox src  ) 
 

Modifies this FArrayBox by pointwise division by the values in the argument FArrayBox. You might come to grief if the domains of the FArrayBoxes don't match. The same as the /= operator.

FArrayBox& FArrayBox::divide Real  r,
const Box b,
int  comp = 0,
int  numcomp = 1
 

Modifies this FArrayBox by dividing all values by the scalar Real r. For given range of components and within given subbox.

FArrayBox& FArrayBox::divide Real  r,
int  comp,
int  numcomp = 1
 

Modifies this FArrayBox by dividing all values by the scalar Real r. For given range of components.

FArrayBox& FArrayBox::divide Real  r  ) 
 

Modifies this FArrayBox by dividing all values by the scalar Real r.

Real FArrayBox::dotProduct const FArrayBox fab2  )  const
 

Return the dot product of this FArrayBox with another.

Return the dot product of this FArrayBox and "fab2" over their common box and all components.

Real FArrayBox::get const IntVect iv,
int  comp
const [inline]
 

FArrayBox& FArrayBox::invert Real  v,
int  comp,
int  numcomp = 1
 

Modifies this FArrayBox by replacing each value x with v/x. For given range of components.

FArrayBox& FArrayBox::invert Real  v,
const Box subbox,
int  comp = 0,
int  numcomp = 1
 

Modifies this FArrayBox by replacing each value x with v/x. For given range of components and within given subbox.

FArrayBox& FArrayBox::invert Real  v  ) 
 

Modifies this FArrayBox by replacing each value x with v/x.

int FArrayBox::maskEQ BaseFab< int > &  mask,
Real  val,
int  comp = 0
const
 

Computes mask array with value of 1 in cells where this FArrayBox has value equal to val, 0 otherwise. mask is resized by this function. The number of cells marked with 1 returned.

int FArrayBox::maskGE BaseFab< int > &  mask,
Real  val,
int  comp = 0
const
 

Computes mask array with value of 1 in cells where this FArrayBox has value greater than or equal to val, 0 otherwise. mask is resized by this function. The number of cells marked with 1 returned.

int FArrayBox::maskGT BaseFab< int > &  mask,
Real  val,
int  comp = 0
const
 

Computes mask array with value of 1 in cells where this FArrayBox has value greater than val, 0 otherwise. mask is resized by this function. The number of cells marked with 1 returned.

int FArrayBox::maskLE BaseFab< int > &  mask,
Real  val,
int  comp = 0
const
 

Computes mask array with value of 1 in cells where this FArrayBox has value less than or equal to val, 0 otherwise. mask is resized by this function. The number of cells marked with 1 returned.

int FArrayBox::maskLT BaseFab< int > &  mask,
Real  val,
int  comp = 0
const
 

Computes mask array with value of 1 in cells where this FArrayBox has value less than val, 0 otherwise. mask is resized by this function. The number of cells marked with 1 returned.

Real FArrayBox::max const Box subbox,
int  comp = 0
const
 

Returns the maximum value of given component of this FArrayBox in given subbox.

Real FArrayBox::max int  comp = 0  )  const
 

Returns the maximum value of given component of this FArrayBox.

IntVect FArrayBox::maxIndex const Box subbox,
int  comp = 0
const
 

: Returns location of maximum value in given component of this FArrayBox in given subbox.

IntVect FArrayBox::maxIndex int  comp = 0  )  const
 

Returns location of maximum value in given component of this FArrayBox.

Real FArrayBox::min const Box subbox,
int  comp = 0
const
 

Returns the minimum value of given component of this FArrayBox in given subbox.

Real FArrayBox::min int  comp = 0  )  const
 

Returns the minimum value of given component of this FArrayBox.

IntVect FArrayBox::minIndex const Box subbox,
int  comp = 0
const
 

: Returns location of minimum value in given component of this FArrayBox in given subbox.

IntVect FArrayBox::minIndex int  comp = 0  )  const
 

Finds location of minimum value in given component of this FArrayBox.

FArrayBox& FArrayBox::minus const FArrayBox src,
const Box srcbox,
const Box destbox,
int  srccomp,
int  destcomp,
int  numcomp = 1
 

: Modifies this FArrayBox by pointwise subtraction of values in the argument FArrayBox. Subtracts src's components (srccomp:srccomp+numcomp-1) in the Box srcbox from this FArrayBox's components (destcomp:destcomp+numcomp-1) in the Box destbox. Corresponding locations within the two FArrayBoxes are indexed relative to srcbox and destbox, and will in general not be the same. The srcbox and destbox must be same size. The results are UNDEFINED if the src and dest FArrayBoxes are the same and the srcbox and destbox overlap.

FArrayBox& FArrayBox::minus const FArrayBox src,
const Box subbox,
int  srccomp,
int  destcomp,
int  numcomp = 1
 

: Modifies this FArrayBox by pointwise subtraction of values in the argument FArrayBox. Subtracts src's components (srccomp:srccomp+numcomp-1) from this FArrayBox's components (destcomp:destcomp+numcomp-1) where the domain of this FArrayBox intersects the subbox. NOTE: subbox must be contained in this FAB.

FArrayBox& FArrayBox::minus const FArrayBox src,
int  srccomp,
int  destcomp,
int  numcomp = 1
 

: Modifies this FArrayBox by pointwise subtraction of values in the argument FArrayBox. Subtracts src's components (srccomp:srccomp+numcomp-1) from this FArrayBox's components (destcomp:destcomp+numcomp-1) where the domains of the two FArrayBoxes intersect.

FArrayBox& FArrayBox::minus const FArrayBox src  ) 
 

Modifies this FArrayBox by pointwise subtraction of the values of the argument FArrayBox. You might come to grief if the domains of the FArrayBoxes don't match. The same as -= operator.

FArrayBox& FArrayBox::mult const FArrayBox src,
const Box srcbox,
const Box destbox,
int  srccomp,
int  destcomp,
int  numcomp = 1
 

: Modifies this FArrayBox by pointwise multiplication by values in the argument FArrayBox. Multiplies src's components (srccomp:srccomp+numcomp-1) in the Box srcbox by this FArrayBox's components (destcomp:destcomp+numcomp-1) in the Box destbox. Corresponding locations within the two FArrayBoxes are indexed relative to srcbox and destbox, and will in general not be the same. The srcbox and destbox must be same size. The results are UNDEFINED if the src and dest FArrayBoxes are the same and the srcbox and destbox overlap.

FArrayBox& FArrayBox::mult const FArrayBox src,
const Box subbox,
int  srccomp,
int  destcomp,
int  numcomp = 1
 

: Modifies this FArrayBox by pointwise multiplication by values in the argument FArrayBox. Multiplies src's components (srccomp:srccomp+numcomp-1) by this FArrayBox's components (destcomp:destcomp+numcomp-1) where the domain of this FArrayBox intersects the subbox. NOTE: subbox must be contained in this FAB.

FArrayBox& FArrayBox::mult const FArrayBox src,
int  srccomp,
int  destcomp,
int  numcomp = 1
 

: Modifies this FArrayBox by pointwise multiplication by values in the argument FArrayBox. Multiplies src's components (srccomp:srccomp+numcomp-1) by this FArrayBox's components (destcomp:destcomp+numcomp-1) where the domains of the two FArrayBoxes intersect.

FArrayBox& FArrayBox::mult const FArrayBox src  ) 
 

Modifies this FArrayBox by pointwise multiplication by the values in the argument FArrayBox. You might come to grief if the domains of the FArrayBoxes don't match. The same as the *= operator.

FArrayBox& FArrayBox::mult Real  r,
const Box b,
int  comp = 0,
int  numcomp = 1
 

Modifies this FArrayBox by multiplying all values by the scalar Real r. For given range of components and within given subbox.

FArrayBox& FArrayBox::mult Real  r,
int  comp,
int  numcomp = 1
 

Modifies this FArrayBox by multiplying all values by the scalar Real r. For given range of components.

FArrayBox& FArrayBox::mult Real  r  ) 
 

Modifies this FArrayBox by multiplying all values by the scalar Real r.

FArrayBox& FArrayBox::negate  ) 
 

Modifies this FArrayBox by replacing each value with its additive inverse.

FArrayBox& FArrayBox::negate int  comp,
int  numcomp = 1
 

Modifies this FArrayBox by replacing each value with its additive inverse. For given range of components.

FArrayBox& FArrayBox::negate const Box subbox,
int  comp = 0,
int  numcomp = 1
 

Modifies this FArrayBox by replacing each value with its additive inverse. For given range of components and within given subbox.

virtual Real FArrayBox::norm const Box subbox,
int  p = 2,
int  comp = 0,
int  numcomp = 1
const [virtual]
 

: Returns the Lp-norm of this FAB using components (comp : comp+numcomp-1) and within the subbox. p < 0 -> ERROR. p = 0 -> infinity norm (max norm). p = 1 -> sum of ABS(FAB) p > 1 -> Lp-norm

virtual Real FArrayBox::norm int  p = 2,
int  comp = 0,
int  numcomp = 1
const [virtual]
 

: Returns the Lp-norm of this FAB using components (comp : comp+numcomp-1). p < 0 -> ERROR. p = 0 -> infinity norm (max norm). p = 1 -> sum of ABS(FAB) p > 1 -> Lp-norm

FArrayBox& FArrayBox::operator *= const FArrayBox f  ) 
 

Modifies this FArrayBox by pointwise multiplication of the values by the argument FArrayBox. You might come to grief if the domains of the FArrayBoxes don't match.

FArrayBox& FArrayBox::operator *= Real  r  ) 
 

Modifies this FArrayBox by multiplying all values by the scalar Real r.

FArrayBox& FArrayBox::operator+= const FArrayBox f  ) 
 

Modifies this FArrayBox by pointwise addition of the values of the argument FArrayBox. You might come to grief if the domains of the FArrayBoxes don't match.

FArrayBox& FArrayBox::operator+= Real  r  ) 
 

Modifies this FArrayBox by adding the scalar Real r to all values.

FArrayBox& FArrayBox::operator-= const FArrayBox f  ) 
 

Modifies this FArrayBox by pointwise subtraction of the values of the argument FArrayBox. You might come to grief if the domains of the FArrayBoxes don't match.

FArrayBox& FArrayBox::operator-= Real  r  ) 
 

Modifies this FArrayBox by subtracting the scalar Real r to all values. Note: use plus(-r) for more general operations.

FArrayBox& FArrayBox::operator/= const FArrayBox src  ) 
 

Modifies this FArrayBox by pointwise division of the values by the argument FArrayBox. You might come to grief if the domains of the FArrayBoxes don't match.

FArrayBox& FArrayBox::operator/= Real  r  ) 
 

Modifies this FArrayBox by dividing all values by the scalar Real r.

virtual void FArrayBox::performCopy const BaseFab< Real > &  src,
const Box srcbox,
int  srccomp,
const Box destbox,
int  destcomp,
int  numcomp
[protected, virtual]
 

Reimplemented from BaseFab< Real >.

FArrayBox& FArrayBox::plus const FArrayBox src,
const Box srcbox,
const Box destbox,
const Real scale,
int  srccomp,
int  destcomp,
int  numcomp = 1
 

FArrayBox& FArrayBox::plus const FArrayBox src,
const Box srcbox,
const Box destbox,
int  srccomp,
int  destcomp,
int  numcomp = 1
 

: Modifies this FArrayBox by pointwise addition of values in the argument FArrayBox. Adds src's components (srccomp:srccomp+numcomp-1) in the Box srcbox to this FArrayBox's components (destcomp:destcomp+numcomp-1) in the Box destbox. Corresponding locations within the two FArrayBoxes are indexed relative to srcbox and destbox, and will in general not be the same. The srcbox and destbox must be same size. The results are UNDEFINED if the src and dest FArrayBoxes are the same and the srcbox and destbox overlap.

FArrayBox& FArrayBox::plus const FArrayBox src,
const Box subbox,
int  srccomp,
int  destcomp,
int  numcomp = 1
 

: Modifies this FArrayBox by pointwise addition of values in the argument FArrayBox. Adds src's components (srccomp:srccomp+numcomp-1) to this FArrayBox's components (destcomp:destcomp+numcomp-1) where the domain of this FArrayBox intersects the subbox. NOTE: subbox must be contained in this FAB.

FArrayBox& FArrayBox::plus const FArrayBox src,
int  srccomp,
int  destcomp,
int  numcomp = 1
 

: Modifies this FArrayBox by pointwise addition of values in the argument FArrayBox. Adds src's components (srccomp:srccomp+numcomp-1) to this FArrayBox's components (destcomp:destcomp+numcomp-1) where the domains of the two FArrayBoxes intersect.

FArrayBox& FArrayBox::plus const FArrayBox src,
const Real scale,
int  srccomp,
int  destcomp,
int  numcomp = 1
 

Modifies this FArrayBox by pointwise scaled addition of the argument FArrayBox (a[i] <- a[i] + scale * src[i]). Uses domain of the intersection of these two FArrayBoxes.

FArrayBox& FArrayBox::plus const FArrayBox src,
const Real scale
 

Modifies this FArrayBox by pointwise scaled addition of the argument FArrayBox (a[i] <- a[i] + scale * src[i]). Uses domain of the intersection of these two FArrayBoxes.

FArrayBox& FArrayBox::plus Real  r  ) 
 

Modifies this FArrayBox by adding the scalar Real r to all values.

FArrayBox& FArrayBox::plus const FArrayBox src  ) 
 

Modifies this FArrayBox by pointwise addition of the values of the argument FArrayBox. You might come to grief if the domains of the FArrayBoxes don't match. The same as += operator.

FArrayBox& FArrayBox::plus Real  r,
int  comp,
int  numcomp = 1
 

Modifies this FArrayBox by adding the scalar Real r to all values. For given range of components.

FArrayBox& FArrayBox::plus Real  r,
const Box b,
int  comp = 0,
int  numcomp = 1
 

Modifies this FArrayBox by adding the scalar Real r to all values. For given range of components and within given subbox.

FArrayBox& FArrayBox::plus_real Real  r  )  [inline]
 

void FArrayBox::set const IntVect iv,
int  comp,
Real  val
[inline]
 

Real FArrayBox::sum const Box subbox,
int  comp,
int  numcomp = 1
const
 

: Returns sum of component of this FArrayBox in given subbox.

Real FArrayBox::sum int  comp,
int  numcomp = 1
const
 

Returns sum of given component of FArrayBox.

virtual Real FArrayBox::sumPow const Box subbox,
int  p = 2,
int  comp = 0,
int  numcomp = 1
const [virtual]
 

Returns sum of pow(fab[i,c],p): i in subbox, comp<=c<comp+numcomp p>=2 only


The documentation for this class was generated from the following file:
Generated on Wed Jun 2 13:58:35 2004 for Chombo&INSwithParticles by doxygen 1.3.2