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

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

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

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

Inheritance graph
[legend]
List of all members.

Public Member Functions

 ArrayDataNormOpsReal ()
 ~ArrayDataNormOpsReal ()
double sumControlVolumes (const pdat::ArrayData< DIM, TYPE > &data, const pdat::ArrayData< DIM, double > &cvol, const hier::Box< DIM > &box) const
void abs (pdat::ArrayData< DIM, TYPE > &dst, const pdat::ArrayData< DIM, TYPE > &src, const hier::Box< DIM > &box) const
double L1NormWithControlVolume (const pdat::ArrayData< DIM, TYPE > &data, const pdat::ArrayData< DIM, double > &cvol, const hier::Box< DIM > &box) const
double L1Norm (const pdat::ArrayData< DIM, TYPE > &data, const hier::Box< DIM > &box) const
double L2NormWithControlVolume (const pdat::ArrayData< DIM, TYPE > &data, const pdat::ArrayData< DIM, double > &cvol, const hier::Box< DIM > &box) const
double L2Norm (const pdat::ArrayData< DIM, TYPE > &data, const hier::Box< DIM > &box) const
double weightedL2NormWithControlVolume (const pdat::ArrayData< DIM, TYPE > &data, const pdat::ArrayData< DIM, TYPE > &weight, const pdat::ArrayData< DIM, double > &cvol, const hier::Box< DIM > &box) const
double weightedL2Norm (const pdat::ArrayData< DIM, TYPE > &data, const pdat::ArrayData< DIM, TYPE > &weight, const hier::Box< DIM > &box) const
double maxNormWithControlVolume (const pdat::ArrayData< DIM, TYPE > &data, const pdat::ArrayData< DIM, double > &cvol, const hier::Box< DIM > &box) const
double maxNorm (const pdat::ArrayData< DIM, TYPE > &data, const hier::Box< DIM > &box) const
TYPE dotWithControlVolume (const pdat::ArrayData< DIM, TYPE > &data1, const pdat::ArrayData< DIM, TYPE > &data2, const pdat::ArrayData< DIM, double > &cvol, const hier::Box< DIM > &box) const
TYPE dot (const pdat::ArrayData< DIM, TYPE > &data1, const pdat::ArrayData< DIM, TYPE > &data2, const hier::Box< DIM > &box) const
TYPE integral (const pdat::ArrayData< DIM, TYPE > &data, const pdat::ArrayData< DIM, double > &vol, const hier::Box< DIM > &box) const

Detailed Description

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

Class ArrayDataNormOpsReal<DIM> provides a set of common norm operations that may be applied to arrays of real data values (either float or double) maintained as pdat::ArrayData<DIM> objects. The intent of this class is to provide a single implementation of these operations as they are needed by objects that perform these operations on the standard array-based patch data types (i.e., cell-centered, face-centered, node-centered). Each of the norm operations 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 norm calculation. The use of control volumes is important when these operations are used in vector kernels where the data resides over multiple levels in an AMR hierarchy. Note also that each operation will be performed on the intersection of the box in the function argument list and the boxes associated with all pdat::ArrayData<DIM> objects.

These operations typically apply only to the numerical standard built-in types, such as double, float, and the complex type (which may or may not be a built-in type depending on the C++ compiler). This templated class should only be used to instantiate objects with double or float as the template parameter. A similar set of norm operations is implemented for complex array data in the class ArrayDataNormOpsComplex<DIM>.

See also:
pdat::ArrayData


Constructor & Destructor Documentation

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

Empty constructor and destructor.

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


Member Function Documentation

template<int DIM, class TYPE>
double SAMRAI::math::ArrayDataNormOpsReal< DIM, TYPE >::sumControlVolumes const pdat::ArrayData< DIM, TYPE > &  data,
const pdat::ArrayData< DIM, double > &  cvol,
const hier::Box< DIM > &  box
const
 

Return sum of entries in control volume array.

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

Set destination component to absolute value of source component. That is, each destination entry is set to $d_i = \| s_i \|$ .

template<int DIM, class TYPE>
double SAMRAI::math::ArrayDataNormOpsReal< DIM, TYPE >::L1NormWithControlVolume const pdat::ArrayData< DIM, TYPE > &  data,
const pdat::ArrayData< DIM, double > &  cvol,
const hier::Box< DIM > &  box
const
 

