SAMRAI::mesh::HistogramBox< DIM > Class Template Reference

Class HistogramBox<DIM> manages the histogram signature array for a region of index space contained within a single box. It is used during the regridding process to gather information about the distribution of tagged cells across a portion of a patch level. More...

#include <source/mesh/clustering/HistogramBox.h>

List of all members.

Public Types

enum  { ORIGINAL_MODE = 0, ORIG_FAST_REDUCE_MODE = 1, BINARY_TREE_MODE = 2, COMMUNICATOR_MODE = 3 }

Public Member Functions

 HistogramBox ()
 HistogramBox (const hier::Box< DIM > &box)
 ~HistogramBox ()
void findBoundBoxForTags (hier::Box< DIM > &bound_box, const hier::IntVector< DIM > &min_box) const
void boundTagHistogram (int &box_lo, int &box_hi, const int id, const int min_size) const
void setCommunicationMode (int mode)
void setCommunicator (tbox::SAMRAI_MPI::comm comm)
int computeTagHistogram (const tbox::Pointer< hier::PatchLevel< DIM > > level, const int tag_index, const int tag_val)
const hier::Box< DIM > & getBox () const
tbox::Array< int > & histogram (const int id)
const tbox::Array< int > & histogram (const int id) const
int & histogramElt (const int id, const int ic)
const int & histogramElt (const int id, const int ic) const
void setBox (const hier::Box< DIM > &box)
void resetHistogram ()
void reduceTags (const tbox::Pointer< hier::PatchLevel< DIM > > level)
void reduceTags (const int id, const tbox::Pointer< hier::PatchLevel< DIM > > level, const int tag_index, const int tag_val)


Detailed Description

template<int DIM>
class SAMRAI::mesh::HistogramBox< DIM >

Class HistogramBox<DIM> manages the histogram signature array for a region of index space contained within a single box. It is used during the regridding process to gather information about the distribution of tagged cells across a portion of a patch level.


Member Enumeration Documentation

template<int DIM>
anonymous enum

Enumerated type for the communication mode. For a description of each of these modes,

See also:
mesh::BergerRigoutsos.
Enumerator:
ORIGINAL_MODE 
ORIG_FAST_REDUCE_MODE 
BINARY_TREE_MODE 
COMMUNICATOR_MODE 


Constructor & Destructor Documentation

template<int DIM>
SAMRAI::mesh::HistogramBox< DIM >::HistogramBox (  ) 

Default constructor for HistogramBox<DIM>. Note that the HistogramBox<DIM> must be initialized with a box before it can be used.

template<int DIM>
SAMRAI::mesh::HistogramBox< DIM >::HistogramBox ( const hier::Box< DIM > &  box  ) 

Constructor for the HistogramBox<DIM>. The HistogramBox<DIM> will be initialized with the box and the histogram elements will be allocated and initialized to zero.

template<int DIM>
SAMRAI::mesh::HistogramBox< DIM >::~HistogramBox (  ) 

Destructor for the HistogramBox.


Member Function Documentation

template<int DIM>
void SAMRAI::mesh::HistogramBox< DIM >::findBoundBoxForTags ( hier::Box< DIM > &  bound_box,
const hier::IntVector< DIM > &  min_box 
) const

Given histogram information in a box region, determine smallest box containing non-zero histogram points. Note that this routine assumes that histogram values are already computed.

template<int DIM>
void SAMRAI::mesh::HistogramBox< DIM >::boundTagHistogram ( int &  box_lo,
int &  box_hi,
const int  id,
const int  min_size 
) const

Bound the non-zero histogram elements within the specified interval (box_lo, box_hi) in the given coordinate direction.

template<int DIM>
void SAMRAI::mesh::HistogramBox< DIM >::setCommunicationMode ( int  mode  ) 

Set the method used to perform historgram reduction. (This function should only by called from within BergerRigoutsos<DIM>::findBoxesContainingTags.)

template<int DIM>
void SAMRAI::mesh::HistogramBox< DIM >::setCommunicator ( tbox::SAMRAI_MPI::comm  comm  ) 

Set the communicator to use during histogram reduction. This call only has an effect when used in conjunction with setCommunicationMode(COMMUNICATOR_MODE); (This function should only by called from within BergerRigoutsos<DIM>::findBoxesContainingTags.)

template<int DIM>
int SAMRAI::mesh::HistogramBox< DIM >::computeTagHistogram ( const tbox::Pointer< hier::PatchLevel< DIM > >  level,
const int  tag_index,
const int  tag_val 
)

Compute histogram for integer tags (matching tag_val) within the histogram box on the patch level.

template<int DIM>
void SAMRAI::mesh::HistogramBox< DIM >::reduceTags ( const tbox::Pointer< hier::PatchLevel< DIM > >  level  ) 

Compute global histogram by performing a reduction sum on the local histograms. Note that the reduction is needed since the histogram box will not be contained within any single patch, in general. Also, if the integer tag patch data corresponding to the given descriptor index has ghost cells, the values in these cells are ignored so that the reduction sums data over patch interiors only.

template<int DIM>
void SAMRAI::mesh::HistogramBox< DIM >::reduceTags ( const int  id,
const tbox::Pointer< hier::PatchLevel< DIM > >  level,
const int  tag_index,
const int  tag_val 
)

template<int DIM>
const hier::Box< DIM > & SAMRAI::mesh::HistogramBox< DIM >::getBox (  )  const [inline]

Return const reference to box represented by histogram.

template<int DIM>
tbox::Array< int > & SAMRAI::mesh::HistogramBox< DIM >::histogram ( const int  id  )  [inline]

Return non-const reference to histogram array for given direction. Note that there is no bounds-checking on direction number.

template<int DIM>
const tbox::Array< int > & SAMRAI::mesh::HistogramBox< DIM >::histogram ( const int  id  )  const [inline]

Return const reference to histogram array for given direction. Note that there is no bounds-checking on direction number.

template<int DIM>
int & SAMRAI::mesh::HistogramBox< DIM >::histogramElt ( const int  id,
const int  ic 
) [inline]

Return non-const histogram element corresponding to given direction and cell index. Note cell index and histogram array location are distinct, in general. Also, there is no bounds checking done to assure the cell index lies within the box.

template<int DIM>
const int & SAMRAI::mesh::HistogramBox< DIM >::histogramElt ( const int  id,
const int  ic 
) const [inline]

Return const histogram element corresponding to given direction and cell index. Note cell index and histogram array location are distinct, in general. Also, there is no bounds checking done to assure the cell index lies within the box.

template<int DIM>
void SAMRAI::mesh::HistogramBox< DIM >::setBox ( const hier::Box< DIM > &  box  ) 

Set the box for the HistogramBox, allocate storage for the histogram signature arrays, and initialize the histogram elements to zero.

template<int DIM>
void SAMRAI::mesh::HistogramBox< DIM >::resetHistogram (  ) 

Set all histogram elements to zero.


The documentation for this class was generated from the following files:
Generated on Thu Jun 18 11:28:40 2009 for SAMRAI by  doxygen 1.5.1