SAMRAI::math::PatchSideDataNormOpsComplex< DIM > Class Template Reference

#include <source/mathops/side/PatchSideDataNormOpsComplex.h>

Inheritance diagram for SAMRAI::math::PatchSideDataNormOpsComplex< DIM >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 PatchSideDataNormOpsComplex ()
virtual ~PatchSideDataNormOpsComplex ()
int numberOfEntries (const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &data, const hier::Box< DIM > &box) const
double sumControlVolumes (const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &data, const tbox::Pointer< pdat::SideData< DIM, double > > &cvol, const hier::Box< DIM > &box) const
void abs (tbox::Pointer< pdat::SideData< DIM, double > > &dst, const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &src, const hier::Box< DIM > &box) const
double L1Norm (const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &data, const hier::Box< DIM > &box, const tbox::Pointer< pdat::SideData< DIM, double > > cvol=(0)) const
double L2Norm (const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &data, const hier::Box< DIM > &box, const tbox::Pointer< pdat::SideData< DIM, double > > cvol=(0)) const
double weightedL2Norm (const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &data, const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &weight, const hier::Box< DIM > &box, const tbox::Pointer< pdat::SideData< DIM, double > > cvol=(0)) const
double RMSNorm (const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &data, const hier::Box< DIM > &box, const tbox::Pointer< pdat::SideData< DIM, double > > cvol=(0)) const
double weightedRMSNorm (const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &data, const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &weight, const hier::Box< DIM > &box, const tbox::Pointer< pdat::SideData< DIM, double > > cvol=(0)) const
double maxNorm (const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &data, const hier::Box< DIM > &box, const tbox::Pointer< pdat::SideData< DIM, double > > cvol=(0)) const
dcomplex dot (const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &data1, const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &data2, const hier::Box< DIM > &box, const tbox::Pointer< pdat::SideData< DIM, double > > cvol=(0)) const
dcomplex integral (const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &data, const hier::Box< DIM > &box, const tbox::Pointer< pdat::SideData< DIM, double > > vol) const

Detailed Description

template<int DIM>
class SAMRAI::math::PatchSideDataNormOpsComplex< DIM >

Class PatchSideDataNormOpsComplex<DIM> provides a collection of common norm operations that may be applied to complex side-centered patch data. The primary intent of this class is to define part of the interface for the PatchSideDataOpsComplex<DIM> class which provides access to operations that may be used to manipulate complex side-centered patch data. Each member function accepts a box argument indicating the region of index space on which the operation should be performed. The operation will be performed on the intersection of this box and those boxes corresponding to the patch data objects. Also, each operation allows an additional side-centered patch data object to be used to represent a control volume that weights the contribution of each data entry in the given norm calculation. Note that the control volume patch data must be of type double and have side-centered geometry (i.e., the same as the data itself). 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. If the control volume is not given in the function call, it will be ignored in the calculation. Also, note that the depth of the control volume patch data object must be either 1 or be equal to the depth of the other data objects.

Note that a similar set of norm operations is implemented for real patch data (double and float) in the class PatchSideDataNormOpsReal<DIM>.

See also:
math::ArrayDataNormOpsComplex


Constructor & Destructor Documentation

template<int DIM>
SAMRAI::math::PatchSideDataNormOpsComplex< DIM >::PatchSideDataNormOpsComplex (  ) 

Empty constructor and destructor.

template<int DIM>
SAMRAI::math::PatchSideDataNormOpsComplex< DIM >::~PatchSideDataNormOpsComplex (  )  [virtual]


Member Function Documentation

template<int DIM>
int SAMRAI::math::PatchSideDataNormOpsComplex< DIM >::numberOfEntries ( const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &  data,
const hier::Box< DIM > &  box 
) const

Return the number of data values for the side-centered data object in the given box. Note that it is assumed that the box refers to the cell-centered index space corresponding to the patch hierarchy.

template<int DIM>
double SAMRAI::math::PatchSideDataNormOpsComplex< DIM >::sumControlVolumes ( const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &  data,
const tbox::Pointer< pdat::SideData< DIM, double > > &  cvol,
const hier::Box< DIM > &  box 
) const

Return sum of control volume entries for the side-centered data object.