Return discrete $L_1$ -norm of the data using the control volume to weight the contribution of each data entry to the sum. That is, the return value is the sum $\sum_i ( \| data_i \| cvol_i )$ .

template<int DIM, class TYPE>
double SAMRAI::math::ArrayDataNormOpsReal< DIM, TYPE >::L1Norm const pdat::ArrayData< DIM, TYPE > &  data,
const hier::Box< DIM > &  box
const
 

Return discrete $L_1$ -norm of the data. That is, the return value is the sum $\sum_i ( \| data_i \| )$ .

template<int DIM, class TYPE>
double SAMRAI::math::ArrayDataNormOpsReal< DIM, TYPE >::L2NormWithControlVolume const pdat::ArrayData< DIM, TYPE > &  data,
const pdat::ArrayData< DIM, double > &  cvol,
const hier::Box< DIM > &  box
const
 

Return discrete $L_2$ -norm of the data using the control volume to weight the contribution of each data entry to the sum. That is, the return value is the sum $\sqrt{ \sum_i ( (data_i)^2 cvol_i ) }$ .

template<int DIM, class TYPE>
double SAMRAI::math::ArrayDataNormOpsReal< DIM, TYPE >::L2Norm const pdat::ArrayData< DIM, TYPE > &  data,
const hier::Box< DIM > &  box
const
 

Return discrete $L_2$ -norm of the data using the control volume to weight the contribution of each data entry to the sum. That is, the return value is the sum $\sqrt{ \sum_i ( (data_i)^2 cvol_i ) }$ .

template<int DIM, class TYPE>
double SAMRAI::math::ArrayDataNormOpsReal< DIM, TYPE >::weightedL2NormWithControlVolume const pdat::ArrayData< DIM, TYPE > &  data,
const pdat::ArrayData< DIM, TYPE > &  weight,
const pdat::ArrayData< DIM, double > &  cvol,
const hier::Box< DIM > &  box
const
 

Return discrete weighted $L_2$ -norm of the data using the control volume to weight the contribution of the data and weight entries to the sum. That is, the return value is the sum $\sqrt{ \sum_i ( (data_i * weight_i)^2 cvol_i ) }$ .

template<int DIM, class TYPE>
double SAMRAI::math::ArrayDataNormOpsReal< DIM, TYPE >::weightedL2Norm const pdat::ArrayData< DIM, TYPE > &  data,
const pdat::ArrayData< DIM, TYPE > &  weight,
const hier::Box< DIM > &  box
const
 

Return discrete weighted $L_2$ -norm of the data. That is, the return value is the sum $\sqrt{ \sum_i ( (data_i * weight_i)^2 ) }$ .

template<int DIM, class TYPE>
double SAMRAI::math::ArrayDataNormOpsReal< DIM, TYPE >::maxNormWithControlVolume const pdat::ArrayData< DIM, TYPE > &  data,
const pdat::ArrayData< DIM, double > &  cvol,
const hier::Box< DIM > &  box
const
 

Return the $\max$ -norm of the data using the control volume to weight the contribution of each data entry to the maximum. That is, the return value is $\max_i ( \| data_i \| )$ , where the max is over the data elements where $cvol_i > 0$ .

template<int DIM, class TYPE>
double SAMRAI::math::ArrayDataNormOpsReal< DIM, TYPE >::maxNorm const pdat::ArrayData< DIM, TYPE > &  data,
const hier::Box< DIM > &  box
const
 

Return the $\max$ -norm of the data. That is, the return value is $\max_i ( \| data_i \| )$ .

template<int DIM, class TYPE>
TYPE SAMRAI::math::ArrayDataNormOpsReal< DIM, TYPE >::dotWithControlVolume 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 the dot product of the two data arrays using the control volume to weight the contribution of each product to the sum. That is, the return value is the sum $\sum_i ( data1_i * data2_i * cvol_i )$ .

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

Return the dot product of the two data arrays. That is, the return value is the sum $\sum_i ( data1_i * data2_i )$ .

template<int DIM, class TYPE>
TYPE SAMRAI::math::ArrayDataNormOpsReal< DIM, TYPE >::integral const pdat::ArrayData< DIM, TYPE > &  data,
const pdat::ArrayData< DIM, double > &  vol,
const hier::Box< DIM > &  box
const
 

Return the integral of the function based on the data array. The return value is the sum $\sum_i ( data_i * vol_i )$ .


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