IBAMR  IBAMR version 0.19.
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SAMRAI::math::HierarchyNodeDataOpsInteger< DIM > Class Template Reference

#include <HierarchyNodeDataOpsInteger.h>

Inheritance diagram for SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >:
Inheritance graph
[legend]

Public Member Functions

 HierarchyNodeDataOpsInteger (tbox::Pointer< hier::PatchHierarchy< DIM > > hierarchy, const int coarsest_level=-1, const int finest_level=-1)
 
virtual ~HierarchyNodeDataOpsInteger ()
 
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
 
int numberOfEntries (const int data_id, const bool interior_only=true) 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, std::ostream &s, const bool interior_only=true) const
 
void setToScalar (const int data_id, const int &alpha, const bool interior_only=true) const
 
void scale (const int dst_id, const int &alpha, const int src_id, const bool interior_only=true) const
 
void addScalar (const int dst_id, const int src_id, const int &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 int &alpha, const int src1_id, const int &beta, const int src2_id, const bool interior_only=true) const
 
void axpy (const int dst_id, const int &alpha, const int src1_id, const int src2_id, const bool interior_only=true) const
 
void axmy (const int dst_id, const int &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
 
int min (const int data_id, const bool interior_only=true) const
 
int max (const int data_id, const bool interior_only=true) const
 
void setRandomValues (const int data_id, const int &width, const int &low, const bool interior_only=true) const
 

Private Member Functions

 HierarchyNodeDataOpsInteger (const HierarchyNodeDataOpsInteger< DIM > &)
 
void operator= (const HierarchyNodeDataOpsInteger< DIM > &)
 
void maybeResetOverlappingBoxLists () const
 

Private Attributes

tbox::Pointer< hier::PatchHierarchy< DIM > > d_hierarchy
 
int d_coarsest_level
 
int d_finest_level
 
tbox::Array< tbox::Array< hier::BoxList< DIM > > > d_nonoverlapping_node_boxes
 
PatchNodeDataOpsInteger< DIM > d_patch_ops
 

Detailed Description

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

Class HierarchyNodeDataOpsInteger<DIM> provides a collection of operations that manipulate integer node-centered patch data components over multiple levels in an AMR hierarchy. It is derived from the abstract base class HierarchyDataOpsInteger<DIM> which defines the interface to similar operations for node-centered, face-centered, node-centered patch data objects where the data is of type integer. The operations include basic arithmetic and some ordering operations. On each patch, the operations are performed by the PatchNodeDataOpsInteger<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 complex node-centered data is provided in the classes HierarchyNodeDataOpsReal<DIM> and HierarchyNodeDataOpsComplex<DIM>, respectively.

See also
math::PatchNodeDataOpsInteger

Constructor & Destructor Documentation

◆ HierarchyNodeDataOpsInteger() [1/2]

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

The constructor for the HierarchyNodeDataOpsInteger<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.

◆ ~HierarchyNodeDataOpsInteger()

template<int DIM>
virtual SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::~HierarchyNodeDataOpsInteger ( )
virtual

Virtual destructor for the HierarchyNodeDataOpsInteger<DIM> class.

◆ HierarchyNodeDataOpsInteger() [2/2]

Member Function Documentation

◆ setPatchHierarchy()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::setPatchHierarchy ( tbox::Pointer< hier::PatchHierarchy< DIM > >  hierarchy)
virtual

Reset patch hierarchy over which operations occur.

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

◆ resetLevels()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< 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::HierarchyDataOpsInteger< DIM >.

◆ getPatchHierarchy()

template<int DIM>
const tbox::Pointer< hier::PatchHierarchy<DIM> > SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::getPatchHierarchy ( ) const
virtual

Return const pointer to patch hierarchy associated with operations.

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

◆ numberOfEntries()

template<int DIM>
int SAMRAI::math::HierarchyNodeDataOpsInteger< 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::HierarchyDataOpsInteger< DIM >.

◆ copyData()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< 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::HierarchyDataOpsInteger< DIM >.

◆ swapData()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< 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::HierarchyDataOpsInteger< DIM >.

◆ printData()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::printData ( const int  data_id,
std::ostream &  s,
const bool  interior_only = true 
) const
virtual

Print data over multiple levels to specified output stream.

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

◆ setToScalar()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::setToScalar ( const int  data_id,
const int alpha,
const bool  interior_only = true 
) const
virtual

Set data component to given scalar.

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

◆ scale()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::scale ( const int  dst_id,
const int alpha,
const int  src_id,
const bool  interior_only = true 
) const
virtual

Set destination to source multiplied by given scalar, pointwise.

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

◆ addScalar()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::addScalar ( const int  dst_id,
const int  src_id,
const int alpha,
const bool  interior_only = true 
) const
virtual

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

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

◆ add()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< 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::HierarchyDataOpsInteger< DIM >.

◆ subtract()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< 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::HierarchyDataOpsInteger< DIM >.

◆ multiply()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< 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::HierarchyDataOpsInteger< DIM >.

◆ divide()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< 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::HierarchyDataOpsInteger< DIM >.

◆ reciprocal()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< 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::HierarchyDataOpsInteger< DIM >.

◆ linearSum()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::linearSum ( const int  dst_id,
const int alpha,
const int  src1_id,
const int 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::HierarchyDataOpsInteger< DIM >.

◆ axpy()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::axpy ( const int  dst_id,
const int 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::HierarchyDataOpsInteger< DIM >.

◆ axmy()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::axmy ( const int  dst_id,
const int 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::HierarchyDataOpsInteger< DIM >.

◆ abs()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< 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.

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

◆ min()

template<int DIM>
int SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::min ( const int  data_id,
const bool  interior_only = true 
) const
virtual

Return minimum data value over all patches in the collection of levels.

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

◆ max()

template<int DIM>
int SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::max ( const int  data_id,
const bool  interior_only = true 
) const
virtual

Return maximum data value over all patches in the collection of levels.

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

◆ setRandomValues()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::setRandomValues ( const int  data_id,
const int width,
const int 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::HierarchyDataOpsInteger< DIM >.

◆ operator=()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::operator= ( const HierarchyNodeDataOpsInteger< DIM > &  )
private

◆ maybeResetOverlappingBoxLists()

template<int DIM>
void SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::maybeResetOverlappingBoxLists ( ) const
private

Set d_nonoverlapping_side_boxes to the correct value.

d_nonoverlapping_side_boxes is extremely expensive to compute, and for whatever reason SAMRAI calls resetLevels() in most linear algebra functions: this results in, for problems with lots of patches, the majority of runtime being spent recomputing overlap repeatedly in solvers when we never actually need the information.

Member Data Documentation

◆ d_hierarchy

template<int DIM>
tbox::Pointer< hier::PatchHierarchy<DIM> > SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::d_hierarchy
private

◆ d_coarsest_level

template<int DIM>
int SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::d_coarsest_level
private

◆ d_finest_level

template<int DIM>
int SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::d_finest_level
private

◆ d_nonoverlapping_node_boxes

template<int DIM>
tbox::Array< tbox::Array< hier::BoxList<DIM> > > SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::d_nonoverlapping_node_boxes
mutableprivate

◆ d_patch_ops

template<int DIM>
PatchNodeDataOpsInteger<DIM> SAMRAI::math::HierarchyNodeDataOpsInteger< DIM >::d_patch_ops
private

The documentation for this class was generated from the following file: