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

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

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

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

Inheritance graph
[legend]
List of all members.

Public Member Functions

 HierarchySideDataOpsComplex (tbox::Pointer< hier::PatchHierarchy< DIM > > hierarchy, const int coarsest_level=-1, const int finest_level=-1)
virtual ~HierarchySideDataOpsComplex ()
void setPatchHierarchy (tbox::Pointer< hier::PatchHierarchy< DIM > > hierarchy)
void resetLevels (const int coarsest_level, const int finest_level)
const tbox::Pointer< hier::PatchHierarchy<
DIM > > 
getPatchHierarchy () const
void copyData (const int dst_id, const int src_id, const bool interior_only=true) const
void swapData (const int data1_id, const int data2_id) const
void printData (const int data_id, ostream &s, const bool interior_only=true) const
void setToScalar (const int data_id, const dcomplex &alpha, const bool interior_only=true) const
void scale (const int dst_id, const dcomplex &alpha, const int src_id, const bool interior_only=true) const
void addScalar (const int dst_id, const int src_id, const dcomplex &alpha, const bool interior_only=true) const
void add (const int dst_id, const int src1_id, const int src2_id, const bool interior_only=true) const
void subtract (const int dst_id, const int src1_id, const int src2_id, const bool interior_only=true) const
void multiply (const int dst_id, const int src1_id, const int src2_id, const bool interior_only=true) const
void divide (const int dst_id, const int src1_id, const int src2_id, const bool interior_only=true) const
void reciprocal (const int dst_id, const int src_id, const bool interior_only=true) const
void linearSum (const int dst_id, const dcomplex &alpha, const int src1_id, const dcomplex &beta, const int src2_id, const bool interior_only=true) const
void axpy (const int dst_id, const dcomplex &alpha, const int src1_id, const int src2_id, const bool interior_only=true) const
void axmy (const int dst_id, const dcomplex &alpha, const int src1_id, const int src2_id, const bool interior_only=true) const
void abs (const int dst_id, const int src_id, const bool interior_only=true) const
void setRandomValues (const int data_id, const dcomplex &width, const dcomplex &low, const bool interior_only=true) const
int numberOfEntries (const int data_id, const bool interior_only=true) const
double sumControlVolumes (const int data_id, const int vol_id) const
double L1Norm (const int data_id, const int vol_id=-1) const
double L2Norm (const int data_id, const int vol_id=-1) const
double weightedL2Norm (const int data_id, const int weight_id, const int vol_id=-1) const
double RMSNorm (const int data_id, const int vol_id=-1) const
double weightedRMSNorm (const int data_id, const int weight_id, const int vol_id=-1) const
double maxNorm (const int data_id, const int vol_id=-1) const
dcomplex dot (const int data1_id, const int data2_id, const int vol_id=-1) const
dcomplex integral (const int data_id, const int vol_id) const

Detailed Description

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

Class HierarchySideDataOpsComplex<DIM> provides a collection of operations that manipulate complex side-centered patch data components over multiple levels in an AMR hierarchy. It is derived from the abstract base class HierarchyDataOpsComplex<DIM> which defines the interface to similar operations for side-centered, side-centered, side-centered patch data objects where the data is complex. The operations include basic arithmetic and norms. On each patch, the operations are performed by the PatchSideDataOpsComplex<DIM> data member.

The patch hierarchy and set of levels within that hierarcy over which the operations will be performed are set in the constructor. However, note that the constructor accepts default arguments for the coarsest and finest level numbers. If the level numbers are not specified when calling the constructor the levels which exist in the hierarchy will be assumed in all operations. The hierarchy and levels may be changed at any time using the proper member functions.

Note that, when it makes sense, an operation accept a boolean argument which indicates whether the operation should be performed on all of the data or just those data elements corresponding to the patch interiors. If no boolean argument is provided, the default behavior is to treat only the patch interiors. Also, a similar set of operations for real (double and float) and integer side-centered data is provided in the classes HierarchySideDataOpsReal<DIM> and HierarchySideDataOpsInteger<DIM>, respectively.

