Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

SAMRAI::math::ArrayDataMiscellaneousOpsReal< DIM, TYPE > Class Template Reference

#include <source/mathops/array/ArrayDataMiscellaneousOpsReal.h>

Inheritance diagram for SAMRAI::math::ArrayDataMiscellaneousOpsReal< DIM, TYPE >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 ArrayDataMiscellaneousOpsReal ()
 ~ArrayDataMiscellaneousOpsReal ()
int computeConstrProdPosWithControlVolume (const pdat::ArrayData< DIM, TYPE > &data1, const pdat::ArrayData< DIM, TYPE > &data2, const pdat::ArrayData< DIM, double > &cvol, const hier::Box< DIM > &box) const
int computeConstrProdPos (const pdat::ArrayData< DIM, TYPE > &data1, const pdat::ArrayData< DIM, TYPE > &data2, const hier::Box< DIM > &box) const
void compareToScalarWithControlVolume (pdat::ArrayData< DIM, TYPE > &dst, const pdat::ArrayData< DIM, TYPE > &src, const TYPE &alpha, const pdat::ArrayData< DIM, double > &cvol, const hier::Box< DIM > &box) const
void compareToScalar (pdat::ArrayData< DIM, TYPE > &dst, const pdat::ArrayData< DIM, TYPE > &src, const TYPE &alpha, const hier::Box< DIM > &box) const
int testReciprocalWithControlVolume (pdat::ArrayData< DIM, TYPE > &dst, const pdat::ArrayData< DIM, TYPE > &src, const pdat::ArrayData< DIM, double > &cvol, const hier::Box< DIM > &box) const
int testReciprocal (pdat::ArrayData< DIM, TYPE > &dst, const pdat::ArrayData< DIM, TYPE > &src, const hier::Box< DIM > &box) const
TYPE maxPointwiseDivide (const pdat::ArrayData< DIM, TYPE > &numer, const pdat::ArrayData< DIM, TYPE > &denom, const hier::Box< DIM > &box) const
 Compute max of "conditional" quotients of two arrays.
TYPE minPointwiseDivide (const pdat::ArrayData< DIM, TYPE > &numer, const pdat::ArrayData< DIM, TYPE > &denom, const hier::Box< DIM > &box) const
 Compute min of quotients of two arrays.

Detailed Description

template<int DIM, class TYPE>
class SAMRAI::math::ArrayDataMiscellaneousOpsReal< DIM, TYPE >

Class ArrayDataMiscellaneousOpsReal<DIM> provides various operations that may be applied to arrays of real (double and float) numerical data values maintained using pdat::ArrayData<DIM> objects. These operations are sufficiently different from basic arithmetic and norm operations that we chose to implement them in a separate class. However, as in the case of the * more common operations, the intent of this class is to provide a single implementation of the operations as they are needed by objects that manipulate standard array-based patch data types (i.e., cell-centered, face-centered, node-centered). Each operation is implemented in two different ways. The choice of operation is based on whether control volume information is to be used to weight the contribution of each data entry to the calculation. The use of control volumes is important when these operations are used in vector kernels where the data resides over multiple levels of spatial resolution in an AMR hierarchy. The actual index region on which each operation occurs is the intersection of this box and the boxes of all the pdat::ArrayData<DIM> objects involved.

Since these operations are used only by the vector kernels for the KINSOL and PVODE solver packages at this time, they are intended to be instantiated for the standard built-in types double and float (since those solvers only treat double and float data). To extend this class to other data types or to include other operations, the member functions must be specialized or the * new operations must be added.

See also:
pdat::ArrayData


Constructor & Destructor Documentation

template<int DIM, class TYPE>
SAMRAI::math::ArrayDataMiscellaneousOpsReal< DIM, TYPE >::ArrayDataMiscellaneousOpsReal  ) 
 

Empty constructor and destructor.

template<int DIM, class TYPE>
SAMRAI::math::ArrayDataMiscellaneousOpsReal< DIM, TYPE >::~ArrayDataMiscellaneousOpsReal  ) 
 


Member Function Documentation

template<int DIM, class TYPE>
int SAMRAI::math::ArrayDataMiscellaneousOpsReal< DIM, TYPE >::computeConstrProdPosWithControlVolume const pdat::ArrayData< DIM, TYPE > &  data1,
const pdat::ArrayData< DIM, TYPE > &  data2,
const pdat::ArrayData< DIM, double > &  cvol,
const hier::Box< DIM > &  box
const
 