template<int DIM>
void SAMRAI::math::PatchSideDataNormOpsComplex< DIM >::abs ( tbox::Pointer< pdat::SideData< DIM, double > > &  dst,
const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &  src,
const hier::Box< DIM > &  box 
) const

Set destination component to norm of source component. That is, each destination entry is set to $d_i = \sqrt{ {real(s_i)}^2 + {imag(s_i)}^2 }$.

template<int DIM>
double SAMRAI::math::PatchSideDataNormOpsComplex< DIM >::L1Norm ( const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &  data,
const hier::Box< DIM > &  box,
const tbox::Pointer< pdat::SideData< DIM, double > >  cvol = (0) 
) 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 ( \sqrt{data_i * \bar{data_i}}*cvol_i )$. If the control volume is NULL, the return value is $\sum_i ( \sqrt{data_i * \bar{data_i}} )$.

template<int DIM>
double SAMRAI::math::PatchSideDataNormOpsComplex< DIM >::L2Norm ( const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &  data,
const hier::Box< DIM > &  box,
const tbox::Pointer< pdat::SideData< DIM, double > >  cvol = (0) 
) 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 * \bar{data_i} cvol_i ) }$. If the control volume is NULL, the return value is $\sqrt{ \sum_i ( data_i * \bar{data_i} ) }$.

template<int DIM>
double SAMRAI::math::PatchSideDataNormOpsComplex< DIM >::weightedL2Norm ( const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &  data,
const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &  weight,
const hier::Box< DIM > &  box,
const tbox::Pointer< pdat::SideData< DIM, double > >  cvol = (0) 
) 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 * wgt_i) * \bar{(data_i * wgt_i)} cvol_i ) }$. If the control volume is NULL, the return value is $\sqrt{ \sum_i ( (data_i * wgt_i) * \bar{(data_i * wgt_i)} cvol_i ) }$.

template<int DIM>
double SAMRAI::math::PatchSideDataNormOpsComplex< DIM >::RMSNorm ( const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &  data,
const hier::Box< DIM > &  box,
const tbox::Pointer< pdat::SideData< DIM, double > >  cvol = (0) 
) const

Return discrete root mean squared norm of the data. If the control volume is not NULL, the return value is the $L_2$-norm divided by the square root of the sum of the control volumes. Otherwise, the return value is the $L_2$-norm divided by the square root of the number of data entries.

template<int DIM>
double SAMRAI::math::PatchSideDataNormOpsComplex< DIM >::weightedRMSNorm ( const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &  data,
const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &  weight,
const hier::Box< DIM > &  box,
const tbox::Pointer< pdat::SideData< DIM, double > >  cvol = (0) 
) const

Return discrete weighted root mean squared norm of the data. If the control volume is not NULL, the return value is the weighted $L_2$-norm divided by the square root of the sum of the control volumes. Otherwise, the return value is the weighted $L_2$-norm divided by the square root of the number of data entries.

template<int DIM>
double SAMRAI::math::PatchSideDataNormOpsComplex< DIM >::maxNorm ( const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &  data,
const hier::Box< DIM > &  box,
const tbox::Pointer< pdat::SideData< DIM, double > >  cvol = (0) 
) 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 ( \sqrt{data_i * \bar{data_i}} )$, where the max is over the data elements where $cvol_i > 0$. If the control volume is NULL, it is ignored during the computation of the maximum.

template<int DIM>
dcomplex SAMRAI::math::PatchSideDataNormOpsComplex< DIM >::dot ( const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &  data1,
const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &  data2,
const hier::Box< DIM > &  box,
const tbox::Pointer< pdat::SideData< DIM, double > >  cvol = (0) 
) 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 * \bar{data2_i} * cvol_i )$. If the control volume is NULL, it is ignored during the summation.

template<int DIM>
dcomplex SAMRAI::math::PatchSideDataNormOpsComplex< DIM >::integral ( const tbox::Pointer< pdat::SideData< DIM, dcomplex > > &  data,
const hier::Box< DIM > &  box,
const tbox::Pointer< pdat::SideData< DIM, double > >  vol 
) const

Return the integral of the function represented by 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 Thu Jun 18 11:28:39 2009 for SAMRAI by  doxygen 1.5.1