See also:
math::PatchSideDataOpsComplex


Constructor & Destructor Documentation

template<int DIM>
SAMRAI::math::HierarchySideDataOpsComplex< DIM >::HierarchySideDataOpsComplex tbox::Pointer< hier::PatchHierarchy< DIM > >  hierarchy,
const int  coarsest_level = -1,
const int  finest_level = -1
 

The constructor for the HierarchySideDataOpsComplex<DIM> class sets the default patch hierarchy and coarsest and finest patch levels in that hierarchy over which operations will be performed. The hierarchy and operations may be reset using the member fuctions setPatchHierarchy() and resetLevels() below. If no level number arguments are given here, the levels over which the operations will be performed are those already existing in the hierarchy. If the hierarchy level configuration changes, the operations must be explicitly reset by calling the resetLevels() function.

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

Virtual destructor for the HierarchySideDataOpsComplex<DIM> class.


Member Function Documentation

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::setPatchHierarchy tbox::Pointer< hier::PatchHierarchy< DIM > >  hierarchy  )  [virtual]
 

Reset patch hierarchy over which operations occur.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::resetLevels const int  coarsest_level,
const int  finest_level
[virtual]
 

Reset range of patch levels over which operations occur. Levels must exist in hierarchy or an assertion will result.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
const tbox::Pointer< hier::PatchHierarchy< DIM > > SAMRAI::math::HierarchySideDataOpsComplex< DIM >::getPatchHierarchy  )  const [virtual]
 

Return const pointer to patch hierarchy associated with operations.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::copyData const int  dst_id,
const int  src_id,
const bool  interior_only = true
const [virtual]
 

Copy source data to destination data.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::swapData const int  data1_id,
const int  data2_id
const [virtual]
 

Swap data pointers (i.e., storage) between two data components.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::printData const int  data_id,
ostream &  s,
const bool  interior_only = true
const [virtual]
 

Print data over multiple levels to specified output stream.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::setToScalar const int  data_id,
const dcomplex alpha,
const bool  interior_only = true
const [virtual]
 

Set data component to given scalar.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::scale const int  dst_id,
const dcomplex alpha,
const int  src_id,
const bool  interior_only = true
const [virtual]
 

Set destination to source multiplied by given scalar, pointwise.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::addScalar const int  dst_id,
const int  src_id,
const dcomplex alpha,
const bool  interior_only = true
const [virtual]
 

Add scalar to each entry in source data and set destination to result.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::add const int  dst_id,
const int  src1_id,
const int  src2_id,
const bool  interior_only = true
const [virtual]
 

Set destination to sum of two source components, pointwise.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::subtract const int  dst_id,
const int  src1_id,
const int  src2_id,
const bool  interior_only = true
const [virtual]
 

Subtract second source component from first source component pointwise and set destination data component to result.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::multiply const int  dst_id,
const int  src1_id,
const int  src2_id,
const bool  interior_only = true
const [virtual]
 

Set destination component to product of two source components, pointwise.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::divide const int  dst_id,
const int  src1_id,
const int  src2_id,
const bool  interior_only = true
const [virtual]
 

Divide first data component by second source component pointwise and set destination data component to result.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::reciprocal const int  dst_id,
const int  src_id,
const bool  interior_only = true
const [virtual]
 

Set each entry of destination component to reciprocal of corresponding source data component entry.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::linearSum const int  dst_id,
const dcomplex alpha,
const int  src1_id,
const dcomplex beta,
const int  src2_id,
const bool  interior_only = true
const [virtual]
 

Set $d = \alpha s_1 + \beta s_2$ , where $d$ is the destination patch data component and $s_1, s_2$ are the first and second source components, respectively. Here $\alpha, \beta$ are scalar values.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::axpy const int  dst_id,
const dcomplex alpha,
const int  src1_id,
const int  src2_id,
const bool  interior_only = true
const [virtual]
 