Return 1 if $\|data2_i\| > 0$ and $data1_i * data2_i \leq 0$ , for any $i$ in the index region, where $cvol_i > 0$ . Otherwise return 0.

template<int DIM, class TYPE>
int SAMRAI::math::ArrayDataMiscellaneousOpsReal< DIM, TYPE >::computeConstrProdPos const pdat::ArrayData< DIM, TYPE > &  data1,
const pdat::ArrayData< DIM, TYPE > &  data2,
const hier::Box< DIM > &  box
const
 

Return 1 if $\|data2_i\| > 0$ and $data1_i * data2_i \leq 0$ , for any $i$ in the index region. Otherwise return 0.

template<int DIM, class TYPE>
void SAMRAI::math::ArrayDataMiscellaneousOpsReal< DIM, TYPE >::compareToScalarWithControlVolume pdat::ArrayData< DIM, TYPE > &  dst,
const pdat::ArrayData< DIM, TYPE > &  src,
const TYPE &  alpha,
const pdat::ArrayData< DIM, double > &  cvol,
const hier::Box< DIM > &  box
const
 

Wherever $cvol_i > 0$ in the index region, set $dst_i = 1$ if $\|src_i\| > \alpha$ , and $dst_i = 0$ otherwise.

template<int DIM, class TYPE>
void SAMRAI::math::ArrayDataMiscellaneousOpsReal< DIM, TYPE >::compareToScalar pdat::ArrayData< DIM, TYPE > &  dst,
const pdat::ArrayData< DIM, TYPE > &  src,
const TYPE &  alpha,
const hier::Box< DIM > &  box
const
 

Set $dst_i = 1$ if $\|src_i\| > \alpha$ , and $dst_i = 0$ otherwise.

template<int DIM, class TYPE>
int SAMRAI::math::ArrayDataMiscellaneousOpsReal< DIM, TYPE >::testReciprocalWithControlVolume pdat::ArrayData< DIM, TYPE > &  dst,
const pdat::ArrayData< DIM, TYPE > &  src,
const pdat::ArrayData< DIM, double > &  cvol,
const hier::Box< DIM > &  box
const
 

Wherever $cvol_i > 0$ in the index region, set $dst_i = 1/src_i$ if $src_i \neq 0$ , and $dst_i = 0$ otherwise. If $dst_i = 0$ anywhere, 0 is the return value. Otherwise 1 is returned.

template<int DIM, class TYPE>
int SAMRAI::math::ArrayDataMiscellaneousOpsReal< DIM, TYPE >::testReciprocal pdat::ArrayData< DIM, TYPE > &  dst,
const pdat::ArrayData< DIM, TYPE > &  src,
const hier::Box< DIM > &  box
const
 

Set $dst_i = 1/src_i$ if $src_i \neq 0$ , and $dst_i = 0$ otherwise. If $dst_i = 0$ anywhere, 0 is the return value. Otherwise 1 is returned.

template<int DIM, class TYPE>
TYPE SAMRAI::math::ArrayDataMiscellaneousOpsReal< DIM, TYPE >::maxPointwiseDivide const pdat::ArrayData< DIM, TYPE > &  numer,
const pdat::ArrayData< DIM, TYPE > &  denom,
const hier::Box< DIM > &  box
const
 

Compute max of "conditional" quotients of two arrays.

Return the maximum of pointwise "conditional" quotients of the numerator and denominator.

The "conditional" quotient is defined as |numerator/denominator| where the denominator is nonzero. Otherwise, it is defined as |numerator|.

Note: This method is currently intended to support the PETSc-2.1.6 vector wrapper only. Please do not use it!

template<int DIM, class TYPE>
TYPE SAMRAI::math::ArrayDataMiscellaneousOpsReal< DIM, TYPE >::minPointwiseDivide const pdat::ArrayData< DIM, TYPE > &  numer,
const pdat::ArrayData< DIM, TYPE > &  denom,
const hier::Box< DIM > &  box
const
 

Compute min of quotients of two arrays.

Return the minimum of pointwise quotients of the numerator and denominator.

The quotient is defined as (numerator/denominator) where the denominator is nonzero. When the denominator is zero, the entry is skipped. If the denominator is always zero, the value of tbox::IEEE::getDBL_MAX() is returned (see ::IEEE).

Note: This method is currently intended to support the SUNDIALS vector wrapper only. Please do not use it!


The documentation for this class was generated from the following files:
Generated on Fri Dec 2 11:24:45 2005 for SAMRAI by  doxygen 1.4.2