Set $d = \alpha s_1 + s_2$ , where $d$ is the destination patch data component and $s_1, s_2$ are the first and second source components, respectively. Here $\alpha$ is a scalar.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::axmy const int  dst_id,
const dcomplex alpha,
const int  src1_id,
const int  src2_id,
const bool  interior_only = true
const [virtual]
 

Set $d = \alpha s_1 - s_2$ , where $d$ is the destination patch data component and $s_1, s_2$ are the first and second source components, respectively. Here $\alpha$ is a scalar.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::abs const int  dst_id,
const int  src_id,
const bool  interior_only = true
const [virtual]
 

Set destination data to absolute value of source data, pointwise. Note that the source data must be dcomplex and the destination must be double.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
void SAMRAI::math::HierarchySideDataOpsComplex< DIM >::setRandomValues const int  data_id,
const dcomplex width,
const dcomplex low,
const bool  interior_only = true
const [virtual]
 

Set data entries to random values. See the operations in the array data operation classes for details on the generation of the random values.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
int SAMRAI::math::HierarchySideDataOpsComplex< DIM >::numberOfEntries const int  data_id,
const bool  interior_only = true
const [virtual]
 

Return the total number of data values for the component on the set of hierarchy levels. If the boolean argument is true, the number of elements will be summed over patch interiors in a unique way which avoids multiple counting of redundant values (recall the definition of node points on a patch interior). If the boolean argument is false, all elements will be counted (including ghost values) over all patches.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
double SAMRAI::math::HierarchySideDataOpsComplex< DIM >::sumControlVolumes const int  data_id,
const int  vol_id
const [virtual]
 

Return sum of the control volumes associated with the data component. Note that if the ontrol volumes are set propery, this is equivalent to integrating a data component containing all ones over the collection of hierarchy levels.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
double SAMRAI::math::HierarchySideDataOpsComplex< DIM >::L1Norm const int  data_id,
const int  vol_id = -1
const [virtual]
 

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 undefined (vol_id < 0), the return value is $\sum_i ( \sqrt{data_i * \bar{data_i}} )$ .

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
double SAMRAI::math::HierarchySideDataOpsComplex< DIM >::L2Norm const int  data_id,
const int  vol_id = -1
const [virtual]
 

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 undefined (vol_id < 0), the return value is $\sqrt{ \sum_i ( data_i * \bar{data_i} ) }$ .

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
double SAMRAI::math::HierarchySideDataOpsComplex< DIM >::weightedL2Norm const int  data_id,
const int  weight_id,
const int  vol_id = -1
const [virtual]
 

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 undefined (vol_id < 0), the return value is $\sqrt{ \sum_i ( (data_i * wgt_i) * \bar{(data_i * wgt_i)} cvol_i ) }$ .

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
double SAMRAI::math::HierarchySideDataOpsComplex< DIM >::RMSNorm const int  data_id,
const int  vol_id = -1
const [virtual]
 

Return discrete root mean squared norm of the data. If the control volume is specified (vol_id >= 0), 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.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
double SAMRAI::math::HierarchySideDataOpsComplex< DIM >::weightedRMSNorm const int  data_id,
const int  weight_id,
const int  vol_id = -1
const [virtual]
 

Return discrete weighted root mean squared norm of the data. If the control volume is specified (vol_id >= 0), 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.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
double SAMRAI::math::HierarchySideDataOpsComplex< DIM >::maxNorm const int  data_id,
const int  vol_id = -1
const [virtual]
 

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 undefined (vol_id < 0), it is ignored during the computation of the maximum.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
dcomplex SAMRAI::math::HierarchySideDataOpsComplex< DIM >::dot const int  data1_id,
const int  data2_id,
const int  vol_id = -1
const [virtual]
 

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 undefined (vol_id < 0), it is ignored during the summation.

Implements SAMRAI::math::HierarchyDataOpsComplex< DIM >.

template<int DIM>
dcomplex SAMRAI::math::HierarchySideDataOpsComplex< DIM >::integral const int  data_id,
const int  vol_id
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 Fri Dec 2 11:26:16 2005 for SAMRAI by  doxygen 1.4.2